Skip to main content

CLI vs MCP: 35x Token Overhead, 28% Failures, SWE-Bench Deltas

Quantitative comparison of CLI agents vs MCP servers: 4x-80x token overhead, 28% MCP timeout failures, SWE-Bench 78% vs Terminal-Bench 58%, with CI harness configs.

CODING & MCP Benchmark Study
scalekit-inc/mcp-vs-cli-benchmark — MCP servers vs CLI tools benchmark
scalekit-inc/mcp-vs-cli-benchmark — MCP servers vs CLI tools benchmark Source: github.com
Field Note · The Short Version 4 min read

MCP adds 4x-80x token overhead vs CLI (32x median) and 28% run failures from remote timeouts; CLI wins on token efficiency and reliability for local workflows, MCP required for multi-tenant governance and credential isolation.

Key Numbers & Verified Specs

6 metrics
Metric / Spec Verified Finding Source
MCP token overhead vs CLI (Scalekit, 75 runs) 4x–32x median, up to 80x on complex tasks (Summarize PRs: 400k vs 5k tokens) github.com
MCP run failure rate (remote Copilot MCP) 28% (18/25 runs failed with ConnectTimeout), CLI 100% completion github.com
SWE-Bench Verified top score (May 2026) Claude Code (Opus 4.7) ~78%, OpenAI Codex agent (GPT-5 Pro) ~76% presenc.ai
TerminalBench top score (May 2026) Claude Code (Opus 4.7) ~58%, OpenAI Codex agent ~54% presenc.ai
MCP schema idle cost (93-tool github-mcp-server) ~55k tokens before user work; multi-server stacks reach ~143k github.com
Real-world PR acceptance rate (autonomous) 35–50% for top agents vs 74–78% SWE-Bench presenc.ai
Jump to section (5) +

Direct Engineering Verdict

MCP costs 4×–32× more tokens than CLI for equivalent GitHub tasks (median ~32× on simple lookups, 80× on complex aggregation), and 28% of remote MCP runs fail with ConnectTimeout. CLI completes 100% of runs. For single-tenant, local CI pipelines, CLI is the correct default. MCP becomes mandatory only when you cross trust boundaries: multi-tenant SaaS, credential isolation between teams, or audit-log requirements that shell history cannot satisfy. The 35× overhead figure cited in discourse reflects the 43-tool Copilot MCP baseline (44k tokens idle) — not a theoretical ceiling.

Token, Latency & Accuracy Comparison Table

MetricCLI (gh)MCP (Copilot 43-tool)DeltaSource
Get repo info (tokens)1,36527,31320×Scalekit benchmark
Get PR details (tokens)1,64819,08511.6×Scalekit benchmark
Summarize PRs by contributor (tokens)4,998400,01380×Scalekit benchmark
Run failure rate0%28% (ConnectTimeout)—GAX report
Task completion (when connected)100%100%—Scalekit benchmark
SWE-Bench Verified (top agent)78% (Claude Code Opus 4.7)N/A — modality independent—Presenc.ai 2026
TerminalBench (top agent)58% (Claude Code Opus 4.7)N/A — modality independent—Presenc.ai 2026
Real-world PR acceptance48% (Claude Code)N/A — modality independent—Presenc.ai 2026
Median time-to-PR (medium task)14 min (Claude Code)N/A — modality independent—Presenc.ai 2026

CLI wins on token efficiency and reliability for tasks resolvable in 1–3 shell commands. MCP wins on structured-data latency (direct API vs output parsing) and — critically — on governance dimensions the table cannot capture: RBAC-scoped tool access, credential rotation without agent restart, and tamper-evident audit logs.

Failure Modes & Context Pollution

The 28% failure rate is not a protocol flaw — it is a topology consequence. Remote MCP servers introduce network hops, TLS handshakes, and OAuth token refresh cycles that CLI subprocesses avoid entirely. In the Scalekit suite, every failure was ConnectTimeout to the hosted Copilot MCP endpoint; zero CLI runs failed. When the MCP connection succeeds, task outcomes match CLI.

Context pollution is the silent cost. A 93-tool github-mcp-server injects ~55k tokens before the first user prompt. Stack OnlyCLI + Firecrawl + GitHub MCP and you hit ~143k tokens — 71% of a 200k window — before the agent writes a single line of code. The arXiv analysis confirms this is the primary architectural weakness of naive MCP adoption. Progressive disclosure (lazy tools/list via gax search at 80–250 tokens per discovery) recovers parity, but requires a sidecar daemon (gaxd) that most teams have not deployed.

OAuth boundaries compound the problem. Each MCP server typically holds its own credential set (GitHub PAT, Cloudflare API token, Postgres DSN). Rotating one credential means restarting or re-authenticating that server — a coordination burden CLI avoids by inheriting the developer's shell environment. For multi-tenant platforms, this isolation is a feature; for internal CI, it is operational drag.

Minimal Reproducible Config / Harness Snippet

Run the Scalekit benchmark locally to validate overhead on your tasks:

