
Code Mode MCP keeps the same MCP servers but changes how an agent uses them: instead of calling tools one by one, the model writes a small program that calls the tools, and that program runs in a sandbox. The payoff is far fewer tokens on tool-heavy tasks — Anthropic reported one workflow dropping from about 150,000 to 2,000 tokens.
The name comes from Cloudflare, which called the pattern “Code Mode”; Anthropic published the same idea as “code execution with MCP”. Both start from one observation: LLMs are better at writing code than at making long chains of tool calls.