Skip to content
Code Mode for MCP: Let Claude Write Code to Call Tools — ContentBuffer guide

Code Mode for MCP: Let Claude Write Code to Call Tools

K
Kodetra Technologies··9 min read Intermediate

Summary

Cut MCP agent context up to 99% by exposing tools as a code API the model calls in code.

The Model Context Protocol crossed 110 million monthly downloads this month, faster than React got to the same number. Every major agent stack now speaks it: OpenAI's Agents SDK, Google's ADK, LangGraph, CrewAI, and Microsoft's Agent Framework. So a new bottleneck showed up right behind the adoption curve, and on November 4, 2025 Anthropic's engineering team published the fix in a post called Code execution with MCP. Cloudflare shipped the same idea under the name Code Mode. It is the most-shared agent-architecture idea going around dev circles right now, and it is small enough to learn in one sitting.

Here is the problem in one line: when an agent is wired to hundreds of tools, two things quietly eat your context window. The tool definitions all get loaded up front, and every intermediate result has to pass back through the model. Connect a few dozen MCP servers and you can burn hundreds of thousands of tokens before the model has read a single word of the user's request.

Keep reading — it's free

Enter your email to keep reading — plus the best of AI & tech, daily. Free, forever.

or

Already a member? Sign in

Comments

Subscribe to join the conversation...

Be the first to comment