You are viewing docs for version 0.1, which is archived.View the latest version.

Guides

MCP servers and builtin tools

Enable builtin terminal tools and connect external Model Context Protocol (MCP) servers to clai.

On this page

clai includes a builtin tool suite and a Model Context Protocol (MCP) client so any supported LLM can inspect files, run commands, search the web, or call external MCP servers.

Enabling tools with -t

Pass -t to enable all builtin and MCP tools, or pass a comma-separated glob list to restrict which tools the model may call:

# Enable all available tools
clai -t q "Find all references to Setup in internal/ and summarize them"

# Allow only ripgrep, file_tree, and tools from the "git" MCP server
clai -t="rg,file_tree,mcp_git_*" q "Show recent changes to cli.go"

Configuring MCP servers

Add JSON definitions under ~/.config/clai/mcpServers/<server-name>.json. clai starts configured MCP servers over stdio and prefixes their tools with mcp_<server-name>_*:

{
  "command": "npx",
  "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
  "env": {}
}

Output truncation and recall

When a tool returns a large payload, clai automatically truncates the inline result and stores the full output so the model can page through it using the builtin recall tool. See Context management and cost saving and Builtin and MCP tools.

Last updated October 21, 2026

Type to search the documentation.