Harness Notes

MCP

Updated 2026-11-25,

On this page

How to connect MCP servers to each harness and what their tools can do once connected. The protocol table at the end shows which parts of the MCP specification each client supports.

Setting up a server

Questionpichecked at 1.2.0
Add a server

Run pi mcp add <name> -- <command> [args...] for a stdio server or pi mcp add <name> --url <url> for a remote one; options include --env KEY=VALUE, --cwd, --header KEY=VALUE, --bearer-token-env-var NAME, --exposure and --description. You can also edit mcp.json directly, which uses the common mcpServers format with command/args/env/cwd or url/headers/oauth per entry. Run /reload in a running session after changing config outside it.

pi mcp add does not connect; run pi mcp list to check the server.

Entries from Claude Desktop, Claude Code or Cursor can be copied as-is; VS Code, Codex and OpenCode entries need small conversions.

Transports

Partly

Stdio (command) and Streamable HTTP (url, or type of http/streamable-http) work. The legacy SSE transport is rejected with an error telling you to use the server's Streamable HTTP URL, and WebSocket is not supported.

Where configs live, and project trust

User servers live in ~/.pi/agent/mcp.json and project servers in .pi/mcp.json; a project entry with the same name replaces the user entry, and a project entry with only enabled, exposure or toolExposure just overrides those fields of the user server. The project file is read only after you grant project trust (the startup prompt, /trust, or --approve), and project files cannot use auth.provider. Extensions can also add session-only servers with pi.registerMcpServer(); file-configured servers win on name clashes.

There is no managed or enterprise-level MCP config file.

Sign in or pass credentials

Remote servers that answer 401 trigger OAuth: sign in from /mcp, /mcp login <server> or pi mcp login <server>, and Pi does dynamic client registration (or oauth.clientId/clientSecret, or oauth.clientRegistration: "cimd"), stores tokens in ~/.pi/agent/mcp-auth.json and refreshes them. For static credentials use headers (e.g. "Authorization": "Bearer ${TOKEN}") or env; values expand ${VAR} and can run a command with a value of the form !command. In the user file only, "auth": { "provider": "<name>" } sends a /login provider's token instead.

OAuth is only used for HTTP servers without an Authorization header.

pi mcp logout <server> deletes stored credentials; pi mcp remove keeps them.

Using its tools

Questionpichecked at 1.2.0
Approve, allow or block tools

Partly

Pi has no approval prompt for MCP calls (or any tool calls); they run immediately. To restrict tools, set exposure/toolExposure to hidden (patterns like "delete_*": "hidden"), set enabled: false, use --exclude-tools 'mcp__server__*' or --tools with mcp__ patterns, or disable MCP with --no-mcp. Confirmation gates require an extension: MCP calls pass through extension tool_call handlers, and server annotations like readOnlyHint/destructiveHint are available to them.

Tool search & code mode

By default (exposure: "codemode") MCP tools are not declared to the model at all; it reaches them from codemode JavaScript scripts that use searchTools(), describeTool() or ALL_TOOLS. deferred exposure makes tools loadable through tool_search, direct declares them like built-in tools, and hidden blocks them; toolExposure sets this per tool with * patterns. Servers with indirect tools are summarised in an mcp_servers system prompt section using their description.

Tool names are mcp__<server>__<tool>, truncated with a hash suffix past 64 characters.

No fixed limit on the number of servers or tools is documented.

Output size and timeouts

Text results over 20 KB reach the model with the middle cut out around a truncation marker, and the full text is saved to a temp file named in the result; codemode scripts get the untruncated result. Each request has a per-server timeout in seconds (default 60) that progress notifications reset, and a timed-out call is cancelled and fails. Servers connect in the background; the first prompt waits up to 10 seconds only for servers with direct tools.

The connection handshake uses the same per-server timeout; HTTP connects retry twice on network errors and 408/429/5xx.

Resources

Partly

Resources are available to the model, not as @-mentions: when a server offers them, Pi adds list_mcp_resources, list_mcp_resource_templates and read_mcp_resource tools. Text comes back as text, images as images, and other binary content is saved to a temp file whose path the model receives.

