Blog / How agents load MCP tools
Same job, two agents: what one MCP task really costs in Claude Code and Codex
“How many tokens does an agent use per MCP task?” The honest answer is a range, per job and per app. Here's ours, from 80 live runs, with where the tokens went and why we don't crown a winner.
The numbers
| Codex CLI 0.161.0 | Claude Code 2.1.301 | |
|---|---|---|
| Correct (strict) | 34/40 (71–93%) | 32/40 (65–90%) |
| Correct, label accepted | 34/40 | 37/40 |
| Found the tools | 34/40 | 40/40 |
| Avg input per question | 218,032 | 209,722 |
| Avg largest request | 46,794 (18.1% of 258,400) | 40,910 (4.1% of 1M) |
| Max largest request | 63,140 | 70,222 |
| Runs with duplicate calls | 13/40 | 0/40 |
| Results sent to a file by the app | 0 | 40 |
Know what each task costs on your server.
We run your users' jobs in the agent apps they use and report tokens, pass rates with ranges, and the tools that drive the cost.
Cost per job (Codex)
Average input tokens and model requests per run, 5 runs each. The order tracks the request count: every request resends the conversation so far.
Where the tokens went
In Codex's largest request, MCP results were about a quarter (11,734 of 46,794 tokens); tool search output and the app's own prompt were bigger. In both apps clear-cut waste was small: 0.2% (Codex) and 0.0% (Claude Code) of the largest request, up to 12.5% and 5.0% counting records nobody used. Claude's figure is lower partly because its oversized results went to a file instead of the context. Breakdown: MCP context window usage.
How each one failed
- Codex: 6 of 40 runs never found the server's tools; all 34 that found them answered correctly. 13 runs repeated a call; most repeats ran inside one code block, so the data entered the context once. See why agents call the same tool twice.
- Claude Code: found the tools in 40/40 runs, but 40 results in 23 runs were over its 25,000-token limit and went to a file, which it then read in pieces (138 file reads and searches). 5 answers used a screen label instead of the API value. See UI words vs API values.
Go deeper: Agent compatibility across apps, Reduce tool response size, Pass rates with ranges.
Why there's no winner
- The pass-rate ranges overlap almost entirely.
- Each app used its own model (and its own tokenizer for usage), so this compares app + model pairs, not apps.
- A second round gave 35/40 (Codex) and 37/40 (Claude, label accepted): the same picture.
What the data does show: the cost is driven by your server's shape (result sizes, how many calls a job takes), and both apps pay it. Back to how agents load MCP tools.
How we measured
- Live: a 99-tool production MCP server, read-only proxy, 8 read-only jobs × 5 runs per app, 16 Oct 2026. Codex with gpt-6-astra, Claude Code with claude-opus-5-5 and tool search on, each with its owner's default settings.
- Tokens: each app's own usage (input incl. cache reads and writes), summed per run; o200k_base only for MCP result and waste sizes.
- Scoring: against ground truth from fixed tool calls; strict and label-accepted scores both shown; 95% Wilson ranges.
- Limits: one server, one workspace, one day, single model per app.
FAQ
How many tokens does an agent use per MCP task?
On our 99-tool server, a simple read question cost about 210–218k input tokens on average in Claude Code and Codex, from 114k to 301k per job in Codex. Most of that is resent context across 4–8 model requests, and much of it is billed as cached input.
Is Claude Code or Codex cheaper with MCP?
On our runs, about the same: 209,722 vs 218,032 tokens per question. Each app used its own model and tokenizer, so small differences don't mean much.
Why do tokens vary so much between jobs?
Mostly the number of model requests. Each request resends the conversation so far, so a job that takes 7.6 requests costs far more than one that takes 4.2, even if the tool results are similar.
Does OpenCode cost more?
OpenCode 1 averaged 341,615 tokens per question on the same jobs, about 1.6×, because it resends every tool definition with each request.
Know what each task costs on your server.
We run your users' jobs in the agent apps they use and report tokens, pass rates with ranges, and the tools that drive the cost.