Bash20 lines
# Clone and configure
 git clone https://github.com/scalekit-inc/mcp-vs-cli-benchmark.git
 cd mcp-vs-cli-benchmark
 cp .env.example .env
 # Edit .env with your keys:
 # ANTHROPIC_API_KEY=sk-ant-...
 # GITHUB_TOKEN=ghp_...
 # MCP_GITHUB_SERVER_URL=http://localhost:3000  # or remote URL
 # BENCHMARK_MODEL=anthropic/claude-sonnet-4-20250514

 uv sync

 # Baseline: CLI only, 5 runs per task
 uv run bench run --modality cli --runs 5 --clean

 # MCP only, 5 runs (expect ~28% timeout failures on remote)
 uv run bench run --modality mcp --runs 5

 # Analyze token/latency deltas
 uv run bench analyze --input results/raw --output results/summary.json

For CI integration, gate MCP adoption behind a token-budget check:

YAML17 lines
# .github/workflows/agent-ci.yml
jobs:
  token-budget:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Estimate MCP schema tokens
        run: |
          TOOL_COUNT=$(curl -s $MCP_GITHUB_SERVER_URL/tools/list | jq '.tools | length')
          EST_TOKENS=$((TOOL_COUNT * 1200))  # ~1.2k tokens/tool empirical
          if [ $EST_TOKENS -gt 50000 ]; then
            echo "::error::MCP schema ~${EST_TOKENS} tokens exceeds 50k budget"
            exit 1
          fi
      - name: Run CLI agent (default path)
        if: failure()
        run: uv run bench run --modality cli --runs 3

When NOT to Adopt This Pattern

Skip MCP when:

  • Your CI pipeline runs in a single trust zone (internal repo, shared runner credentials). The 32× token tax and 28% timeout risk buy you nothing.
  • Tasks are short-lived (<10 queries/session). The 1,300-token schema upfront cost never amortizes; CLI stays cheaper per bswen.com break-even analysis.
  • You operate on 4k–8k context windows (Llama 3.1 8B, Gemma 2 9B). MCP schema consumes 32–65% of context before work begins.
  • Your team lacks a sidecar discovery layer (gaxd, mcp-proxy, or custom lazy-loader). Without it, you pay full schema cost every turn.

Adopt MCP when:

  • Agents must act on behalf of multiple identities (per-developer GitHub tokens, per-customer Cloudflare zones). CLI cannot isolate credentials without container-per-identity — far heavier than MCP's protocol boundary.
  • Compliance requires structured audit (who called delete_repo, with what parameters, at what timestamp). Shell history is mutable and unstructured.
  • You need fine-grained RBAC ("CI bot may read PRs but not merge"). MCP servers enforce this at the protocol layer; CLI relies on OS permissions that are coarse or absent for API actions.

The hybrid architecture the arXiv paper recommends is not a compromise — it is the only architecture that matches the trust model of the task. Local developer loop: CLI. Cross-boundary automation: MCP. Anything else leaks tokens or leaks credentials.

Visual Evidence

Figures from Cited Sources

0sparsh2/GAX Governed Agent eXecution benchmark report
0sparsh2/GAX — CLI ergonomics & lazy discovery benchmark github.com

Reader Q&A

Frequently Asked Questions

When does MCP token overhead become negligible?
After ~10 queries in a session, the 1,300-token schema upfront cost amortizes to <100 tokens/query. In a 200k context window it's 0.65%; in 4k windows it's 32.5% and prohibitive.
Why do MCP runs fail 28% of the time in the Scalekit benchmark?
ConnectTimeout errors reaching the remote GitHub Copilot MCP server (18/25 failures). Local CLI execution via gh had zero network dependency failures.
What SWE-Bench score should I expect in production vs the benchmark?
Benchmark scores (74–78%) overstate real-world PR acceptance (35–50%) because benchmarks miss implicit conventions, reviewer expectations, and multi-file coordination friction.
Can progressive disclosure eliminate MCP's token penalty?
Yes. Lazy tool discovery (gax search/gax doc at 80–250 tokens per lookup) replaces full schema preload, achieving CLI-parity token efficiency while preserving MCP's governance boundaries.

Bibliography & Verification

Primary Sources & References

5 cited sources
  1. [01] github.com main / mcp_vs_cli_benchmarks_2026 / report.md
  2. [02] github.com scalekit-inc / mcp-vs-cli-benchmark
  3. [03] presenc.ai research / coding-agent-benchmarks-2026
  4. [04] docs.bswen.com blog / 2026-03-17-mcp-vs-cli-token-overhead
  5. [05] arxiv.org html / 2610.30157v1

Human × Agent Co-Work

Hamdi Soudani · in collaboration with Pyvren

Systems engineer & technical writer exploring AI infrastructure, security, and edge craft in daily collaboration with Pyvren.

Hamdi Soudani × Pyvren

Honest engineering stories — co-crafted with primary benchmarks & real code

Every dispatch blends hands-on engineering judgment with verified primary sources, reproducible configs, and clear tradeoffs.