Blog / How agents load MCP tools
Why your MCP server fills the context window, and which agents actually pay for it
“My MCP server uses too many tokens” can mean two different things: the window gets full, or the bill gets big. They have different causes and different fixes. We measured both on real runs.
Two numbers, not one
- Peak: the largest single model request in a run. That's how full the window got. If it overflows, the app truncates or compacts.
- Cumulative: every request in the run added up. Agents make several requests per question, each resending the conversation so far. That's what's billed (mostly as cached input).
A server can be safe on peak and expensive on cumulative. That's what we found.
What we measured live
Codex CLI and Claude Code answered the same 8 read-only jobs, 5 runs each, on a 99-tool production MCP server.
No live run came close to overflowing; Codex's worst single request was 24.4% of its window. But a simple read question cost 114k–301k input tokens on Codex, depending on the job, because it made 4–8 model requests.
Find out what your MCP server costs each agent.
We measure peak and cumulative context per job and per agent app on your server, and show which tools and results to cut first.
What fills the window
In the live Codex runs, the average largest request (46,794 tokens) split roughly as:
Across all our groups, MCP results were 12–46% of the largest request. Clear-cut waste inside them was small (0.2% of the largest request in live runs) except where a tool returned its own audit log: 7.1%. Records nobody used were the bigger, fuzzier share: up to 12.5%. More: reduce tool response size.
Bytes aren't tokens. One overview result was 77,123 bytes on the wire and 14,517 tokens. What the model sees can also be less than the server sent: some apps cut long results. See output limits by agent.
Which agents pay
| App | How it loads 99 tools | Effect |
|---|---|---|
| Claude Code (tool search on) | Names only, definitions on demand | +1.7k tokens |
| Codex | Tool search | +0 up front; search output 11–16k per request |
| OpenCode | Preloads every definition | +73k tokens; avg peak 51% of 204.8k, max 84.5% |
With a trimmed tool set (v2), OpenCode's largest request shrank 4–5×, to 11.2% of its window. Details: how much context MCP tools use.
Go deeper: How much MCP output is waste, Tool count and context, How Codex finds MCP tools.
What to cut first
- If users run preloading apps: trim definitions. They're resent in every request.
- If cumulative is high: cut the number of requests. Fewer round trips means fewer resends. Make the obvious tool return the answer in one call.
- Then results: drop audit logs and records the question didn't ask for; add filters and summaries.
- Measure tokens per job and per app, peak and cumulative, not bytes.
Back to the MCP tool discovery guide.
How we measured
- Live: Codex CLI 0.161.0 and Claude Code 2.1.301, 8 read-only jobs × 5 runs, 16 Oct 2026, through a read-only proxy. Peak = largest request's input tokens from the app's session log; cumulative = sum over the run.
- Breakdown: o200k_base token counts for each part of the largest request; the residual is app-reported input minus attributed tokens (±3% from mixing tokenizers).
- Mock: 150 runs on a stub of the same 99 tools for the OpenCode and v2 figures; captured traffic for the definition overhead.
- Limits: one workspace, read-heavy jobs, one day, single model versions. Windows are as each app reports them.
FAQ
Why does my MCP server use so much context?
Three things add up: tool definitions (or tool search output), tool results, and repeated requests. In our runs MCP results were 12–46% of the largest request; the rest was definitions, search output, the app's prompt and the model's own turns.
What's the difference between peak and cumulative context?
Peak is the largest single request in a run, which decides whether the window overflows. Cumulative is the sum over every request in the run, which is roughly what you pay for. An agent making 6 requests of 40k tokens peaks at 40k but bills 240k.
Which agent apps load all MCP tools up front?
In our tests OpenCode preloaded all tool definitions (+73k tokens for 99 tools). Claude Code with tool search on added about 1.7k; Codex loads tools through search.
Are bytes on the wire the same as tokens?
No. One 77,123-byte result was 14,517 tokens. Measure tokens with a tokenizer, not response size.
Find out what your MCP server costs each agent.
We measure peak and cumulative context per job and per agent app on your server, and show which tools and results to cut first.