pi does not declare MCP tools to the model by default

Kind: idiosyncrasy · Status: current · Last verified: 2026-11-27 · Clients: pi, opencode, kilocode · Revisions: 2025-11-25

Every MCP tool is registered in pi as mcp__<server>__<tool>. Whether the model is told about it depends on the server's exposure, which a toolExposure map can override per tool name or * pattern.

Exposure The model's tool list How a tool is called
codemode (default) no MCP tools; the codemode tool is activated a script calls tools.mcp__<server>__<tool>(args)
deferred no MCP tools until tool_search loads matches for the next call directly, once loaded
direct the tool, like a built-in directly, and from scripts
hidden nothing not reachable

getMcpToolExposure returns config.exposure ?? "codemode", and /mcp treats codemode as the value that removes the key from mcp.json. So a server copied in from another client's config, with no pi-specific fields, is a codemode server.

On that default the model sees two things. One is the codemode tool, whose description does not list MCP tools; a script finds them with searchTools(), describeTool(), describeNamespace() or ALL_TOOLS. The other is an mcp_servers section in the system prompt with one line per server: its namespace, whether it is reached through codemode or tool_search, and a summary of at most 250 characters. The section is capped at 4096 characters, and servers that do not fit are counted in a closing line. autoEnableCodemode: false beside mcpServers stops the activation, and pi then warns once that the tools cannot be called.

What this does to the other rows

Against the other code-mode clients

The registry records opencode as routing MCP tools through its execute script tool by default, and Kilo Code as making that opt-in. pi's default is the script route too. In pi the route is set per server and per tool in mcp.json, and there is a third route, deferred, that ends in a direct call.

The probe's default config for pi sets exposure: direct, so its default records describe an opt-in route. The codemode config is the stock one.

Sources