惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
D
Docker
月光博客
月光博客
MongoDB | Blog
MongoDB | Blog
Vercel News
Vercel News
美团技术团队
博客园 - 叶小钗
I
InfoQ
Jina AI
Jina AI
博客园 - 司徒正美
雷峰网
雷峰网
B
Blog
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recent Announcements
Recent Announcements
V
V2EX
N
Netflix TechBlog - Medium

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I Enabled MCP on My AI Coding Agent and My Token Bill Tri...
MrClaw207 · 2026-06-23 · via DEV Community

MrClaw207

I turned on three MCP servers for my coding agent last month. Everything felt faster, smarter, better. Then the monthly API bill arrived — 3x higher than the month before. The irony: I wasn't even using most of what those servers offered.

That gap between what MCP feels like and what it costs is what I call the MCP context tax. And it's quietly wrecking budgets across teams that enabled "just one more tool."

The Numbers Behind the Feeling

Here's what actually happens when you connect an MCP server to your agent.

Every MCP tool call wraps your prompt in a structured shell — the tool name, arguments, descriptions, and response schemas. A simple filesystem.read call that returns 200 characters of file content might add 800 tokens to your context window. Multiply that by dozens of calls per task, and you're burning tokens on metadata your agent doesn't even reason about.

The data from the field backs this up. Iternal's March 2026 benchmark series found that most models reliably use only 50 to 65% of their advertised context window effectively. Your million-token context isn't a million tokens of reasoning — it's a million tokens of overhead, tool definitions, and retrieval artifacts your model is filtering through.

For MCP specifically, the tax is even starker. Independent analysis from QCode.cc and ShareUhack both measured 10 to 32x more tokens consumed per MCP-assisted task compared to the equivalent direct API call. A task that would cost you $0.02 in raw API calls costs $0.20 to $0.64 with MCP middleware in the loop.

A Real Example: The Repo Analysis Task

I run a weekly code health check across a 12-repository monorepo. Here's the comparison:

Without MCP:

  • Direct API calls: ~12,000 tokens per repo
  • 12 repos × 5 agents in parallel: ~72,000 tokens
  • Cost at $0.01/1K tokens: $0.72

With Filesystem + GitHub MCP servers:

  • Tool definitions: ~4,000 tokens (loaded once, shared — but still)
  • Per-call overhead including schema metadata: ~2,800 tokens per call
  • ~40 tool calls per repo across 5 parallel agents: ~96,000 tokens
  • Cost: $2.18 — or 3x the baseline

The agent was smarter about which files to read. But the overhead cost more than the savings in reduced API calls.

The Context Tax in Practice

Here's what it looks like when you actually run this:

Task: "Find all TODOs in the auth service that are older than 90 days"
Model: Claude Opus 4.6
Without MCP (direct API): 14,200 tokens, $0.14
With MCP filesystem server: 38,400 tokens, $0.38
Tax: 24,200 extra tokens, 2.7x cost

The MCP overhead isn't linear either. Each additional MCP server you add to a single agent compounds the tool definition overhead. Three servers × their schemas × the round-trip formatting = a non-trivial chunk of every context window you pay for.

Three Fixes That Actually Work

I'm not saying don't use MCP. I'm saying use it with your wallet open.

1. Profile before you optimize. Run one task with and without MCP. Measure the actual token delta. If the delta is larger than the savings from smarter tool use, you're losing money. Budget $5-10 in API calls to get a real baseline.

2. Choose servers that reduce calls, not just improve quality. A GitHub MCP server that lets your agent navigate repos without 40 exploratory API calls is worth the overhead. A weather MCP server in a coding agent is pure cost with no ROI.

3. Use MCP gateways to share connections. If you run multiple agents, one shared MCP gateway connection (Linux Foundation's AAIF gateway is the reference) avoids loading tool definitions into every agent's context independently. This drops the per-agent overhead from N × schema_size to schema_size + N × call_overhead.

The Tradeoff Is Real But Solvable

MCP solved a real problem: tool interoperability across AI agents. Before it, every agent had its own way of calling external tools. Now Claude, Cursor, ChatGPT, Windsurf, and Gemini can all share the same server ecosystem. That's genuinely valuable.

But "14,000+ MCP servers" is not a sign that you should enable 14,000 MCP servers. It's a sign the ecosystem is mature enough that curation — not discovery — is the skill that separates a cost-efficient agent from a budget hemorrhage.

The question isn't "can I connect this?" It's "does this connection pay for itself?"

My three MCP servers are still enabled. I've just become deliberate about which tasks trigger them. And my token bill is back to where it was in March.


What I learned: The MCP context tax is real and measurable. The fix isn't disabling MCP — it's being honest about which MCP integrations actually reduce total work versus which ones just make the work feel better. The 10-32x overhead figures are averages; your actual tax depends on call frequency, schema size, and how much of your tool response you actually use. Profile your own usage before assuming you're optimized.