{
  "id": 12237402,
  "title": "One MCP server used 18,000 tokens before doing anything. Here’s the workaround.",
  "url": "https://urgent.news/2026/10/05/one-mcp-server-used-18-000-tokens-before-doing-anything-heres-the",
  "topic": "ai",
  "section": "AI",
  "published": "2026-10-05T21:55:12.000Z",
  "source": {
    "name": "The New Stack",
    "slug": "the-new-stack",
    "url": "https://thenewstack.io/pi-agent-mcp-codemode/"
  },
  "original_language": "en",
  "account": "Mario Zechner, the creator of the CodeM apply (MCP) protocol, initially resisted its use in Pi, his coding agent, due to the high context cost it imposed. Measuring the context cost of popular browser-automation servers, Zechner found that Chrome DevTools MCP alone required about 18,000 tokens, or around 9% of a 200,000-token context window, before the agent could perform any useful task.\n\nTo address this issue, Pi now uses Codemode, a pattern that places code mode between the model and its tools. MCP tools are discovered and called from JavaScript, with only useful output returned. This approach allows developers to control which tools are exposed to the model, with the default behavior keeping MCP servers' tools out of the model's context. Codemode handles tool discovery, allowing scripts to run operations concurrently and process results before returning any data to the model.\n\nThe reduction in context cost and improved tool management has led Earendil, which acquired Pi, to incorporate MCP into its core system. While this move doesn't fully address Zechner's concerns about composability, Codemode provides a practical solution to Pi's use of the MCP protocol without adopting the approach Zechner initially objected to.",
  "summary": "Pi spent much of the past year leaving MCP out of its coding agent, even as the protocol became standard The post One MCP server used 18,000 tokens before doing anything. Here’s the workaround. appeared first on The New Stack .",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}