Skip to main content
MCP (Model Context Protocol) is an open protocol for tool interoperability with AI models. ChatCLI integrates with MCP servers, allowing the AI to access external tools such as file systems, web searches, databases, and any compatible service.

Overview

ChatCLI <-> MCP Manager <-> MCP Server (stdio/SSE)
                              |
                         External tools
                         (filesystem, search, DB, ...)
1

Load configuration

The MCP Manager loads the MCP server configuration.
2

Start servers

Starts the configured servers (stdio or SSE).
3

Discover tools

Discovers the available tools on each server.
4

Expose to the model

Exposes the tools to the AI model as ToolDefinition.
5

Route calls

Routes tool calls to the correct server.

Configuration

Configuration File

Create ~/.chatcli/mcp_servers.json:
{
  "mcpServers": [
    {
      "name": "filesystem",
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@anthropic/mcp-server-filesystem", "/workspace"],
      "enabled": true
    },
    {
      "name": "web-search",
      "transport": "sse",
      "url": "http://localhost:8080/sse",
      "enabled": true
    },
    {
      "name": "database",
      "transport": "stdio",
      "command": "/usr/local/bin/mcp-postgres",
      "args": ["--connection-string", "postgresql://localhost/mydb"],
      "env": {
        "PGPASSWORD": "secret"
      },
      "enabled": true
    }
  ]
}

Environment Variables

CHATCLI_MCP_ENABLED=true
CHATCLI_MCP_CONFIG=~/.chatcli/mcp_servers.json

Via Server Flag

chatcli server --mcp-config ~/.chatcli/mcp_servers.json

Transports

The stdio transport starts a local process and communicates via stdin/stdout using JSON-RPC 2.0:
{
  "name": "filesystem",
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@anthropic/mcp-server-filesystem", "/workspace"]
}
Use case: Local servers distributed as npm packages, standalone binaries, or scripts.

Tool Naming

MCP tools are automatically prefixed with mcp_ and receive a description from the source server:
Original name: read_file
Name in ChatCLI: mcp_read_file
Description: [MCP:filesystem] Reads a file from the filesystem
The mcp_ prefix prevents collisions with ChatCLI’s native tools.

Deploy via Helm

# values.yaml
mcp:
  enabled: true
  servers:
    - name: filesystem
      transport: stdio
      command: npx
      args: ["-y", "@anthropic/mcp-server-filesystem", "/workspace"]
      enabled: true
The Helm chart automatically creates a ConfigMap with the mcp_servers.json and mounts it at /etc/chatcli/mcp/.

Checking Status

The MCP Manager exposes the status of each server:
statuses := mcpMgr.GetServerStatus()
for _, s := range statuses {
    fmt.Printf("Server: %s, Connected: %v, Tools: %d\n",
        s.Name, s.Connected, s.ToolCount)
}
To check if a tool is MCP:
if mcpMgr.IsMCPTool("mcp_read_file") {
    result, err := mcpMgr.ExecuteTool(ctx, "read_file", args)
}

ServerDescriptionInstallation
@anthropic/mcp-server-filesystemFile system accessnpx -y @anthropic/mcp-server-filesystem /path
@anthropic/mcp-server-githubGitHub integrationnpx -y @anthropic/mcp-server-github
@anthropic/mcp-server-postgresPostgreSQL queriesnpx -y @anthropic/mcp-server-postgres
@anthropic/mcp-server-slackSlack integrationnpx -y @anthropic/mcp-server-slack
Check modelcontextprotocol.io for the complete list of available MCP servers.