The local agent is built and ready. You connect it to the file system and the browser. You also plug in a database. A simple task runs. The agent takes fifteen steps and delivers the result. The API bill arrives later. The total is three times higher than expected. The model barely even called the tools.
Connecting a typical stack of four MCP servers adds tens of thousands of overhead tokens to every single message. We will calculate this tax on specific models and break down the math behind caching.
How many tokens servers burn before the first prompt
Every connected MCP server loads its tool definitions into the context window during every interaction. This happens regardless of whether the functions are called. The mechanism drives context inflation. Measuring nine popular MCP servers showed a volume of 38,900 tokens for 116 tools. This takes up 19.4% of a 200k context window.
A typical four-server configuration adds about 7,000 tokens of overhead per message. Heavy builds can burn over 50,000 tokens. The developer pays for this volume at every step of the agent's reasoning. Language models lack memory between requests. The entire chat history and all available tools are sent again with every request. If an agent takes ten steps to solve a task, an array of tens of thousands of tokens will be sent and billed ten times.
Paying for JSON Schema syntax instead of instructions
Measuring a Notion server with 24 tools reveals a total cost of 17,500 tokens. Out of this volume, 93.6% pays for the JSON Schema structure. The text description for the model takes up a tiny fraction. You pay for curly braces, quotes, and indentation. Service keys like properties and type also add to the bill.
A standard text description of a function takes two lines. Translating this description into a format understood by tool calling requires creating a nested structure. Every parameter gets its own type and description. It also gets a required status. If a tool accepts an array of objects, the schema grows rapidly. Nested structures demand duplicated service keys. The model is forced to process this markup on every call. The main enemy of your budget hides in syntactic garbage, completely overshadowing detailed instructions.
In our model, the ratio of schema volume to useful user task was 69 to 1. Tokens were counted using the tiktoken o200k_base. Claude and Gemini use different tokenizers. Vendors do not publish exact benchmarks for the compression efficiency of specific JSON Schema syntax. Numbers might differ slightly depending on the API. The order of magnitude always remains the same. The volume of service markup crushes the volume of useful text. There are no exact public measurements of Time-To-First-Token speed degradation from parsing exactly 20,000 or 40,000 schema tokens during a cache miss.
Weight comparison of real servers
| Server | Tools | Tokens per message |
|---|---|---|
| Playwright (JD Hodges measurement) | 22 | ~3442 |
| Gmail (JD Hodges measurement) | 7 | ~2640 |
| Repositories (our model) | 40 | 11,121 |
| Browser (our model) | 25 | 5826 |
| File system (our model) | 12 | 2353 |
| Database (our model) | 8 | 1513 |
| SQLite (JD Hodges measurement) | 6 | 385 |
The Gmail server consumes disproportionately many tokens due to complex definitions. Just the gmail_create_draft tool costs 820 tokens. An email client requires passing multiple flags and recipient arrays. You also have to pass body formats. The Playwright server works more efficiently per function. It takes 3,442 tokens for 22 tools. The SQLite database costs a mere 385 tokens for six simple functions.
In our model, GitHub-level repositories take 11,121 tokens for 40 tools. This equals 278 tokens per tool. The browser requires 5,826 tokens for 25 tools, hitting 233 tokens each. The file system adds 2,353 tokens for 12 tools, at 196 tokens a piece. The database costs 1,513 tokens for 8 tools, coming to 189 tokens.
Calculating the tax on 15 agent steps
We modeled a typical 15-step agent cycle to estimate real costs. The system prompt takes 1,500 tokens. The user task weighs 300 tokens. Each step adds 800 tokens of tool output and 200 tokens of the model's own response to the history. The schemas of all connected tools are sent in every request.
Our model includes four servers. These are repositories, browser, file system, and database. The total comes to 85 tools. They occupy 20,813 tokens in every request. Without MCP schemas, 15 steps generate 132,000 input tokens. With schemas, the volume grows to 444,195 tokens. The difference is 3.37 times. The schema share reaches 70% of the total input volume.
If we calculate using the price for claude-sonnet-5.5, one task without schemas costs $0.2499. With schemas, the price rises to $0.7806. The MCP tax is $0.5307. On a volume of 10,000 tasks, the overpayment will be $5,307. The gpt-6.2-sol model shows the exact same numbers. Without schemas, the task costs $0.2499, while with schemas it costs $0.7806. The overpayment for ten thousand tasks equals $5,307.
For the cheaper deepseek-v4.1-flash model, the base task price is $0.0360. With schemas, it grows to $0.1140. The MCP tax equals $0.0780. The overpayment for 10,000 tasks will be $780.
The claude-opus-5.5 model shows the highest absolute figures. Without schemas, a task costs $0.4998. With schemas, the price jumps to $1.5613. The tax is $1.0615. On ten thousand tasks, the budget will lose $10,615.
The gemini-3.8-flash model spends $0.0937 per task without schemas. With schemas, it comes to $0.2927. The tax takes $0.1990. The overpayment for 10,000 tasks will be $1,990.
The tax is noticeable even on the fast claude-haiku-5.5. The base costs $0.0125. Schemas push the price to $0.0390. The overpayment is $0.0265 for every cycle. In all cases, the cost increases by 212 to 217 percent.
Why the client sends schemas with every message
The protocol architecture requires constant data transmission. The client requests the tool list via the tools/list endpoint at the start of the session. Then it forwards these definitions to the language model in the payload of every individual message.
The protocol supports updating the list by the server through the listChanged event. There is currently no standardized mechanism to disable unnecessary schemas at the LLM's own initiative. Developers have to write custom architectural wrappers. Anthropic engineers state directly that loading all definitions upfront and passing intermediate results through the context window slows down agents and increases costs.
Internal model routing through tools like AltRouter helps lower the base token price, but it fails to solve the context volume problem.
How prompt caching affects bloated bills
Providers offer discounts for caching long contexts. Anthropic bills cache writes with a five-minute lifespan at a 1.25x multiplier of the base input token price. A write with a one-hour lifespan costs 2x. Reading from the cache costs 0.1x of the base. This provides a 90% discount.
The Anthropic API caches data in a strict order. Tool definitions go first, followed by the system prompt, followed by messages. Tool schemas are static. They always enter the cache first. This makes Claude architecturally favorable for heavy MCP builds.
In our calculation for claude-sonnet-5.5, we applied prefix caching from the system prompt and schemas. The price of a 15-step cycle dropped from $0.7806 to $0.3122. The savings amounted to 60%. The MCP tax with caching shrank to an acceptable +25% instead of the initial +212%.
This method breaks during infrequent calls. The caching advice fails if requests to the agent are sent less often than once every five minutes. The context is invalidated. The cache resets. You pay the 1.25x write multiplier for the entire volume of bloated schema syntax. The prefix with schemas ends up costing 25% more than completely disabling the cache. This is a bet on a high request frequency within a single session.
Connecting all tools versus implementing dynamic loading
An excess of tools clutters the context with garbage and raises the risk of errors. The model starts getting confused among dozens of similar functions. Reddit discussions note that completely abandoning the preloading of all schemas reduces the number of definition tokens by 96.1%.
The progressive disclosure pattern solves the bloated context issue. It allows you to load only a lightweight index of tools into the context. Full schemas with long JSON structures are requested via a separate call only when necessary.
The agent receives a short list of available capabilities. If it needs a database, it calls a function to get the database schema. Only after this does the full structure with parameters enter the context. This requires an extra step from the model. The cost of one extra call pays off by saving tens of thousands of tokens on all subsequent steps.
import anthropic client = anthropic.Anthropic(api_key="YOUR_API_KEY") tools = [ { "name": "get_tool_schema", "description": "Get the full JSON schema for the required toolset", "input_schema": { "type": "object", "properties": { "server_name": { "type": "string", "enum": ["browser", "filesystem", "database"] } }, "required": ["server_name"] } } ] response = client.messages.create( model="claude-sonnet-5-5", max_tokens=1024, messages=[{"role": "user", "content": "Read the config.json file"}], tools=tools ) Before building an agent, you should check the actual weight of your integrations. The mcp-xray utility lets you measure the token tax of a specific server before doing any work. It shows the exact context cost per turn.
If we disable three unnecessary servers in our model and leave only the file system, the cycle price for claude-sonnet-5.5 will be $0.3099. This is 60% cheaper than the version with all servers at $0.7806. You need to connect tools for a specific task instead of keeping them in reserve. Dynamic schema loading saves money more reliably than hoping to hit a five-minute cache window. Agent token optimization begins with an audit of connected servers.


