MCP support for Pi
The default shared Pi MCP plugin, supported configuration, isolation, and troubleshooting.
The default shared Pi uses platform-configured MCP services through the built-in Pi MCP 支持 (Pi MCP support) plugin, key agentdock.pi-mcp-support. The plugin and pi-mcp-adapter version is 5.3.1; the shared image pins Pi to 1.1.0.
Activation
New workspaces automatically install and bind the plugin to their default Pi. After an upgrade, the server backfills existing default Pi agents in the background at startup (one short transaction per workspace; only one replica runs it; failures retry on the next start). Shared Pi runtime registration also repairs missing installations and bindings. Repeated runs never create duplicates, and existing enabled/disabled states are preserved.
Open Agents → default Pi → Capabilities → Plugins to see the name, version, and Built-in badge, or enable or disable the plugin. Disabling it prevents subsequent runs from loading the platform-managed MCP adapter. Built-in plugins have no downloadable archive.
This requires a shared Pi image with the adapter preinstalled. Assigning the plugin or saving configuration for an ordinary local Pi does not install the adapter.
Configure services
Use Capabilities → MCP to add agent MCP configuration or bind existing workspace MCP services. Execution reuses the platform's merged configuration: workspace MCP bindings, agent mcp_config, and task-level overlays.
Preinstallation does not grant authorization. The plugin includes no service endpoints or credentials and does not authorize external services. Configure the services you intend to use and obtain the access each service requires.
Shared Pi also consumes platform-managed remote MCP connections and plugin MCP services. Administrators approve tools first; the daemon then exposes them through a task-local broker. Upstream credentials are resolved by the platform and are not written into Pi's mcp.json. Ordinary HTTP plugin hooks use a separate signed invocation path; MCP-transport hooks expose only approved tools through the broker, never a duplicate HTTP hook that cannot be invoked.
Disabling Pi MCP support prevents subsequent Pi tasks from starting these brokers, discovering remote tools, or resolving their credentials. Re-enabling takes effect on new tasks. Platform-managed credentials differ from direct configuration below: Pi does not perform interactive OAuth login, and this does not imply acceptance of arbitrary OAuth services.
| Scope | Support |
|---|---|
| stdio | command, args, explicit env, and cwd; commands and dependencies must exist in the runtime |
| Remote transport | Streamable HTTP with automatic SSE fallback by the adapter; HTTP or HTTPS URLs |
| Authentication | Static headers or bearerToken |
| Timeout | requestTimeoutMs, clamped to 1000–300000 milliseconds, defaulting to 60000 milliseconds |
| OAuth | Not supported yet; services declaring OAuth are skipped with a notice in the conversation |
| Other mechanisms | No socket, rmcp-mux, dynamic header commands, bearerTokenEnv, or bearerTokenStore, and no credentials in the URL userinfo (use headers / bearerToken). Unsupported or malformed services are skipped one by one with a conversation notice; if the whole configuration is invalid the run continues without platform MCP |
Isolation and project configuration
The daemon writes platform configuration into a private mcp.json for each run, with directory permissions 0700 and file permissions 0600, then passes it to the adapter. stdio services use inheritEnv: false and do not inherit container environment variables. Supply required variables explicitly through the service's env.
To prevent the adapter from merging project-supplied MCP services, the presence of .mcp.json, .pi/mcp.json, .pi/mcp-adapter.json, or .pi/settings.json in the working directory prevents the platform MCP adapter from loading for that run and produces a conversation notice. This is a file-existence check: even .pi/settings.json without MCP fields triggers it. Additional user MCP configuration also disables platform MCP. Pi's existing configuration stays active; this is not an isolation guarantee for all project extensions.
Other isolation measures:
- The run's
mcp.jsonis deleted when the run ends (success, failure, or cancellation), so credential-bearing configuration does not remain in the shared container. - The shared Pi sandbox allows only a few network ports by default. The platform allows exactly the ports of the HTTP MCP services used by the run (plus the local port of the platform MCP broker), never the whole network; users cannot change this list through custom environment variables.
- If a tool result contains a value that appears verbatim in the MCP configuration (for example a token in
envorargs), that string is removed before the model sees it. This is credential protection in the adapter chain, not a failed call; do not rely on tools echoing configured values. - The plugin applies only when the server explicitly reports it as enabled; a new daemon talking to a not-yet-upgraded server does not load platform MCP.
Troubleshooting
| Symptom | What to check |
|---|---|
| Configuration exists but platform MCP tools are absent | Check that Pi MCP 支持 is enabled under Capabilities → Plugins, then verify that the shared image has the adapter preinstalled |
| MCP tab is entirely absent | Verify that the Web/desktop version includes Pi MCP support; updating only backend or Pi images does not update an old frontend's provider allowlist |
| Platform remote MCP tools are missing | Check service enablement, approved tools, and credential validity; inspect Remote MCP degraded. Optional startup failures produce a task notice; required failures prevent task execution |
| Unreachable service or timeout | The conversation shows a connection error such as fetch failed; check the address, network, and stdio dependencies from the shared runtime; review requestTimeoutMs |
| Invalid credentials | The conversation shows the service's authentication error (such as 401 or authentication may be required); update static headers or the token and verify in a subsequent run; never paste credentials into logs or conversations |
| A value is missing from a tool result | If it equals a value from the MCP configuration it was removed by credential protection; see "Isolation" above |
| OAuth service skipped | OAuth is unsupported; use static authentication only if the service supports it |
Repository contains .mcp.json or related files | The conversation reports additional project or user MCP configuration was detected; review the configuration and rerun from a working directory without conflicting files |
Search daemon logs for Pi MCP. Relevant messages include Pi MCP configured (debug level), Pi MCP adapter unavailable, Pi MCP servers skipped, Pi MCP adapter skipped: unmanaged MCP configuration detected, and Pi MCP capability lookup failed. A server count or successful preparation does not prove connection, tool execution, or billing success.
Maintenance: upgrade the adapter
- Change
PI_MCP_ADAPTER_VERSIONindocker/Dockerfile.pi-agent. When also upgrading Pi, reviewPI_VERSIONand the correspondingpi-ai,pi-tui, and typebox dependencies. - Synchronize the
PiMcpAdapterVersionconstant inserver/internal/handler/pi_mcp_support.go;TestPiMcpAdapterVersionMatchesDockerfilechecks that both match. The startup backfill updates the existing installation's version in place by plugin key, keeping bindings and disabled states, so no new migration is needed. - Rebuild the shared Pi image and verify that its adapter version matches the displayed plugin version and that disabled bindings remain disabled. Run the relevant backend tests, then verify real MCP connections, tool calls, and disabling behavior in an authorized environment.
- Update both language versions of this page before delivering the image and migration. Changing the displayed plugin version alone does not upgrade the adapter in the image.