A DEV Community post by @johnnylemonny (John) argues that attaching many Model Context Protocol (MCP) servers to an AI coding agent quietly taxes every request. The original article is available at https://dev.to/necoz/your-mcp-servers-are-silently-draining-your-context-window-the-hidden-cost-of-tool-heavy-ai-agents-fkl.
The author reports that a two-word prompt, "Run tests", registered 28,400 input tokens with no source files attached and an empty conversation history. The cause, according to the post, was seven MCP servers configured over the previous month: GitHub, Jira, Postgres, Sentry, Slack, Docker and filesystem.
Why tool definitions cost tokens
The article explains that MCP tools do not sit idle until called. For a model to know when and how to invoke a tool, the host application must inject the complete JSON Schema definition of every registered tool into the system context of every API request, via the tools parameter in the Anthropic Tool Use API or OpenAI function calling. All-in-one servers rarely expose one or two tools; they expose 30 to 60 endpoints, each with verbose descriptions, nested schemas, enums and validation constraints.
The author estimates a single typical tool schema at roughly 180 to 220 tokens, and walks through a realistic setup: a GitHub server at about 35 tools (~8,500 tokens), an issue tracker or docs server at ~25 tools (~6,200 tokens), database and observability servers at ~20 tools (~4,800 tokens), and browser, filesystem and git servers at ~25 tools (~5,500 tokens). That adds up to roughly 25,000 tokens injected before any question is asked. Because agentic workflows loop, a 10-step task pays that penalty repeatedly, and prompt caching reduces the dollar cost but not the attention burden.
Context rot and tool confusion
The post identifies three consequences beyond billing:
- Tool selection hallucinations, where overlapping tools such as
read_file,get_file_contentsandsearch_codecause wrong tool choices, mismatched parameters and retry loops. - Attention dilution, where schema tokens compete with actual code, stack traces and architectural rules.
- Uncontrolled output dumps, where monolithic tools return raw, unpaginated API responses into the context window.
Auditing and trimming
The author shares a small TypeScript auditor that serializes tool definitions and estimates token footprint at roughly 3.6 characters per token, then multiplies by ten to model a multi-step loop. In a comparison across 50 debugging sessions, the post reports a monolithic 52-tool stack at 24,600 baseline tokens versus 640 tokens for four focused micro-tools, with first-try tool selection accuracy rising from 78% to 99% and time-to-first-token dropping from 3.4 to 1.1 seconds.
The recommended alternatives are focused CLI scripts that reuse an existing shell tool, narrow MCP servers with one or two scoped tools and trimmed descriptions, and on-demand skills or prompts. The post closes with a checklist: avoid loading servers globally, cap active tools at 15 to 20, disable write-heavy endpoints, and replace chatty MCP wrappers with small scripts that return summarized text.