# MCP servers and builtin tools

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

Canonical URL: https://www.clai.chat/docs/guides/mcp-and-tools/ · Version: 1.0 · Updated: 2026-10-21

Full site index: https://www.clai.chat/llms.txt

`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:

```sh
# List all available builtin and cached MCP tools
clai tools list

# 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>_*`:

```json
{
  "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](/docs/concepts/context-and-cost/) and [Builtin and MCP tools](/docs/reference/tools/).
