
MCP vs CLI for AI Agents: The 4–32× Token Tax Nobody Warns You About
For most agent tasks, a CLI is 4 to 32 times cheaperthan an MCP server — because every MCP server you connect dumps all of its tool definitions into every turn, whether the agent uses them or not. Here's when I hand an agent a terminal, when I keep MCP anyway, and the hybrid that cut one client's token bill by 63%.
The Short Answer
If a tool already has a mature command-line interface — git, gh, kubectl, docker, aws — let your agent shell out to it. It will be cheaper, and in the benchmarks I trust, more reliable. Reach for MCP when the token cost buys you something the shell can't: OAuth to a remote SaaS, per-user auth in a multi-tenant product, an audit trail, or a tool that simply has no CLI. Nearly every strong production agent I've seen uses both — the argument isn't MCP orCLI, it's knowing which one each job wants.
I run an autonomous agent (my own Hermes runtime) that shells out to CLIs for the hot path and keeps a small, curated set of MCP servers for the SaaS tools that need them. That split is the single biggest reason its token bill is boring instead of terrifying.
What the Token Bill Actually Looks Like
The numbers are not close. In a public GitHub-task benchmark, the same work cost radically different amounts depending on how the agent reached the tools:
| Approach | Tokens per task | Notes |
|---|---|---|
| CLI | 1,365 – 8,750 | Shells out to the existing tool |
| MCP | 32,000 – 82,000 | Tool schemas injected every turn |
That's a 4× to 32× spread for identical work. A separate real-world test — a Microsoft Intune compliance check run through MCP versus a mix of mgc, az, and PowerShell — came out around 35× cheaper on the CLI (~4,150 tokens versus ~145,000). Translate that to a monthly bill: at 10,000 operations a month, one comparison put the CLI at about $3.20 and the MCP path at about $55.20. One organization reported saving $21,000 a month just by converting MCP servers to CLI calls.
The takeaway:
The cost of an agent's tools isn't what it pays to run them — it's what it pays to carry them. MCP makes you carry every tool definition on every turn. A CLI you carry for free.
Why MCP Costs So Much More
MCP's whole value proposition is discoverability: the model needs to know what tools exist and how to call them, so every connected server injects the full JSON schema of all its tools into the context — up front, and on every turn, used or not. Connect three servers with a dozen tools each and you can burn tens of thousands of tokens on tool definitions before the agent has read a single line of your actual request. Then the loop turns, and you pay it again.
A CLI has no standing cost. The model already knows how to use a shell — that knowledge is baked into its training. So the only tokens you spend are the command it types and the output it reads back. There's no schema tax sitting in context turn after turn. I dug into this same standing-cost problem from the MCP side in what an MCP server really costs you in tokens, and it's the same lesson as the 45× gap between computer-use agents and structured APIs: the expensive part is almost never the work, it's the overhead you carry to reach it.
The Reliability Surprise
I expected the CLI to be cheaper. I didn't expect it to be more reliable. In a 75-run benchmark, the CLI path finished 100% of runs and the MCP path finished 72%— and the failures weren't the model making mistakes. They were mostly TCP timeouts on MCP's long-lived connection.
That's the trade hiding inside the architecture. A CLI spins up a fresh process per command — about 200ms of overhead each time — and there's nothing to time out between calls. MCP keeps a persistent session, which is roughly 5ms per call and genuinely better for tight, stateful, low-latency loops. But a persistent connection is one more thing that can drop silently in the middle of a long unattended run. If you've read my take on agents failing silently in n8n, this is the same category of bug: the failure isn't loud, it just quietly ends the work.
When CLI Wins, When MCP Wins
This is a decision, not a religion. Here's the split I actually use:
| Reach for a CLI when… | Reach for MCP when… |
|---|---|
| A mature CLI already exists (git, gh, kubectl, docker, aws) | The tool has no CLI (Figma, Notion, Linear, Asana) |
| Single-tenant or solo setup — you own the machine | Multi-tenant product needing per-user auth and revocation |
| Cost-sensitive, high-volume work (100k+ operations) | Remote SaaS behind OAuth (Salesforce, Workday, Greenhouse) |
| You want composable pipelines (pipes, jq chains in one call) | You need governance: audit trails, permissions, compliance |
One warning on the MCP side: don't auto-convert a whole OpenAPI spec into an MCP server. That's how you end up carrying 60 tool definitions the agent uses twice a week. Curate hard — expose the five tools the agent actually needs, not everything the API can do. Same discipline I apply when deciding Claude Skills versus MCP: the cheapest tool is the one you never had to load.
The Hybrid That Actually Wins — and the Code-Mode Trick
In practice a single user request might shell out to a CLI, call one curated MCP server, validate internally with a function call, and hit a direct API for a status check. That's not messy — that's correct. Combined setups like this have hit 96.3% task pass rates using 63% fewer tokensthan prompting alone. The point isn't to pick a winner; it's to stop paying MCP's context tax on the 80% of calls that never needed it.
There's a third option that beats both for high-volume fan-out: let the model write codethat calls the tools instead of calling each one as its own turn. Anthropic's programmatic tool calling and Cloudflare's Code Mode both do this — the model emits a small script that orchestrates many calls, and only the final result comes back into context. The intermediate schemas and results never touch the context window, so the savings are absurd:
- Programmatic tool calling: one example dropped from 150,000 tokens to 2,000 — a 98.7% cut.
- Cloudflare Code Mode: a workflow went from 1.17 million tokens to roughly 1,000 — about 99.9%.
This is the same “let the agent write and run code” instinct behind building dynamic workflows in Claude Code, and it's the natural endgame of the cost work in how I cut my Claude API bill by 73%. If you want the official version, Anthropic's own Model Context Protocol docs are the canonical reference for when MCP is the right layer.
The Short Version
- For identical work, a CLI ran 4–32× cheaper than MCP in benchmarks — and one Intune test was ~35× cheaper.
- The reason is structural: MCP injects every tool schema into every turn; a CLI carries no standing cost.
- CLI was also more reliable in one test — 100% vs 72% of runs — mostly because MCP's persistent connection times out.
- Use a CLI when a mature one exists and you own the box; use MCP for OAuth SaaS, multi-tenant auth, governance, and tools with no CLI.
- Don't auto-convert an OpenAPI spec into MCP — curate to the few tools the agent truly uses.
- For high-volume fan-out, let the model write code that calls the tools (programmatic tool calling / code mode) — 98–99% fewer tokens.
- Measure tokens per completed task, not per call. The best agents mix all three.
Paying MCP's Token Tax on Every Call?
I build production AI agents that reach their tools the cheap way — CLIs on the hot path, curated MCP where it earns its keep, and code-based tool calling for the heavy fan-out — on Claude, the Anthropic API, n8n, and Supabase. If your agent's bill looks bigger than the work it does, let's fix the plumbing.
Related Posts
AI Agents
Why Claude Subagents Cost 4x More Tokens (And When They're Worth It)
Spawn two subagents and the same task that metered ~121K tokens direct jumps past 500K — a 4.2x multiplier. The reason nobody mentions: a subagent starts cold and can't inherit the parent's cached prompt prefix, so it re-buys the same context at the uncached rate. When fan-out is actually worth it, why agent teams scale better than a naive orchestrator, and the four moves I use to keep the multiplier in check.
AI Agents
What MCP Servers Actually Cost You in Tokens (and How I Cut the Context Tax)
MCP servers spend tokens before your agent says a word — the GitHub MCP alone loads ~55,000 tokens of tool definitions. How I measure the context tax, what it costs per run, and the four controls I use to cut it in production.
AI Agents
Claude's Batch API: When It Actually Cuts Your Bill in Half
The Claude Batch API (Message Batches API) bills input AND output at 50% off for async work that finishes within 24 hours — most batches land in under an hour. On Sonnet 4.6 that's $3/$15 down to $1.50/$7.50; on Haiku 4.5, $1/$5 to $0.50/$2.50; on Opus 4.8, $5/$25 to $2.50/$12.50. The discount is unconditional and stacks with prompt caching, so a bulk job that reuses a big static prefix lands near 5% of the real-time input price. One batch holds up to 100,000 requests or 256 MB; results are retrievable for 29 days. Use it for evals, bulk classification, content generation, and document processing — never for anything a user is waiting on.