MCP Apps resources (ui:// or text/html;profile=mcp-app) are omitted.

Resource subscriptions are not used.

Prompts

Not supported

No. Pi does not list or use MCP server prompts, so they do not appear as slash commands or anywhere else.

When a server asks you or the model

Partly

The built-in Pi 1.4.0 MCP extension registers roots but no form or URL elicitation. Its dispatcher rejects unhandled requests with method-not-found. The reusable client allows custom capabilities and request handlers, so a replacement extension can differ; its elicitation support is unknown. Roots and sampling retain their separate evidence.

Running servers

Questionpichecked at 1.2.0
Status, enable, reconnect, debug

Use /mcp in the TUI to see each server's state, tool count, exposure and source, inspect tools and errors, reconnect, sign in or out, change exposure, and enable or disable a server (globally or just for this project). From a shell, pi mcp list [--json] connects to every enabled server and prints state, tools and errors; outside the TUI /mcp prints status and /mcp login|logout|reconnect <server> act directly. Failed stdio servers show their stderr tail in /mcp, and server log messages go to ~/.pi/agent/mcp.log.

--no-mcp turns MCP off for one run; "extensions": ["-builtin:mcp"] or pi config turns it off persistently.

Installing an extension that registers /mcp (such as pi-mcp-adapter) replaces the built-in support.

Run the harness as an MCP server

Not supported

No. Pi cannot run as an MCP server; for programmatic use it offers its own JSON event stream (--mode json), RPC protocol (--mode rpc) and SDK instead.

Protocol features

Featurepiprotocol 2025-11-25
Roots

Let a server discover the client-approved filesystem roots; this is not the server process working directory.

deprecated in the current spec

Supported

Advertises the roots capability and answers roots/list with the session directory; the list does not change during a session (no roots list_changed).

Source
Sampling

Let a server request an LLM interaction through the host, with user review and model preferences.

deprecated in the current spec

Not supported

The client declares only roots; sampling/createMessage gets a method-not-found error.

Source
Sampling with tools

Let the sampling loop invoke tools recursively; do not confuse this with ordinary server tool calls.

deprecated in the current spec

Not supported

Source
Elicitation (generic)

Server-originated MCP input requests, distinct from permission approvals, model ask-user tools, generic chat forms or MCP Apps. Check each mode and host separately.

Not supported

Built-in 1.4.0 MCP runtime does not register elicitation; unhandled requests get method-not-found. The reusable client supports custom capabilities and setRequestHandler; custom extension support is unknown.

Source
Form elicitation

Collect typed property-keyed answers using the restricted elicitation schema, with accept/decline/cancel. Schema parsing, UI validation and backend answer validation are separate claims.

Not supported

Source
URL elicitation

Direct the user to an external interaction without collecting its sensitive data. Acceptance is not completion; track legacy completion notifications separately from current MRTR retry.

Not supported

Source
Prompts

Expose reusable, argument-aware server prompts through the client UI.

Not supported

Pi never lists or gets server prompts; it uses only tools and resources.

Source
Resources

List and read server-provided context independently from tool execution.

Supported

Exposed to the model as list_mcp_resources and read_mcp_resource tools; MCP Apps (ui://) resources are omitted.

Source
Resource templates

Discover and fill parameterized resource URIs.

Supported

Listed through the list_mcp_resource_templates tool.

Source
Argument completion

Complete prompt arguments and resource-template parameters without an LLM call.

Not supported

Pi never sends completion/complete.

Source
Progress

Correlate monotonic progress with a request; UI display and timeout extension are separate behaviors.

Supported

Progress is shown as tool updates and resets the request timeout.

Source
Cancellation

Cooperatively cancel in-flight protocol requests and propagate intent to the handler.

Supported

Aborting or timing out a call sends notifications/cancelled; incoming cancellations abort server-to-client requests.

Source
Protocol logging

Deliver correlated server logs through MCP rather than relying on process stderr.

deprecated in the current spec

Supported

Server log notifications are appended to ~/.pi/agent/mcp.log (rotated at 5 MB); Pi does not send logging/setLevel.

Source
Subscriptions

Receive correlated updates over a long-lived request.

Not supported

Pi never sends resources/subscribe.

Source
Multi-round-trip requests

Pause a request for sampling, elicitation, or roots input and retry it with opaque request state.

Not supported

Newest negotiated revision is 2025-11-25, which predates multi-round-trip requests.

Source
Tasks (legacy)

Durable polling, status, result, and cancellation state from the 2025-11-25 experimental protocol era.

earlier experimental spec

Not supported

No tasks capability is declared.

Source
Tasks extension

Asynchronous tool results using io.modelcontextprotocol/tasks on 2026-07-28 connections, separate from legacy Tasks and client backgrounding.

separate protocol extension

Not supported

Source-audited at v1.4.0: configured and extension-contributed servers use built-in runtime -> McpClient.callTool -> ordinary result normalization, without a Tasks lifecycle driver. Reusable client capability/request hooks allow custom extensions; their support remains unknown.

Source
Events and agent wake-up

External updates that can trigger agent work. ChatGPT Work documents signed webhook subscriptions; Codex has a separate hosted-app event stream. Receiving an event and starting a model turn are separate capabilities.

separate protocol extension

Not documented

Not audited for this harness/version. Other notification or resource-subscription support does not establish event-triggered agent work.

Notes and sources

pi, 13 sources
  • Elicitation rechecked at v1.4.0 (4a080252f06caf63a525d7873c5d94d3c23887e0), 2026-10-23; other features retain older evidence. This is a built-in extension claim, not absence across custom hosts.
  • Tasks extension reviewed 2026-10-24; see docs/research/evidence/mcp-tasks-other-harnesses-2026-10-24.json. Other feature ratings and sourceRevision/observedVersion retain their independently dated audits.
Add a server, 3
Transports, 2
Where configs live, and project trust, 3
Sign in or pass credentials, 3
Approve, allow or block tools, 3
Tool search & code mode, 2
Output size and timeouts, 2
Resources, 2
Prompts, 2
When a server asks you or the model, 5
Status, enable, reconnect, debug, 3
Run the harness as an MCP server, 1