The MCP Token Tax
There's a fight on Hacker News and X this month: why burn tens of thousands of tokens on a single MCP operation when the same thing over a CLI costs a couple hundred? It sounds like MCP-bashing. It isn't. The people arguing loudest are the ones who love agents — they've just met the bill. This page is the practical guide to that bill: where the tokens actually go, the two costs almost nobody separates, and the three fixes that turn a 150,000-token workflow into a 2,000-token one.
- Separate the TWO distinct MCP token costs: tool-definition loading and intermediate results
- Understand why the schema cost is paid per-conversation, not once
- Use defer_loading and the Tool Search Tool to load tool schemas on demand
- Use code execution / Programmatic Tool Calling to keep large results out of context
- Decide, per task, when an MCP tool is worth it and when a plain CLI call wins
Two costs, not one
When you connect an MCP server, the client asks it for tools/list and gets back every tool with its full JSON schema. That whole block is injected into the model's context. Most people stop their mental accounting there. But there are two separate taxes, and the second one is usually bigger.
Cost 1 — Tool definitions. Every connected tool's name, description, and parameter schema sits in context. Anthropic's own framing: "In cases where agents are connected to thousands of tools, they'll need to process hundreds of thousands of tokens before reading a request." A single enterprise server can publish dozens to hundreds of tools; third-party analyses put a 400-tool server at roughly 400,000 tokens of schema alone — more than Claude's 200k context window can hold.
Cost 2 — Intermediate results. When the model calls a tool directly, every result flows back through the model's context, even the parts you never wanted it to read. Anthropic's example: pull a two-hour meeting transcript from one tool and pass it to another, and the full transcript passes through the model twice — potentially ~50,000 tokens — just to produce a one-line summary.
- Cost 1 is paid EVERY turn until prompt caching kicks in — the schemas are re-sent with each request in the conversation, not loaded once. A big tool catalog is a tax on the whole session, not a one-time fee.
- Cost 2 scales with your DATA, not your tool count. Ten tiny tools can be cheaper than one tool that returns a giant blob.
The numbers, from the primary sources
| Fix | Task | Before | After | Reduction |
|---|---|---|---|---|
| Code execution with MCP | Google Drive → Salesforce workflow | 150,000 | 2,000 | 98.7% |
| Tool Search Tool | Load defs before work begins | ~77,000 | ~8,700 | 85% |
| Programmatic Tool Calling | Complex research task | 43,588 | 27,297 | 37% |
All three rows are Anthropic's published figures. The surprising part isn't the cost — it's the accuracy: with the Tool Search Tool, tool-selection accuracy rose (Opus 4.5 went 79.5% → 88.1%; Opus 4 went 49% → 74%). Fewer tools crowding the context means the model picks the right one more often. Cost and quality move the same direction here, which is rare.
Fix 1 — Load tool schemas on demand
Instead of injecting all schemas upfront, mark them defer_loading: true. Claude then sees only a lightweight index; when it needs GitHub, it calls the Tool Search Tool, which returns only the matching GitHub schemas — not the 50+ tools from every other server. Anthropic reports this preserves ~191,300 tokens of context versus ~122,800 with everything preloaded.
You are watching this pattern right now if you use Claude Code with many MCP servers: tools arrive deferred, and the agent fetches each schema through a search step only when a task needs it. Community reports say Claude Code auto-enables MCP Tool Search once your connected tool descriptions would exceed ~10% of the context window — verify the exact trigger in your version.
- List active servers and roughly how many tools each publishes. A server you connected for one task last week is still taxing every turn today.
- The cheapest fix is fewer servers. Connect the two or three a task actually uses, not your whole catalog.
- For servers you keep connected but rarely use, prefer a client/config that supports defer_loading + Tool Search so their schemas load only when searched.
Fix 2 — Keep results out of context with code execution
The deeper fix targets Cost 2. Instead of the model calling tools one-by-one with every result passing through it, the model writes code that calls the tools, and the intermediate data stays in the execution environment. Anthropic exposes MCP servers as a file tree of tools the agent explores like a filesystem, loading only the definitions it needs — and "intermediate results stay in the execution environment by default… the agent only sees what you explicitly log or return."
That single design change is what collapses the Drive→Salesforce workflow from 150,000 to 2,000 tokens: the records move through code, and only the final count comes back to the model. On the Developer Platform the same idea ships as Programmatic Tool Calling — Claude writes Python that orchestrates several tools and filters outputs before they ever hit its context.
- Rule of thumb: if a tool RETURNS something big (a transcript, a query dump, a file), you want code execution so the blob is processed out-of-context. If a tool just DOES something small (create an issue, send one row), a direct call is fine.
Fix 3 — Know when a CLI call just wins
Sometimes the right answer isn't a better MCP setup — it's no MCP at all. The HN/X argument has a real point: a shell command like gh pr list or psql -c '…' costs a couple hundred tokens round-trip, while the equivalent MCP path pays for schemas plus a structured result. If the agent already has a terminal and the CLI exists, that's often the leanest path.
Prefer the CLI when the tool is already a CLI
# Instead of connecting a GitHub MCP server for read-only work, # let the agent use the gh CLI it already has: gh pr list --state open --json number,title,author # ~200 tokens of command + compact output, no schema tax, # no server to keep connected across the session.
MCP earns its overhead when you need typed, permissioned, cross-surface capability — a database with a read-only role, a browser it can drive, a SaaS API with OAuth — or when the same tools are reused across many turns so caching amortizes the schema cost. Reach for a CLI when the capability is a one-off, already scriptable, and returns something small. Neither is "better"; they're different points on a cost curve.
- MCP has two token costs: tool-definition schemas (paid ~every turn) and intermediate results (scales with your data).
- Tool Search + defer_loading cut the schema cost ~85% AND raise tool-selection accuracy — load schemas only when searched.
- Code execution / Programmatic Tool Calling keep big results in the execution environment; only what you log or return reaches the model (150k → 2k in Anthropic's example).
- The cheapest optimization is connecting fewer servers per task.
- When the capability is a one-off that returns something small and already has a CLI, a shell call (~200 tokens) beats an MCP round-trip.
Check yourself
0/4Related on AILmanac
- MCP Servers in Claude Code — how to add, scope, and secure servers.
- The Token Economy — compressing command output before it hits the model.
- Dynamic Workflows — where orchestration cost shows up, and slicing to gauge spend.
- Tool Use on the API — the request/response shape behind all of this.
- Playwright MCP: The Deep Practical Guide — worked example on the heaviest single server people connect (~3,500-token schema tax), when the Skill/CLI path wins instead.
Sources & further reading
- Code execution with MCP: building more efficient AI agents — Anthropic Engineering. Source of the 150,000 → 2,000 token (98.7%) figure and the "intermediate results stay in the execution environment" pattern.
- Introducing advanced tool use on the Claude Developer Platform — Anthropic Engineering. Tool Search Tool (
defer_loading, ~85% reduction, accuracy gains) and Programmatic Tool Calling (43,588 → 27,297 tokens). - Claude Code MCP documentation — official reference for connecting and scoping servers.
- modelcontextprotocol — Progressive Tool Discovery discussion — community design conversation on on-demand tool loading.
- MCP Progressive Disclosure (Solo.io) — third-party walkthrough of the lightweight-index / fetch-schema-on-demand pattern.