Skip to main content
Beyond being an MCP client (consuming external tools — see MCP Integration), ChatCLI can also be a server: other agents/clients can drive ChatCLI over the protocol.
These are two external subcommands, both speaking JSON-RPC over stdio (stdin/stdout carry the protocol; all logging goes to the file logger):
  • chatcli mcp-server (alias mcp-serve) — an MCP (Model Context Protocol) server.
  • chatcli acp — an ACP (Agent Client Protocol) server, for editors.

chatcli mcp-server

Exposes ChatCLI as an MCP server (revision 2024-11-05). The key point: it’s not just Q&A — it exposes ChatCLI’s real functionality as MCP tools.

Exposed tools

ToolWhat it does
ask_chatcliAsk the model (chat, no tools). Keeps server-side history per session.
agent_taskRun the full agent (ReAct) loop on a task — the agent autonomously uses its tools (read, search, shell via coder, web, memory) and returns the transcript. For multi-step work.
coder_taskRun the coder loop on a task (focused on reading/editing code in the workspace).
read, search, tree, websearch, webfetchThe curated built-in tools (read-only/safe), exposed individually.
ask_chatcli(prompt, session?)     → chat answer
agent_task(task, session?)        → agent transcript
coder_task(task, session?)        → coder transcript
read(args) / search(args) / ...   → tool result
The agent and coder render to stdout; the backend captures that output during the run and returns it as the tool result. The JSON-RPC server keeps its own copy of the original stdout, so the protocol channel is never corrupted.

Backend (provider/model)

The backend uses LLM_PROVIDER / LLM_MODEL (or the global config) to pick the model. If full ChatCLI initialization fails, chat (ask_chatcli) still works; agent/coder/tools become unavailable and return a clear error.

Configuring an MCP client

{
  "mcpServers": {
    "chatcli": {
      "command": "chatcli",
      "args": ["mcp-server"],
      "env": {
        "LLM_PROVIDER": "CLAUDEAI",
        "ANTHROPIC_API_KEY": "sk-ant-...",
        "LLM_MODEL": "claude-sonnet-4-6"
      }
    }
  }
}

chatcli acp

Exposes ChatCLI over the Agent Client Protocol (stdio): initialize, session/new, session/prompt, with the agent’s replies streamed as session/update. Use it in editors that speak ACP.
chatcli acp

See also