MCP & AI Agent Token Budgeting: Controlling Tool-Schema Bloat & Prompt Caching

Why connecting four MCP servers can silently burn 20,000+ input tokens per turn—plus practical fixes using toolset scoping, CLI delegation, output caps, and prompt caching.

2026-12-02 · FreeTokenBox Editorial · Review method · Token Calculator

When running modern coding agents like OpenCode, Claude Code, Cursor, or Cline in 2026, the biggest hidden token drain is rarely the model’s reply—it is MCP (Model Context Protocol) tool-schema bloat. Every connected MCP server injects its tool names, descriptions, and JSON parameter schemas into the system context on every single turn. On tight free tiers (such as Groq’s 8,000 TPM cap), connecting too many MCP servers can trigger a 429 before your agent even reads a source file.

1. The Real Math of MCP Tool-Schema Bloat

Consider an agent session with four popular MCP servers enabled simultaneously:

Connected MCP ServerExposed ToolsEst. Schema OverheadRepeated Input Over 20 Turns
GitHub MCP (all toolsets enabled)40+ tools~9,500 tokens~190,000 tokens
Playwright MCP25+ tools~5,000 tokens~100,000 tokens
Firecrawl / Search MCP8–12 tools~2,200 tokens~44,000 tokens
Internal DB / Issue MCP15 tools~3,300 tokens~66,000 tokens
Total (before any code or replies)~90 tools~20,000 tokens/turn~400,000 tokens

Tool definitions alone consume 400K input tokens across a single 20-turn debugging loop—before counting source files or raw tool outputs.

2. Five Concrete Ways to Cut Agent Token Burn by 60–85%

  1. Scope MCP Toolsets Aggressively: When running servers like GitHub MCP, set GITHUB_TOOLSETS=repos,issues,pull_requests instead of loading every administrative endpoint. Keep per-project MCP configs minimal instead of enabling 10 global servers everywhere.
  2. Prefer Local CLIs for Simple Deterministic Tasks: Local git, gh, rg, and duckdb commands add zero persistent schema overhead to every prompt and often execute faster than JSON-RPC round trips.
  3. Cap & Sanitize Tool Outputs: Dumping 50 KB of raw HTML or unpaginated JSON logs into chat history poisons every subsequent turn. Convert web pages to clean Markdown (e.g., via Firecrawl or MarkItDown) and enforce strict limit / truncation ceilings in custom MCP tools.
  4. Design for Prompt Caching Stability: Keep your system prompt and MCP tool declaration order byte-identical across turns—never inject dynamic timestamps or random request IDs at the start of the system prompt. Stable prefixes unlock 50%–90% cached-input discounts on providers that support prompt caching.
  5. Split Planning vs. Execution Across Models: Reserve frontier paid models for architecture planning, and route repetitive refactors, doc lookups, and test loops to free Flash tiers or local Ollama models like qwen3-coder:30b and devstral:24b.

3. Model Your Agent Loop Before Hitting Rate Limits

Enter your combined System Prompt + MCP Schema token count into the AI Token Calculator, set realistic multi-turn depth (15–30 turns) and retry overhead (1.3x), and check whether your workflow fits free TPM/TPD caps—or pair it with offline weights from our Local AI Model Picker.