Submit

Pi reverses course, ships MCP support with a Codemode sandbox

Earendil's Pi 0.99.0 adds built-in MCP support and Codemode, a JavaScript sandbox that composes MCP tool calls without spending the model's context.

Written by AiAgentsListing Team

Pi reverses course, ships MCP support with a Codemode sandbox

Pi reverses course, ships MCP support with a Codemode sandbox

Earendil shipped Pi 0.99.0 on 29 September 2026, adding built-in support for the Model Context Protocol after the project had publicly rejected MCP for most of the year. The release pairs MCP with a new feature called Codemode, a sandbox where the model writes JavaScript that calls Pi's tools directly. Earendil's engineering team explained the change in a post titled "You Said No MCP!" published the same day.

Codemode is a JavaScript sandbox built into Pi 0.99.0 that lets a model combine several tool calls, including calls to MCP servers, into one script instead of issuing them one at a time through the model's context. It runs on the QuickJS engine, keeps intermediate results out of the context window, and loads automatically once an MCP server is configured.

What changed

  • Pi 0.99.0, released 29 September 2026, adds MCP, Codemode, and tool search as built-in extensions, according to the official changelog.
  • MCP servers connect over stdio or streamable HTTP, with OAuth support. Servers are configured in mcp.json (global or per project) or through pi.registerMcpServer(), and managed with the /mcp command inside a session or the pi mcp command from a shell. The legacy SSE transport is not supported, per Pi's MCP documentation.
  • The codemode tool runs model-written JavaScript in a QuickJS sandbox that calls Pi's tools. It is enabled through the defaultTools setting or a --tools flag and tuned with codemode.mode and codemode.inlineBudget.
  • tool_search finds tools that are not declared to the model upfront and declares them on demand, instead of loading every tool description into context at startup.
  • Classifier models, including Earendil's own Jev models, can be called from inside a codemode script through models.classify(), so a script can score or filter results without a full model round trip for each item.
  • Earendil's announcement post demonstrates Codemode by having four parallel workers pull 167 open issues from a Linear MCP server and score each one's tone with a Jev classifier, all inside one script. The run reported 156 issues as neutral, 11 as mildly frustrated, and none as highly frustrated.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}

Why it matters for agent builders

Codemode is Earendil's answer to the exact cost that made Pi reject MCP in the first place. Pi's creator, Mario Zechner, had argued against MCP in a November 2025 post titled "What if you don't need MCP at all?". He measured Playwright MCP at 21 tools using 13.7k tokens, 6.8% of Claude's context, and Chrome DevTools MCP at 26 tools using 18.0k tokens, 9.0% of context, and argued that Bash scripts were often more composable than MCP tool calls routed through a model.

Earendil's new post says Codemode answers that composability complaint directly. Because the sandbox runs on the harness side rather than inside an untrusted tool sandbox, a script's state lives in the session transcript instead of the filesystem, and calls across different MCP servers can be combined in one script without returning to the model between steps. For teams running many MCP servers at once, tool_search's on-demand declaration is a direct answer to the token costs Zechner's post measured.

Earendil also frames Codemode as a pattern other harnesses already use for JavaScript-sandboxed tool orchestration, not something unique to Pi, so builders comparing harnesses now have a second implementation to weigh against.

What to watch

Earendil's own post concedes that modern MCP still does not fully solve composability: "even with codemode, which is just a neat little sandbox to allow composing of tool calls, MCP doesn't fully deliver on this." The post ties the remaining friction to how individual MCP servers return unstructured text instead of structured data, and proposes that MCP move closer to "OpenAPI with intelligent tool discovery." Whether MCP server authors adopt that shift is the open question the post itself raises.

Key takeaways

  • Pi 0.99.0, released 29 September 2026 by Earendil, adds built-in MCP support after the project had publicly rejected MCP for most of 2026.
  • The release also ships Codemode, a QuickJS JavaScript sandbox that lets a model compose several tool calls, including MCP tools, in one script.
  • Pi connects to MCP servers over stdio or streamable HTTP with OAuth; the legacy SSE transport is not supported.
  • A new tool_search extension declares tools to the model on demand instead of loading every tool description at startup.
  • Mario Zechner's November 2025 post measured Playwright MCP at 13.7k tokens and Chrome DevTools MCP at 18.0k tokens of context, the kind of cost Earendil says Codemode and tool search now address.

FAQ

What is Codemode in Pi?

Codemode is a built-in Pi extension, shipped in version 0.99.0, that runs model-written JavaScript inside a QuickJS sandbox. The script can call Pi's tools, including MCP server tools, in parallel or in sequence, and its intermediate results stay in the session transcript instead of passing back through the model's context after every call.

Why did Pi previously not support MCP?

Pi's maintainers argued, in posts such as Mario Zechner's "What if you don't need MCP at all?" from 2 November 2025, that many MCP servers ship too many tools with long descriptions, consuming significant context, and that Bash and plain code were often simpler and more composable for the same tasks. Zechner measured Playwright MCP at 13.7k tokens and Chrome DevTools MCP at 18.0k tokens of context to support that argument.

How do I add an MCP server to Pi?

Run pi mcp add <name> -- <command> <args> for a local stdio server, or pi mcp add <name> --url <url> for a remote one, then pi mcp list to confirm the connection, according to Pi's MCP documentation. User-level servers are stored in ~/.pi/agent/mcp.json and project servers in .pi/mcp.json.

Source: Earendil Discussion: Hacker News

Developers comparing MCP-capable coding agents and harnesses can browse the full list on AI Agents Listing's MCP servers directory.

Share:

Subscribe to our newsletter

One email a week. New agents, MCP servers and skills, and what is actually getting traction.

More news

  1. Claude formally verifies 123 open source libraries with Theorem

    Anthropic and Theorem used Claude to write machine-checked proofs that 123 open-source libraries never crash, finding bugs years of fuzzing missed.

  2. OpenShell ships as NVIDIA's sandboxed runtime for AI agents

    NVIDIA's OpenShell is an open source runtime that sandboxes what AI agents can touch, using kernel enforcement and formally verified policy changes.

  3. Anthropic ships Scion, source control built for AI agents

    Anthropic replaced git with Scion, an in-house version control system built for AI agents, after Claude-driven merges topped 30,000 a day in September 2026.