Skip to content

Writing

MCP vs CLI for AI agents: what my token data showed

I pruned seven unused MCP servers and built a CLI bridge with a skill, then measured both against my Claude Code transcripts. Pruning saved about 4,450 tokens per session; the CLI saved nothing at session start. The real win was smaller tool results.

Contents
  1. Why I looked at my agent sessions
  2. MCP token cost: what tool definitions weigh
  3. What pruning seven servers saved
  4. What the CLI and skill changed at session start
  5. What actually paid off: smaller results, not smaller schemas
  6. How Anthropic and Cloudflare converged on code over tool calls
  7. When MCP is still the right choice
  8. FAQ

My instinct said MCP tool schemas were eating my agents' context window. So I pruned seven MCP servers, built a CLI bridge with a skill, and then measured both changes against my own Claude Code transcripts. The schemas were mostly gone already. The tokens worth saving were in the tool results.

Why I looked at my agent sessions

I build products with coding agents. Claude Code, Codex and Devin write most of the code; I design the architecture and the guardrails. Claude Code had 3,650 transcripts on my disk this week, most of them subagents.

By late October I had more than twenty MCP servers connected. Some are mine (web search, a headless browser, server ops, Vaelor for code intelligence, this site's CMS), some are hosted connectors. In my notes from November 3, a 30-day count over 1,611 transcripts showed usage concentrated in a few servers: Vaelor 3,379 calls, web search 1,635, desktop automation 685, server ops 475, the headless browser 433, a WordPress pipeline 175. A startup-research server and an old memory service had zero. Claude Code keeps transcripts for about a month, so I can no longer reproduce that count. Every other number here comes from what is still on disk.

That data agrees. From October 20 to November 2 (1,196 transcripts with activity) the seven servers I then removed got 23 calls between them: 17 to three YouTube servers, 5 to a second research server, 1 to a meeting-notes connector, none to the other two. All MCP servers together got 4,165 calls; Bash got 72,643.

MCP token cost: what tool definitions weigh

I pulled the tools/list response from every HTTP server I could reach, pasted it as text into claude -p with no tools, and subtracted the token count of the same prompt with empty data. That reads Claude's own tokenizer from the usage field. Haiku 5.5 and Opus 5.5 returned the same count (11,979) for the web-search schema. This is the schema as JSON text, close to what the API sends for tools but not guaranteed identical.

Tokens per server, from tools/list:

ServerToolsTokens
Web search (mine)1311,979
Server ops (mine)279,534
Vaelor3821,570
Headless browser (mine)2815,183
Data engine (mine)3016,708
This site's CMS1224,503
Startup research (removed)3625,032
Second research server (removed)3219,075
Total, 8 servers216143,584

The CMS is heavy for twelve tools because Payload generates its tool schemas from the collections, and the page-update tool carries the whole block layout: that one tool is 20,241 characters. Of the seven removed servers, only two still answered tools/list. The memory service is down, the three YouTube servers ran locally over stdio, and the meeting-notes connector needed an OAuth flow I did not run, so those five stay unmeasured.

What pruning seven servers saved

My sessions never paid those 143,584 tokens. Claude Code shipped MCP Tool Search in January 2026, at first switching on when tool descriptions would take more than 10% of the context (VentureBeat, January 15, 2026). The current Claude Code MCP docs (page modified November 20, 2026; I ran version 2.1.325) say: "Only tool names and server instructions load at session start." My transcripts show deferred loading in every session back to October 14, the oldest on disk.

An unused server keeps costing its names.

So pruning removed tool names. The median session before the change listed 263 names from the seven servers (range 0 to 283). The full 283-name list measures 4,784 tokens, about 16.9 per name, which puts the median saving near 4,450 tokens per session. Their server instructions, if they sent any, I did not measure. Across the window, the median session's deferred list went from 1,055 names to 881 (n = 1,180 and 1,783 transcripts); I added other servers in the same weeks.

At the session level the change is invisible. The median first-turn prompt for Sonnet subagents (input plus cache creation plus cache read) went from 68,022 tokens (n = 1,118) to 71,433 (n = 1,540). Claude Code moved from 2.1.300-2.1.312 to 2.1.316-2.1.325 over the same weeks, and I added servers, agents and rules. A 4,450-token drop disappears in a median that drifted by more than that. After the first turn these prefix tokens come from the prompt cache anyway, so the effect is context room more than money.

What remains is larger than what I removed. A session on November 17 listed 853 MCP tool names at 16,117 tokens, plus 8,074 tokens of MCP server instructions, mostly from hosted connectors: about 24,000 tokens of MCP overhead before the first message. An unused server keeps costing its names.

What the CLI and skill changed at session start

The CLI is mcp-http-call, one Python file with no dependencies that lists, describes and calls tools on any HTTP MCP server from the shell. Auth headers come from a helper command at call time, the same contract as Claude Code's headersHelper; mine reads the macOS Keychain, so no token sits in a config file. A skill teaches the agent its loop: search, read the best pages, reformulate, search again. I designed it and specified its guards, and coding agents wrote the code. agent-kb (the kb command, search over agent memory and my wikis by meaning) and honest-ats follow the same CLI-plus-skill pattern.

For the web-search server, measured on one day, the skill did not save context at session start. The server's 13 deferred tool names cost 177 tokens; the skill's description, listed in every session, costs 285. The server stays connected for clients without a shell, so the skill adds to it. At first use the two are even: 1,359 tokens to load the two schemas the agent needs, 1,411 to load the skill body. The 11,979 against 285 comparison holds only for a client without deferred loading, which I did not test. Skills have their own standing cost too: on November 20 my 186 skill descriptions came to 11,520 tokens per session.

Web-search server against its skill, in tokens
CostMCP serverSkill
Listed in every session177285
At first use1,3591,411

What actually paid off: smaller results, not smaller schemas

Tool results enter the context whole, and nothing in deferred loading touches them. A hosted web-search connector I use returned a median 26,469 characters per search call (n = 940, November 4 to 20, UTC). At the 2.6 characters per token I measured for JSON, that is roughly 10,000 tokens per call. Claude Code's default MCP output cap is 25,000 tokens, so it never triggers.

The CLI's --jq flag keeps only the fields the agent will read. I replayed 12 fixed queries on November 19 through my search server, raw and filtered:

Result sizes in characters, not tokens (median, then range):

SourceMedianRange
Hosted connector, per search call (n = 940)26,469p25 to p75: 24,822 to 26,927
My search server, raw (n = 12)4,3193,510 to 4,616
Same queries, --jq filtered (n = 12)1,4711,113 to 1,594

The filter cut a median 66% (57 to 73%). That measures what it removes, not answer quality. Between November 17 and 20, agents ran 172 shell commands with search calls, and 54 chained two or more calls in one command, something a single MCP tool call cannot do.

Whether a cheap raw-search loop answers as well is a separate question, so on November 17 I ran a blind A/B on 40 real agent queries, 20 in English and 20 in Russian. Both arms used Haiku. One had only my server's raw search and page-read tools; the other had Claude Code's built-in web search and fetch. The judge, Nemotron 3 Ultra, scored each pair on correctness, completeness, specificity, source quality and unique value, twice, once per answer order. The raw-tools arm won 60% of pairs (95% bootstrap interval 45 to 75%), so I read it as on par. Its model spend was $0.15 against $1.33, about a ninth. Both figures are Claude Code's reported cost; I did not check whether the built-in arm's figure includes the per-search fee for its 98 searches, and the cost of running my server is not counted. That arm reached the tools over MCP, so the test is about the search backend.

How Anthropic and Cloudflare converged on code over tool calls

  • September 26, 2025
    Cloudflare's Code Mode turned MCP tools into a TypeScript API: "LLMs are better at writing code to call MCP, than at calling MCP directly."
  • October 16, 2025
    Anthropic introduced Agent Skills, folders with a SKILL.md that load in full only when relevant. It became an open standard in December 2025.
  • November 2025
    Anthropic's code execution with MCP (November 4) showed an example going from 150,000 tokens to 2,000. Advanced tool use (November 24) added the Tool Search Tool. Its post puts 58 tools from five servers at about 55K tokens, and in a separate 50-plus-tool example on-demand loading cut context use from about 77K to 8.7K tokens, "an 85% reduction".
  • February 20, 2026
    Cloudflare's Code Mode MCP server covers an API with "over 2,500 endpoints" through two tools and "around 1,000 tokens".
  • July 28, 2026
    The MCP spec dropped the initialize handshake and session header, put method and tool names in HTTP headers for gateways, added cache hints to list responses so clients can cache tool catalogs, and shifted authorization from Dynamic Client Registration toward client metadata documents.

The community argued the same point in the open. "Making MCP cheaper via CLI" reached 324 points on Hacker News on February 25, 2026; one side said to skip MCP and call the API or a CLI, the other that MCP exists so the provider handles authentication and sessions. Bridges already exist: mcporter and mcptools call MCP servers from a terminal. I built mine because, as of mcporter's README on November 20, 2026, it reads header values from its config file or environment placeholders and keeps OAuth tokens in its own vault, and I wanted Claude Code's helper contract backed by the Keychain.

When MCP is still the right choice

The best case for MCP I found comes from Scalekit, which sells MCP authentication, so weigh it with that in mind. In MCP is up to 32x more expensive than CLI. Here's why we still use it (March 11, 2026) they ran 75 runs on Claude Sonnet 4 across five read-only GitHub tasks. The CLI used 4 to 32 times fewer tokens, depending on the task, and 7 of 25 MCP runs failed on connection timeouts. They still choose MCP because their agents act for other companies' users, which needs per-user OAuth, revocation and an audit trail. Their agent received all 43 GitHub tool schemas in every conversation, so I read most of their token gap as an eager-loading cost that deferred loading would shrink.

My own list of where MCP stays: tools that keep state between calls, return images or live inside a desktop app. I kept MCP for Vaelor's code graph, desktop automation, DaVinci Resolve, reverse engineering, a design tool and the headless browser, and OxSay, my voice app, keeps its local MCP server. Clients without a shell need MCP too, which is why my web-search server stays connected while my own agents use the CLI.

For a new integration I now build a CLI and a skill first and add a thin MCP layer only when one of those cases applies. I remove servers nobody calls. And I watch result sizes before definitions.

FAQ

Is MCP dead?

No. The spec shipped a stateless core in July 2026, and its release post says all four Tier 1 SDKs support it. What changed is how clients load tools and how much of a result reaches the model.

What is MCP tool search?

A client feature that lists only tool names and server instructions at session start and loads a full tool definition when the agent searches for it. Claude Code added it in January 2026 and documents it as the default today.

Do unused MCP servers still cost tokens?

Yes, their names: about 17 to 19 tokens per tool name in my measurements, plus any server instructions, in every session.

MCP vs skills vs CLI: which should I use?

MCP for auth on behalf of other users, shell-less clients, stateful or image-returning tools. A CLI when the agent has a shell and benefits from filtering or chaining output. A skill to teach the agent when and how to use either; it costs its description in every session.

How do I measure this in my own setup?

Fetch tools/list from each server and count tokens with the model's own tokenizer. Then read the usage fields in your transcripts: first-turn input plus cache tokens per session, before and after a change. Report medians with sample sizes and list what else changed in the window.

Sources and links

  1. VentureBeat, January 15, 2026venturebeat.com
  2. Claude Code MCP docscode.claude.com
  3. mcp-http-callgithub.com
  4. agent-kbgithub.com
  5. honest-atsgithub.com
  6. Code Modeblog.cloudflare.com
  7. Agent Skillsanthropic.com
  8. code execution with MCPanthropic.com
  9. Advanced tool useanthropic.com
  10. Code Mode MCP serverblog.cloudflare.com
  11. MCP specblog.modelcontextprotocol.io
  12. "Making MCP cheaper via CLI"news.ycombinator.com
  13. mcportergithub.com
  14. mcptoolsgithub.com
  15. MCP is up to 32x more expensive than CLI. Here's why we still use itscalekit.com
  16. OxSayoxfound.com

Anatoly Koptev

AI product engineer in San Francisco. Open to roles and contract work.