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.
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.
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.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.models.classify(), so a script can score or filter results without a full model round trip for each item.{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}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.
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.
tool_search extension declares tools to the model on demand instead of loading every tool description at startup.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.
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.
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.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.
Anthropic and Theorem used Claude to write machine-checked proofs that 123 open-source libraries never crash, finding bugs years of fuzzing missed.
NVIDIA's OpenShell is an open source runtime that sandboxes what AI agents can touch, using kernel enforcement and formally verified policy changes.
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.