MCP connections for runs
Connect external stdio and HTTP MCP servers to coding agent runs with SHA-256 tool pinning, owner-marked read-only tools, and data boundaries.
On this page›
CodePanel lets coding agent runs call external Model Context Protocol (MCP) servers (stdio or remote HTTP) that your account has approved. Every approved tool is pinned by a canonical SHA-256 hash so a server cannot silently rewrite a tool description after approval, and production connections expose only tools you explicitly mark read-only.
Adding and approving a connection
Approve external MCP connections in Settings → MCP & integrations, via add_connection, or through the HTTP API (POST /api/v1/autopilot/connections). A local (stdio) program is added only in the dashboard; see below.
- Repository
.mcp.jsonfiles are proposals only: A.mcp.jsoncommitted to a repository is never started automatically, since any pull request could alter it. - SHA-256 tool pinning: At approval time, CodePanel hashes each tool's canonical JSON (name, description, and input schemas). Before every run, the runner re-hashes the server's live tool definitions and drops any tool whose hash changed until you approve it again.
- Explicit read-only marking: Server-supplied annotations such as
readOnlyHintare never trusted for authorization. Production connections only expose tools the account owner explicitly marked read-only.
Who can add a local program
A stdio connection is a program the runner starts on your machine, so only you add one, signed in to the dashboard: Settings → MCP & integrations → Add a connection. An agent's API token, whatever its scopes, and an OAuth or MCP grant cannot, since an agent could otherwise give itself a program to run.
- What a token is refused: adding a
stdioconnection, turning anhttpone intostdio, and, on astdioconnection, changing its command, arguments or environment, granting it to more coding agents, or granting, re-approving or marking read-only a tool. The answer is a403(forbidden) naming each refused change infields, nothing is saved, and itsnextActionis the dashboard page. - What a token can still do: remove a connection, or add it again with the same command and fewer agents or tools. Remote
httpconnections are unchanged: a token withagents:writeadds and changes them. - From the CLI: run
codepanel connections add <name> … -- <command> [args...]where the program runs. It starts the program, pins the tools you named, and, when your token is refused, prints the connection as JSON. Paste it into the dashboard form, check what it shows, and add it. Change on a connection fills the same form with it, to widen it there. - Connections added before this rule: a
stdioconnection a token added showsaddedIn: "token"and the runner does not start it. Add it again in the dashboard to run it.
Scrubbed stdio transport and sandboxing
Local stdio MCP servers run as child processes inside the run's OS sandbox through a custom transport that passes only the exact allowlisted environment variables you configure, preventing leakage of parent shell variables (HOME, PATH, USER, or local tokens).
Production data boundaries
When a repository's run contract lists a connection under productionReads:
- Runs holding those tools start only on approved zero-retention providers (Anthropic, Workers AI, or OpenAI when
"openaiZeroRetention": trueis set) and never on external CLIs. - On team runs, every team member and subagent is checked against the allowlist before starting.
- If your account's LLM gateway is unreachable, production-read runs stop (
gateway_unreachable) instead of falling back to direct provider calls.
See Securing MCP servers for unattended coding agents and Security for full details.