MCP Context Bloat: Real Costs and a Practical Fix for Claude Code Users

✍️ OpenClawRadar📅 Published: May 19, 2026🔗 Source
MCP Context Bloat: Real Costs and a Practical Fix for Claude Code Users
Ad

A Reddit user running 9 MCP servers in Claude Code for four months detailed the hidden costs and performance degradation they encountered, along with a concrete fix. The post is a must-read for anyone using MCP in production.

The Math

With 9 servers (filesystem, GitHub, Stripe, Linear, Notion, Postgres, Sentry, AWS, and custom) exposing 142 tools total, cold start consumes 38k tokens of system prompt + tool schemas every turn. At 200 turns/day, that's 7.6M input tokens/day. At Sonnet pricing (~$15/M output, ~$3/M input), that's ~$23/day or ~$700/month just in MCP tool definitions — before any actual work. Cache only helps on identical prefixes; rotating one MCP server invalidates it.

What Breaks

  • Tool selection degrades: With 142 tools in context, Claude started picking the wrong tool for obvious queries (e.g., using linear_search_issues when asked to read a file).
  • Slow enumeration: Schema-heavy servers like AWS take 4–6 seconds to list tools.
  • Silent error propagation: One poorly-described tool can taint the ranking for every related query.
Ad

The Fix: Gateway Pattern with BM25

The user switched to a gateway pattern using Ratel, an open-source, in-process Rust library with BM25 ranking. Claude now sees only three tools: search_tools, invoke_tool, and auth. Everything else is ranked on-demand. Results:

  • Cold start dropped from 38k to ~4k tokens.
  • Wrong-tool selection nearly eliminated because the model only ever sees the top 5 ranked by query.
  • Setup took 10 minutes (one command does the Claude Code import).

The author notes that most "MCP optimizer" startups are just BM25 search dressed up. Tool descriptions are short, structured, and full of keyword matches — no vector DB or LLM-in-the-loop needed. BM25 over a flat projection of name + description gets 90% of the win deterministically in microseconds, offline.

Key lesson: "replace" beats "suggest". If your gateway hands the model 5 tools instead of 142, the math works. If it suggests 5 alongside 142, the model still loads 142 and you saved nothing.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also

OpenClaw skill adds AI image generation with local ComfyUI support and curated prompts
Tools

OpenClaw skill adds AI image generation with local ComfyUI support and curated prompts

A new OpenClaw skill provides AI image generation capabilities directly in the terminal, featuring 1,300+ curated prompts, local ComfyUI integration, and prompt enhancement workflows.

OpenClawRadar
Benchmark Shows CLI Tool Reduces Claude Code Token Costs by 32% Through Structural Navigation
Tools

Benchmark Shows CLI Tool Reduces Claude Code Token Costs by 32% Through Structural Navigation

A developer built a Rust CLI tool that gives Claude Code agents structural navigation commands like 'show me a 180-token summary of this 6,000-token class.' Benchmarking on Sonnet 4.6 across 54 automated runs showed 32% lower cost per task and 67% more code edits per session.

OpenClawRadar
SLOP Plugin Adds Real-Time App State Awareness to OpenClaw Agents
Tools

SLOP Plugin Adds Real-Time App State Awareness to OpenClaw Agents

A new OpenClaw plugin integrates with SLOP (State Layer for Observable Programs), giving AI agents structured access to application state and contextual actions. The plugin auto-discovers SLOP-enabled apps via ~/.slop/providers/ and a Chrome extension bridge.

OpenClawRadar
Real Cost of AI Coding Tools: 42 Hours of Overhead per 60 Days — A Solo Dev's Detailed Breakdown
Tools

Real Cost of AI Coding Tools: 42 Hours of Overhead per 60 Days — A Solo Dev's Detailed Breakdown

A solo dev tracked every dollar and minute spent on AI coding tools for 60 days. Subscriptions ($200/mo) were the smallest cost; 42 hours of overhead from bad output and tool-switching were the real tax. Net productivity gain was 1.7-2x, not 10x. Surprise: CodeRabbit, a $15/mo review tool, had the highest ROI.

OpenClawRadar