One MCP server used 18,000 tokens before doing anything. Here’s the workaround.
The New Stack Amanda Caswell
Pi finally added MCP, but it hides most tools from the model. That cuts the token tax that made one browser server burn 18,000 tokens up front.
Based on reporting by The New Stack, Amanda Caswell — read the original for the full story.
Summary, retelling and take written by AI under human oversight; images are AI-generated illustrations. How we work · Report an error
Pi spent most of the past year keeping MCP out of its coding agent, even as the protocol spread through developer tools. Mario Zechner, Pi’s creator, had a simple objection: some servers were too expensive to show to the model at all. Chrome DevTools MCP used about 18,000 tokens before the agent had done anything useful. Playwright MCP took about 13,700 tokens just to describe its 21 tools. On a 200,000-token context window, that is not trivia. It is real rent.
Pi now supports MCP natively, but not in the obvious way. Connecting a server does not dump every tool definition into the prompt. Instead, Pi leaves the tool list out, uses Codemode to discover what’s needed, runs the calls from JavaScript, and passes back only the useful output. That is the same basic idea Pi already used with Jev, where Codemode sits between the model and the tools.
The difference matters because MCP, as Zechner saw it, had another problem beyond raw token cost: the tools were awkward to combine. Results had to pass back through the agent’s context if they were going to be saved or merged with other output. Pi’s earlier workaround was blunt but effective. Bash and a small set of scripts were enough, and the browser tooling only needed a 225-token README. Output could be piped, filtered, or written to disk without first being stuffed back into the model.
Pi’s current setup keeps that philosophy while softening the stance on MCP itself. Earendil, which acquired Pi earlier this year, says the protocol has matured enough for a second look. But the company’s real argument is less about MCP improving and more about Pi finding a useful architecture for everything around it. Codemode runs in a QuickJS sandbox with no Node APIs, no file system, no network access and no timers. By default, MCP server tools stay out of the model’s context. The system prompt gets a one-line description of each server, while Codemode does the digging. Developers can still expose some tools directly, hide others behind Codemode, or block them entirely.
Pi 1.0 also trimmed Codemode’s own overhead. According to the release notes, a GPT-5.6 request with the default tools and Codemode dropped from about 5,300 prompt tokens to 3,300 after Pi shortened the Codemode description, moved model API docs out of the prompt and stopped repeating declarations for tools scripts could already reach. It does not solve every complaint Zechner had about MCP, especially composability. But it does let Pi support the protocol without swallowing the thing he disliked most about it.
My take — AI-written commentary, not fact-checked reporting
This is the sensible version of MCP, which is to say the one that stops treating prompt space like a charity donation. The industry loves bolting more tools onto agents and then acting shocked when the context window turns into a landfill. Pi is at least admitting the boring truth: less gets done when every screwdriver has a 20-page manual.
Read more about this at: The New Stack