---
title: MCP Task Token Cost: Claude Code vs Codex, Same 8 Jobs
description: Same 8 MCP jobs × 5 runs in Claude Code and Codex: ~210k vs ~218k input tokens per question, 32/40 vs 34/40 correct, ranges overlap. Where the tokens went.
canonical: https://spiritroom.app/blog/mcp-task-token-cost-claude-code-vs-codex/
published: 2026-10-21
updated: 2026-10-21
---

> Markdown version of https://spiritroom.app/blog/mcp-task-token-cost-claude-code-vs-codex/ for agents. Index: /llms.txt

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

Leonid Bugaev · Published 21 Oct 2026

**TL;DR**

- **Per question:** about 218k input tokens in Codex, 210k in Claude Code, averaged over 8 jobs × 5 runs.
- **Per job, Codex:** 114k to 301k, driven by how many model requests the job took (4.2 to 7.6).
- **Largest request:** 46,794 vs 40,910 tokens. Neither came close to its window.
- **Different failures:** Codex missed the tools in 6/40 and repeated calls in 13/40; Claude found the tools every time but had 40 oversized results sent to a file.
- **No winner:** 34/40 (71–93%) vs 32/40 (65–90%). The ranges overlap and each app used a different model.
[The numbers](#numbers)[Cost per job](#jobs)[Where the tokens went](#where)[How each one failed](#failures)[Why there's no winner](#winner)[How we measured](#how-we-measured)[FAQ](#faq)

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

Codex: input per question

*218,032*

Claude Code: input per question

*209,722*

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

[Measure your MCP →](/#contact)

## Cost per job (Codex)

One record's detail

*301,486 · 7.6 requests*

Targeting summary

*289,193 · 7.4*

My feedback

*238,883 · 6.2*

Find a company

*228,509 · 6.2*

Campaign status

*209,948 · 6.2*

Best group

*184,182 · 6.0*

Search by job title

*178,252 · 5.6*

Plan and credits

*113,803 · 4.2*

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](/blog/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](/blog/duplicate-tool-calls/).
- **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](/blog/agent-vocabulary-mismatch/).

**Go deeper:** [Agent compatibility across apps](/blog/cost-per-successful-agent-task/), [Reduce tool response size](/blog/reduce-mcp-tool-response-size/), [Pass rates with ranges](/blog/agent-pass-rates-confidence-intervals/).

## 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](/guides/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.

[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[Why your MCP server fills the context window, and which agents actually pay for it](/blog/mcp-context-window-usage/)
- Related[Cost per successful task: the one number that shows if your tools are agent-ready](/blog/cost-per-successful-agent-task/)
- Related[Why agents call the same MCP tool twice (13 of 40 runs) and how to stop it](/blog/duplicate-tool-calls/)
