{"slug": "tools-vs-raw-commands-the-token-cost-theory-part-1", "title": "Tools vs Raw Commands - The Token Cost Theory - Part 1", "summary": "Scalekit ran 75 benchmark runs comparing CLI and MCP agents on identical GitHub tasks, finding CLI was 10 to 32x cheaper and 100% reliable, while MCP hit only 72% reliability. Perplexity's CTO reported that MCP tool descriptions consumed 72% of the available context window before any work. The token cost analysis reveals that MCP's schema overhead can lead to massive cost inefficiencies, especially with multiple servers and low tool usage frequency.", "body_md": "Scalekit ran 75 benchmark runs comparing CLI and MCP agents on identical GitHub tasks. CLI was **10 to 32x cheaper** and **100% reliable**. MCP hit only 72% — failing on more than a quarter of tasks ([source](https://www.scalekit.com/blog/mcp-vs-cli-use)).\n\nPerplexity's CTO reported that MCP tool descriptions consumed **72% of the available context window** before the agent performed any actual work ([source](https://dev.to/![%20](https:/dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/fxr7vpoxn3shvtww1jk1.png)/)).\n\nThe narrative is everywhere: MCP is the future, CLI is legacy. But the numbers tell a different story — and one where the real answer isn't \"pick one.\"\n\nEvery interaction an AI agent makes has a token price — input tokens (the instruction) + output tokens (the response). Multiply by the token rate, and you get the real cost of a single operation.\n\nBut there's a hidden variable: **schema overhead**. Every MCP server exposes tool definitions — names, descriptions, JSON input schemas. These get injected into the LLM context on every single request, whether you call the tool or not.\n\nPolicyLayer measured 3,875 MCP servers and found a median of **2,064 tokens per server** in tool definition overhead ([source](https://policylayer.com/token-cost)). A GitHub MCP server alone clocks **14,406 tokens**. Connect GitHub + Linear + Supabase: **24,116 tokens** — 12% of a 200K context window, before the first message.\n\nI measured three modes across common operations:\n\n**Tool Call:**\n\n```\nInput:  50 tokens (tool name + args)\nOutput: 100 tokens (structured JSON response)\nFraming: 20 tokens\nTotal:  ~170 tokens\n```\n\n**Raw Command (with RTK filtering):**\n\n```\nInput:  30 tokens (command string)\nOutput: 350 tokens (RTK-filtered stdout)\nWrapper: 80 tokens (exit code, error type)\nTotal:  ~460 tokens\n```\n\n**Raw Command (unfiltered):**\n\n```\nInput:  30 tokens\nOutput: 3,000 tokens (raw terminal output)\nWrapper: 80 tokens\nTotal:  ~3,110 tokens\n```\n\nThe spread: **1x, 2.7x, 18x** — same intent, different delivery.\n\nIndependent research paints a wider gap. Afroze Amjad benchmarked graph-cli as both CLI and MCP, finding MCP's per-turn cost was **consistently higher** — the schema catalog ships with every request ([source](https://afrozeamjad.com/writing/mcp-vs-cli-token-benchmark/)). When tools hold 50+ schemas, that overhead compounds.\n\nThe worst case: a 93-tool GitHub MCP server at **55,000 tokens** of schema alone. At $3/M input tokens (Claude Sonnet), that's **$0.17 per request for schema the agent doesn't use**. At 10,000 requests/day: **$51,000/month** in schema tax ([source](https://onlycli.github.io/OnlyCLI/blog/mcp-token-cost-benchmark/)).\n\nPer-operation costs are academic until you stack them. Here's 100 operations:\n\n| Pattern | 100 ops | Token cost | Relative |\n|---|---|---|---|\n| Tool calls | 17,000 | ~$0.17 | Baseline |\n| Raw + RTK | 46,000 | ~$0.46 | 2.7x |\n| Raw unfiltered | 311,000 | ~$3.11 | 18x |\n\nThe difference between a tool-oriented agent and a raw-command-oriented one over 100 retrievals: **$0.29 vs $2.94**. At 1,000 operations, that's $2.90 vs $29.40.\n\nBut these numbers assume **one MCP server**. Most agents run 5+ servers (GitHub, Slack, Postgres, Sentry, Filesystem). At 5 servers averaging 2,064 tokens each, that's **10,320 tokens per request just to keep tool descriptions warm** — whether the agent runs one operation or zero.\n\nThe cost structure flips based on how often you actually use a tool ([source](https://blog.mornati.net/the-future-of-agentic-tooling-mcp-servers-vs-cli-a-data-driven-comparison)):\n\n| Tool frequency | Session cost (20 prompts, 2 GitHub ops) | vs. CLI baseline |\n|---|---|---|\n| Low (G/N < 5%) | 61,654 tokens (Native MCP) | 137x |\n| Medium (G/N 5-40%) | 892 tokens (Gateway MCP) | 2x |\n| High (G/N > 40%) | 892-1,492 tokens | Negligible |\n\nFor a tool used on 2 of 20 prompts (10% frequency), **99.3% of MCP tokens are wasted on schema descriptions** the agent never needed ([source](https://blog.mornati.net/the-future-of-agentic-tooling-mcp-servers-vs-cli-a-data-driven-comparison)).\n\nBut here's the catch: **tools aren't free to build.** Every dedicated tool must be written, tested, maintained, and updated when the upstream API changes. `npmPackageDownloads`\n\nis 20 lines of TypeScript. The `npm view`\n\nCLI command it replaces was written by npm's team.\n\nThe CEO voice in me asks: *Why am I duplicating infrastructure that already exists?*\n\nHere's the scene that answers that. I'm sitting in WSL, my agent wants to check a package version. It calls `npm view`\n\n— a raw shell command. The output comes back: 2,140 lines of package metadata, README, maintainer list, dependency tree, signature hashes. What I wanted was one field. What I got was a firehose.\n\nThe tool call: 170 tokens. The raw command: 2,500+ tokens. **The tool was 15x cheaper on that single operation.**\n\nAfroze Amjad found the same pattern with graph-cli: CLI saves on cost, MCP saves on latency and discovery. The right answer depends on which dimension your workload optimizes for ([source](https://afrozeamjad.com/writing/mcp-vs-cli-token-benchmark/)).\n\nEstimation without measurement is anxiety wearing arithmetic as a disguise. So I measured.\n\nThree patterns cut MCP's token cost dramatically:\n\n**1. Schema filtering.** Instead of injecting all 93 GitHub tool schemas, a routing layer returns only the 2-3 tools relevant to the current request. This alone cuts MCP token usage by ~90% ([source](https://tyk.io/learning-center/mcp-vs-cli-for-ai-agents-enterprise-comparison-guide/)).\n\n**2. Gateway pattern.** Near-zero fixed overhead (~20 tokens/prompt), MCP-quality structured outputs, linear scaling regardless of backend services ([source](https://blog.mornati.net/the-future-of-agentic-tooling-mcp-servers-vs-cli-a-data-driven-comparison)).\n\n**3. Hybrid dispatch.** The most practical setup ([source](https://dev.to/tim_zhang11/i-measured-mcp-vs-cli-for-agent-tool-use-mcp-used-17x-more-tokens-per-call-3egc)):\n\n```\n┌─ Query / retrieval?      → MCP tool (structured, typed, fast)\n├─ Execute / side effect?  → Raw CLI (small output, no schema needed)\n├─ Large output expected?  → MCP tool (schema caps response size)\n└─ Filter / pipe needed?   → Raw CLI (jq, grep, UNIX pipes work)\n```\n\nThis dispatch matrix cut one practitioner's token usage by **60%** — $8.64/day to $3.45/day ([source](https://dev.to/tim_zhang11/i-measured-mcp-vs-cli-for-agent-tool-use-mcp-used-17x-more-tokens-per-call-3egc)).\n\nThe MCP backlash is real, but the target is wrong. The problem isn't the protocol. It's the native injection pattern — loading every schema into every prompt, whether the agent needs it or not. The schema tax dominates until you actively manage it.\n\nMCP's per-call cost is a deployment problem, not a protocol problem. Good tool design means routing the tool surface to match actual usage patterns, not defaulting to everything for everyone.\n\nBuild tools that return answers, not documents. Route schemas that match actual usage, not every possibility. And when the task is a one-shot retrieval with a CLI you already know: **run the command.** The token market thanks you either way.\n\n*Sources: Scalekit MCP vs CLI Benchmark · Afroze Amjad graph-cli comparison · OnlyCLI token cost benchmark · Mornati MCP vs CLI deep-dive · PolicyLayer MCP cost calculator · Dev.to hybrid dispatch case study · Tyk enterprise comparison guide*", "url": "https://wpnews.pro/news/tools-vs-raw-commands-the-token-cost-theory-part-1", "canonical_source": "https://dev.to/ev3lynx727/tools-vs-raw-commands-the-token-cost-theory-d1g", "published_at": "2026-07-08 10:52:09+00:00", "updated_at": "2026-07-08 10:58:33.087941+00:00", "lang": "en", "topics": ["large-language-models", "ai-agents", "developer-tools", "ai-infrastructure", "ai-research"], "entities": ["Scalekit", "Perplexity", "PolicyLayer", "Afroze Amjad", "GitHub", "Claude Sonnet", "Linear", "Supabase"], "alternates": {"html": "https://wpnews.pro/news/tools-vs-raw-commands-the-token-cost-theory-part-1", "markdown": "https://wpnews.pro/news/tools-vs-raw-commands-the-token-cost-theory-part-1.md", "text": "https://wpnews.pro/news/tools-vs-raw-commands-the-token-cost-theory-part-1.txt", "jsonld": "https://wpnews.pro/news/tools-vs-raw-commands-the-token-cost-theory-part-1.jsonld"}}