---
title: Does Your MCP Server Fill the Context Window? We Measured
description: Codex peaked at 18.1% of its window, Claude Code at 4.1%, yet both billed ~210k input tokens per question. What fills the context window, and what MCP adds.
canonical: https://spiritroom.app/blog/mcp-context-window-usage/
published: 2026-10-21
updated: 2026-10-21
---

> Markdown version of https://spiritroom.app/blog/mcp-context-window-usage/ for agents. Index: /llms.txt

[Blog](/blog/) / [How agents load MCP tools](/guides/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.

Leonid Bugaev · Published 21 Oct 2026

**TL;DR**

- **Two numbers:** peak (the largest single request: how full the window gets) and cumulative (all requests summed: what's billed).
- **Peak was fine:** Codex averaged 18.1% of its 258,400-token window, Claude Code 4.1% of 1M.
- **Cumulative was the cost:** about 218k (Codex) and 210k (Claude Code) input tokens per simple read question.
- **MCP results were 12–46%** of the largest request. Tool definitions, search output and the app's own prompt were often bigger.
- **Preloading apps hurt most:** a raw 99-tool set took OpenCode to 51% of its window on average (max 84.5%).
[Two numbers, not one](#two)[What we measured live](#live)[What fills the window](#what)[Which agents pay](#who)[What to cut first](#fix)[How we measured](#how-we-measured)[FAQ](#faq)

## 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.

Codex: avg peak, % of 258,400

*46,794 tokens (18.1%)*

Claude Code: avg peak, % of 1M

*40,910 tokens (4.1%)*

Codex: avg cumulative per question

*218,032 tokens*

Claude Code: avg cumulative per question

*209,722 tokens*

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.

[Measure your MCP →](/#contact)

## What fills the window

In the live Codex runs, the average largest request (46,794 tokens) split roughly as:

App prompt + hidden

*17,062*

Tool search output

*16,366*

MCP results

*11,734 (23%)*

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](/blog/reduce-mcp-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](/blog/mcp-tool-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](/blog/how-many-mcp-tools-is-too-many/).

**Go deeper:** [How much MCP output is waste](/blog/mcp-context-pollution/), [Tool count and context](/blog/mcp-task-token-cost-claude-code-vs-codex/), [How Codex finds MCP tools](/blog/how-codex-finds-mcp-tools/).

## What to cut first

1. **If users run preloading apps:** trim definitions. They're resent in every request.
2. **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.
3. **Then results:** drop audit logs and records the question didn't ask for; add filters and summaries.
4. **Measure tokens** per job and per app, peak and cumulative, not bytes.

Back to [the MCP tool discovery guide](/guides/how-agents-load-mcp-tools/).

## 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.

[Measure your MCP →](/#contact)

## Keep reading

- Up[How agent apps load MCP tools: what the model sees (guide)](/guides/how-agents-load-mcp-tools/)
- Related[How many MCP tools is too many? Real token costs across five agents (2026)](/blog/how-many-mcp-tools-is-too-many/)
- Related[How to reduce MCP tool response size: measured before and after](/blog/reduce-mcp-tool-response-size/)
- Related[How much of your MCP output is waste? Measuring context pollution in agent runs](/blog/mcp-context-pollution/)
- Related[Same job, two agents: what one MCP task really costs in Claude Code and Codex](/blog/mcp-task-token-cost-claude-code-vs-codex/)
