Serverdex · explainer
MCP vs CLI tools
CLI: a call costs about its command string (mcpservers.org, arXiv 2610.30157). MCP with progressive disclosure: ≈170 tokens upfront (arXiv 2610.30157). Tool search: ≈8,700 instead of ≈77,000 in Anthropic's measurement. GitHub MCP server: 35 tools ≈ 26,000 tokens; five typical servers: 58 tools ≈ 55,000 tokens (Anthropic, Advanced tool use, 24 Nov 2025). All read 22 Nov 2026.
Side by side
- Discovery
- MCP serverMachine-readable tool list with schemas, negotiated at connect time
- CLI (shell command)The model's prior knowledge of the command, plus --help
- Upfront context cost
- MCP serverTool schemas: 2,000–55,000 tokens when loaded naively; ~170 with progressive disclosure or tool search
- CLI (shell command)Zero: a call costs roughly its command string
- Credentials
- MCP serverHeld by the server; OAuth 2.0 supported; opaque to the model
- CLI (shell command)Env vars and tokens visible to the agent's shell
- Blast radius
- MCP serverNamed operations, per-tool user consent in the host, output caps
- CLI (shell command)General-purpose shell: unbounded system access
- Where it runs
- MCP serverChat apps, mobile, IDEs, hosted agents — no shell needed
- CLI (shell command)Only where the agent has a terminal
- Composability
- MCP serverOne round trip per tool call
- CLI (shell command)Pipes, filters, scripts in one command
1. The token cost is real, and it is mostly solved
The strongest argument for CLIs is what an MCP server loads before the first prompt. Anthropic's own numbers: GitHub's server exposes 35 tools at roughly 26,000 tokens of definitions, Slack 11 tools at about 21,000, and five typical servers together put 58 tools and around 55,000 tokens in context before the conversation starts. A CLI puts nothing there; a call costs about the length of the command.
The same posts describe the fix. With a tool search tool the model loads only the names and server instructions and fetches a definition when it needs it: an 85% reduction in Anthropic's measurement (about 77,000 tokens down to 8,700), recommended as soon as definitions exceed 10,000 tokens. With code execution against MCP, the headline example drops from 150,000 tokens to 2,000. Claude Code turns tool search on by default and caps a single MCP result at 25,000 tokens.
An arXiv survey from July 2026 puts the three options in one line: CLI 0 tokens upfront, naive MCP 2,000 to 55,000, MCP with progressive disclosure about 170. Its recommendation is a hybrid, not a winner.
2. The security argument cuts the other way
A shell is unbounded: whatever the agent's user account can reach, the agent can reach, and every token or key in the environment is readable. An MCP server exposes named operations only, keeps credentials behind its own boundary, and the MCP specification requires hosts to obtain explicit user consent before invoking a tool. That is why the comparison usually ends the same way: CLI-first for a trusted agent on your own machine, MCP for anything hosted, shared or multi-tenant, or for a host that simply has no shell.
3. What the one public benchmark found
Mario Zechner ran 120 Claude Code sessions in August 2025 against the same tasks through a terminal tool exposed both as an MCP server and as a CLI. Both finished every task; the MCP run took 51 minutes and $19.45, the CLI run 66 minutes and $19.95. His conclusion was that the choice is a wash for that workload. Tool design, he and mcpservers.org both argue, matters more than the protocol.
4. The decision rule
Pick by where the agent runs and who else can reach the credentials, then fix the token cost with tool search rather than by avoiding MCP.
- Local coding agent, your own keys, a tool with a good CLI: use the CLI.
- Hosted agent, chat or mobile client, team or customer data, OAuth: use an MCP server, with tool search or code execution if the definitions are large.
- Both available: keep the CLI for one-off composition, the MCP server for the operations you want audited and consented.
Where this shows up on Serverdex
44,598 MCP servers from the official registry are listed here, each with a daily credential-free live check, the tool list it exposes and the estimated token cost of its definitions — the numbers this comparison turns on.
- Remote MCP servers answering right now — the hosted servers a CLI cannot replace, with the live check on each
- The MCP context tax — the measured token cost of every answering server's tool definitions
- Top shell MCP servers — servers that wrap a terminal for hosts without one
- MCP server health check — see a server's tool list and token estimate before you connect it
Questions
- Is MCP better than a CLI for AI agents?
- Neither is better in general. A CLI loads nothing upfront and composes with pipes, so it suits a trusted agent on your own machine. An MCP server costs tool definitions in context but keeps credentials server-side, needs no shell and gets per-tool consent, so it suits hosted and shared agents. The one public benchmark (120 runs, August 2025) found the same success rate for both.
- How many tokens does an MCP server cost?
- Loaded naively, 2,000 to 55,000 tokens of tool definitions per server set (Anthropic measured five common servers at about 55,000). With tool search or progressive disclosure the upfront cost falls to roughly 170 tokens, an 85% reduction in Anthropic's test; code execution against MCP cut one example from 150,000 to 2,000.
- Can I use both?
- Yes, and the published recommendation is a hybrid: CLI for composition on a trusted machine, MCP for the operations that need credentials kept away from the model, consent and audit, or a host with no shell.
Sources (read 22 November 2026)
- Model Context Protocol — Introduction
- MCP specification 2026-07-28 (transports, security principles)
- Anthropic Engineering — Advanced tool use (tool search, token figures)
- Anthropic Engineering — Code execution with MCP
- Claude Code docs — MCP (tool search default, output limits)
- arXiv 2610.30157 — CLI vs MCP for agents (Malik et al., July 2026)
- Mario Zechner — MCP vs CLI, 120 Claude Code runs (August 2025)
- mcpservers.org blog — CLI vs MCP (July 2026)
Not claimed here because it could not be read from a primary source on 22 November 2026: per-task token tables of the Zechner benchmark (did not render; only the text figures are quoted); a Smithery benchmark cited elsewhere (page returned 404).
More explainers: MCP vs Agent Skills · MCP vs ACP · MCP vs connectors · MCP vs MCP gateways.