MCP Isn't Dead — Your Agent Just Stopped Reading Every Tool Definition
MCP Isn't Dead — Your Agent Just Stopped Reading Every Tool Definition Two explainers went viral this weekend, both with the same headline: MCP is dead. Both videos described the same thing — Cloudflare's Code Mode and
MCP Isn't Dead — Your Agent Just Stopped Reading Every Tool Definition
Two explainers went viral this weekend, both with the same headline: MCP is dead. Both videos described the same thing — Cloudflare's Code Mode and Anthropic's programmatic tool calling — and both ended with the same punchline: the model doesn't call tools one by one anymore. It writes a program that calls them.
The obituary is wrong. The shift is real. And if you build agents, it changes how you should design them.
The problem: tool definitions eat your context alive
Classic tool calling works like this: you describe every tool — name, description, JSON schema — and paste all of it into the model's context. Every step of the conversation re-sends those definitions. Fifteen tools at ~150 tokens each add 2,250 tokens to every request; a six-step task sends them six times, 13,500 tokens before any real work happens.
It gets worse as you add integrations. Anthropic has said Claude's tool-selection accuracy degrades past roughly 30 to 50 available tools, and its own example setup — GitHub, Slack, Sentry, Grafana and Splunk — totals 58 tools and about 55,000 tokens before the conversation even starts.
The extreme case is Cloudflare: its full API exposed as one-tool-per-endpoint MCP would consume about 1.17 million tokens of tool definitions. No model has a context window you want to spend that way.
What Code Mode actually does
Code Mode, introduced by Cloudflare in September 2025 and adopted in different forms by Anthropic and others, flips the arrangement. Instead of handing the model a phone book of tools, you hand it a typed code API and exactly one tool: run this code.
The model writes a short program against that API, the program runs in a sandbox, and only what the program prints comes back into the model's context. Everything in between — the intermediate results, the pagination, the filtering — never touches the context window.
Take the example from one of this weekend's videos: create 31 daily meetings for January. The old way is 31 tool calls, each one a full round trip through the model, with the conversation history growing every time. The new way is one program:
for (let day = 1; day <= 31; day++) {
await calendar.createEvent({
title: "Daily standup",
date: `2026-01-${String(day).padStart(2, "0")}`,
start: "09:00",
durationMinutes: 30,
});
}
print("31 events created");
One script, one execution, one short result back. Anthropic's own published example is more dramatic: moving a two-hour meeting transcript from Google Drive to a Salesforce lead took 150,000 tokens with direct tool calls — the full transcript passed through the context twice — and about 2,000 tokens when the agent wrote code to do it instead, a 98.7% reduction. Cloudflare's whole-API MCP server, launched in February 2026, covers 2,500+ endpoints with just two tools, search() and execute(), in about 1,000 tokens.
There is a second, quieter reason this works: models are better at writing code than at emitting tool calls. They have read millions of real programs; they have seen far fewer examples of made-up tool-call JSON. Code is their native language. Tool calling is a dialect they learned later.
Why "MCP is dead" is the wrong conclusion
Here is the part the viral headlines skip: Cloudflare's two tools, search() and execute(), are themselves MCP tools. MCP still does the connection, the authorization, and the documentation. The model just stops reading every tool description directly.
MCP didn't die. It became infrastructure — the plumbing underneath the code the model writes. The agent still talks to MCP servers; it talks to them through a program now instead of through a thousand JSON blobs.
The same pattern is spreading beyond APIs. Claude Code gained its own Code Mode in November 2026, letting Claude batch its file and shell operations into small scripts instead of requesting them one round trip at a time. OpenAI ships the same idea under the same name Anthropic uses: programmatic tool calling.
What this changes if you build agents
Four practical consequences, in the order that matters:
Design tools as code-first APIs, not as chat prompts. A tool with a clean typed signature — createEvent({title, date, start}) — is easy for a model to call from code and easy for you to test without a model at all. A tool whose behaviour lives in a paragraph of prose is neither.
Batch repetitive work in code, not in conversation. Any task that repeats the same call with different arguments — creating events, filing tickets, updating rows — belongs in a loop inside one execution, not in thirty turns of dialogue.
Filter data where it lives. If an agent needs three names out of two thousand expense lines, the filtering should happen in the sandbox, not in the model's context. Only the three names should come back. Hauling data through the context is the most expensive way to read it.
Treat the sandbox as mandatory, not optional. Running model-written code is only safe inside an isolate with no network access and no credentials in reach. Cloudflare runs generated code in a V8 isolate where fetch() throws and the only way out is through the connected MCP servers — the code literally cannot exfiltrate a key it cannot see. If your agent writes code, that boundary is the feature, not the fine print.
The honest caveats
None of this means your bill drops by 98%. The savings are measured in context tokens, and cached re-reads of tool definitions are already billed at a fraction of normal input rates — so the saving on an invoice is smaller than the saving on a token count. Anthropic's own average figure for programmatic tool calling is a 37% usage reduction on complex research tasks, not a 98% one; the 98.7% number comes from a single task designed to show the extreme.
Small tool sets gain little. If your agent has five tools, the definitions cost almost nothing and Code Mode adds complexity for no benefit. And Code Mode needs a sandbox you trust — without one, you are letting a model execute arbitrary code, which is a security incident waiting for a prompt injection.
The right mental model is boring, which is why it survives the hype cycle: tool calling was the first draft of how agents use tools. Code Mode is the second draft — same tools, same servers, but the model finally gets to use the skill it is actually best at. MCP stays. The phone book goes.
— Davis George · zhuan.xyz
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.