Skip to content

Benchmarks

This page is where the project's claims get checked against a real model. It describes the task suite, shows the measured results, and gives the commands to reproduce them.

What is measured

The same prompt is given to the same model in up to three ways:

  1. Classic MCP. Every tool from every server is offered to the model directly, and every raw result goes back into the conversation. This is what a standard MCP client does.
  2. Code Mode, Python agent loop. The model is offered run_code (and search_tools) through the library's own run_openai loop.
  3. Code Mode, MCP proxy. The model talks to codemode-mcp serve over MCP, the way Claude Desktop, Cursor or VS Code would. A new proxy is started for every run, and the model gets the proxy's tool definitions and no system prompt.

For each run we record what the model provider reports: input tokens, how many of those were served from its prompt cache, output tokens, and the number of model turns. Cost is those tokens at the model's listed prices, with cached input priced separately. Each answer is then checked against a ground truth computed without any model, straight from SQLite, git or the file system.

The servers

Five real MCP reference servers, all connected at once for every task, as they would be in a developer's client:

Server Package What it gives the model
filesystem @modelcontextprotocol/server-filesystem Read and search files in this repository
git mcp-server-git History, diffs and status of this repository
sqlite mcp-server-sqlite (run with mcp<2, the SDK it was written for) A shop database: 480 customers, 4,200 orders, 10,479 order items
memory @modelcontextprotocol/server-memory A knowledge graph. No task uses it; it is there because real setups carry tools a given task doesn't need
time mcp-server-time Current time and time-zone conversion

The shop data is synthetic and generated from a fixed seed by benchmarks/make_data.py, so everyone gets the same rows. The files and git history are this project's own.

The tasks

Six tasks, chosen to cover work where Code Mode should help and work where it should not. What we expected is written down in the suite before anything is run.

Task Shape of the work We expected
What time is it in Tokyo? 1 tool call, tiny result No saving
Commit count and first commit 1 tool call, small result No saving
Top 5 customers by paid order value A few calls; the database does the aggregation Some saving
Join a 40-line file against the database 2 servers; a file joined with SQL results Some saving
Find which source files use an API Read about 15 files (3,500 lines), keep a short list Large saving
Which recent commit changed the most files? 1 call per commit, each returning a full diff Large saving

Those six are also the tasks the library's instructions were fixed against (see below), so four more were added afterwards as a check. They were written after the fixes, and the library was not changed in response to their results:

Task Shape of the work We expected
Convert a time between two cities 1 tool call, tiny result No saving
Best-selling product category A few calls; the database does the aggregation No saving
Find the largest file in a folder 1 call if the right tool is found, otherwise 1 per file No saving
Count function definitions per file Read 4 files (about 440 lines) and count matching lines Large saving

The exact prompts, ground truths and answer checks are in benchmarks/scenarios.py.

Results

Short version

With version 0.3.0, on two Gemini models and 20 repetitions of every task, Code Mode gave the right answer in 238 of 240 runs and classic tool calling in 219 of 240. It used 62% fewer tokens on the smaller model and 91% fewer on the larger one.

The same holds through the MCP proxy, which is how most people will use it: 357 of 360 runs right, with 64% and 90% fewer tokens. And it holds on four tasks the fixes were never tuned on: 238 of 240 Code Mode runs right against 108 of 120 for classic, with 38% to 65% fewer tokens.

Two things it does not show. On the smaller model Code Mode costs 10% to 20% more in dollars despite the token saving, and on the simplest one-call git question it still uses more tokens than classic. Both are explained below.

Version 0.2.0 did not do this

The first measurement, on 0.2.0 and two small OpenAI models, was a failure: Code Mode was right in 5 of 18 runs against 15 of 18 for classic. The numbers above are from the fixed version, released as 0.3.0. The earlier tables are kept at the bottom of the results, folded away.

Version 0.3.0

google/gemini-3.5-flash-lite

Run on 2026-12-04 through aiplatform.googleapis.com, a development build made after 0.2.0 (commit 96a4827 plus changes not yet committed). 20 repetitions per task and style, 240 runs in all. Figures are medians. The classic runs are the ones measured under "After the instructions fix": classic tool calling does not go through codemode-mcp, so it was not run again.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 746 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens Classic cost Code Mode cost Cost LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 20/20 → 20/20 7,377 4,664 -37% $0.0009 $0.0018 +104% 2 → 4
Commit count and first commit
1 tool call, small result
no saving 20/20 → 19/20 22,366 27,400 +23% $0.0023 $0.0081 +256% 5 → 10
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 20/20 → 20/20 25,649 16,032 -37% $0.0038 $0.0062 +64% 6 → 7
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 20/20 → 19/20 92,988 23,356 -75% $0.0133 $0.0096 -27% 17 → 8
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 0/20 → 20/20 60,508 5,598 — $0.0043 $0.0022 — 4 → 4
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 20/20 → 20/20 127,656 40,861 -68% $0.0069 $0.0125 +79% 7 → 11
All runs, total 100/120 → 118/120 6,902,251 2,625,213 -62% $0.75 $0.83 +11%

A dash in the Tokens column means one of the two styles never gave the right answer for that task. Its token count is then the price of a wrong answer, not a saving, so no percentage is shown.

google/gemini-3.8-flash

Run on 2026-12-04 through aiplatform.googleapis.com, a development build made after 0.2.0 (commit 96a4827 plus changes not yet committed). 20 repetitions per task and style, 240 runs in all. Figures are medians. The classic runs are the ones measured under "After the instructions fix": classic tool calling does not go through codemode-mcp, so it was not run again.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 746 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens Classic cost Code Mode cost Cost LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 20/20 → 20/20 7,539 3,937 -48% $0.0061 $0.0037 -39% 2 → 3
Commit count and first commit
1 tool call, small result
no saving 20/20 → 20/20 604,898 29,359 -95% $0.2604 $0.0267 -90% 6 → 10
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 20/20 → 20/20 61,317 26,478 -57% $0.0427 $0.0258 -40% 11 → 9
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 19/20 → 20/20 123,156 23,578 -81% $0.0720 $0.0238 -67% 17 → 8
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 20/20 → 20/20 85,388 11,079 -87% $0.0511 $0.0107 -79% 5 → 6
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 20/20 → 20/20 522,506 48,126 -91% $0.2014 $0.0428 -79% 10 → 13
All runs, total 119/120 → 120/120 32,027,248 3,029,314 -91% $12.85 $2.79 -78%

Through the MCP proxy

Most people will not write an agent loop. They will point Claude Desktop, Cursor or VS Code at codemode-mcp serve. These runs do the same: a new proxy is started for every run and the model gets only the proxy's tool definitions, with no system prompt. The tasks are the six above. Because the number of runs differs between rows, tokens and cost are averages per run.

google/gemini-3.5-flash-lite

How the model reaches the tools Right answers Tokens per run vs classic Cost per run vs classic LLM turns
Classic tool calling 100/120 57,519 $0.0062 5
Code Mode, Python agent loop 118/120 21,877 -62% $0.0069 +11% 7
Code Mode, MCP proxy 119/120 20,836 -64% $0.0068 +10% 7
Code Mode, MCP proxy with persistent_state 118/120 20,937 -64% $0.0069 +11% 6

google/gemini-3.8-flash

How the model reaches the tools Right answers Tokens per run vs classic Cost per run vs classic LLM turns
Classic tool calling 119/120 266,894 $0.1071 8
Code Mode, Python agent loop 120/120 25,244 -91% $0.0232 -78% 9
Code Mode, MCP proxy 60/60 26,170 -90% $0.0233 -78% 9
Code Mode, MCP proxy with persistent_state 60/60 26,304 -90% $0.0227 -79% 9

Tasks the fixes were not tuned on

The six tasks above are the ones the instructions were improved against, so they could flatter the result. These four were written afterwards and the library was not changed in response to them. Figures are medians; the last row adds up every run.

google/gemini-3.5-flash-lite

Run on 2026-12-05 through aiplatform.googleapis.com. 20 repetitions per task and style, 240 runs in all.

Task We expected Right answers
classic / agent loop / proxy
Tokens
classic
Tokens
agent loop
Tokens
proxy
Agent loop
vs classic
Proxy
vs classic
Convert a time between two cities
1 tool call, tiny result
no saving 20/20 / 20/20 / 20/20 7,525 4,860 4,493 -35% -40%
Best-selling product category
a few calls; the database does the aggregation
no saving 20/20 / 19/20 / 19/20 24,420 7,917 7,468 -68% -69%
Find the largest file in a folder
1 call if the right tool is found, otherwise 1 per file
no saving 20/20 / 20/20 / 20/20 11,433 4,427 3,778 -61% -67%
Count function definitions per file
read 4 files (about 440 lines) and count matching lines
large saving 8/20 / 20/20 / 20/20 20,636 11,092 15,328 -46% -26%
All runs, total 68/80 / 79/80 / 79/80 1,264,709 657,828 779,034 -48% -38%

Cost of all runs: classic $0.20, agent loop $0.23, proxy $0.24.

1 run(s) ended in an error; they count as wrong answers and are left out of the averages: - category-revenue (codemode, repetition 5): AttributeError: 'NoneType' object has no attribute 'tool_calls'

google/gemini-3.8-flash

Run on 2026-12-05 through aiplatform.googleapis.com. 10 repetitions per task and style, 120 runs in all.

Task We expected Right answers
classic / agent loop / proxy
Tokens
classic
Tokens
agent loop
Tokens
proxy
Agent loop
vs classic
Proxy
vs classic
Convert a time between two cities
1 tool call, tiny result
no saving 10/10 / 10/10 / 10/10 11,839 6,035 5,542 -49% -53%
Best-selling product category
a few calls; the database does the aggregation
no saving 10/10 / 10/10 / 10/10 30,430 12,516 10,752 -59% -65%
Find the largest file in a folder
1 call if the right tool is found, otherwise 1 per file
no saving 10/10 / 10/10 / 10/10 11,722 4,001 3,498 -66% -70%
Count function definitions per file
read 4 files (about 440 lines) and count matching lines
large saving 10/10 / 10/10 / 10/10 42,954 14,864 11,501 -65% -73%
All runs, total 40/40 / 40/40 / 40/40 942,251 377,890 330,905 -60% -65%

Cost of all runs: classic $0.76, agent loop $0.38, proxy $0.34.

Earlier: After the instructions fix

google/gemini-3.5-flash-lite

Run on 2026-12-04 through aiplatform.googleapis.com, a development build made after 0.2.0 (commit 96a4827 plus changes not yet committed). 20 repetitions per task and style, 240 runs in all. Figures are medians.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 746 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens Classic cost Code Mode cost Cost LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 20/20 → 20/20 7,377 6,792 -8% $0.0009 $0.0024 +177% 2 → 4
Commit count and first commit
1 tool call, small result
no saving 20/20 → 15/20 22,366 35,469 +59% $0.0023 $0.0093 +307% 5 → 10
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 20/20 → 20/20 25,649 15,523 -39% $0.0038 $0.0065 +71% 6 → 7
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 20/20 → 20/20 92,988 20,562 -78% $0.0133 $0.0095 -29% 17 → 8
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 0/20 → 20/20 60,508 11,338 — $0.0043 $0.0046 — 4 → 6
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 20/20 → 20/20 127,656 49,342 -61% $0.0069 $0.0125 +80% 7 → 10
All runs, total 100/120 → 115/120 6,902,251 3,247,291 -53% $0.75 $0.94 +27%

A dash in the Tokens column means one of the two styles never gave the right answer for that task. Its token count is then the price of a wrong answer, not a saving, so no percentage is shown.

google/gemini-3.8-flash

Run on 2026-12-04 through aiplatform.googleapis.com, a development build made after 0.2.0 (commit 96a4827 plus changes not yet committed). 20 repetitions per task and style, 240 runs in all. Figures are medians.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 746 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens Classic cost Code Mode cost Cost LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 20/20 → 20/20 7,539 3,491 -54% $0.0061 $0.0034 -43% 2 → 3
Commit count and first commit
1 tool call, small result
no saving 20/20 → 20/20 604,898 29,017 -95% $0.2604 $0.0276 -89% 6 → 10
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 20/20 → 20/20 61,317 28,367 -54% $0.0427 $0.0271 -37% 11 → 8
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 19/20 → 20/20 123,156 31,262 -75% $0.0720 $0.0313 -56% 17 → 9
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 20/20 → 20/20 85,388 11,889 -86% $0.0511 $0.0119 -77% 5 → 6
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 20/20 → 20/20 522,506 53,481 -90% $0.2014 $0.0451 -78% 10 → 12
All runs, total 119/120 → 120/120 32,027,248 3,293,662 -90% $12.85 $2.99 -77%
Earlier: Version 0.2.0 as released

openai/gpt-4.1-mini

Run on 2026-12-04 through ai-gateway.vercel.sh, codemode-mcp 0.2.0 (commit 96a4827). The run was stopped early: 20 of 36 planned runs finished. Where a task has two runs the figure is their median; the score column shows how many runs each row rests on.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 556 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 2/2 → 2/2 7,191 5,228 -27% 2 → 5
Commit count and first commit
1 tool call, small result
no saving 2/2 → 0/2 9,697 119,518 — 2 → 22
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 2/2 → 0/2 24,615 3,356 — 6 → 4
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 1/2 → 0/2 75,882 20,146 — 6 → 10
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 0/1 → 0/1 51,848 362,625 — 3 → 25
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 1/1 → 0/1 459,445 2,161 — 8 → 2
All runs, total 8/10 → 2/10

A dash in the Tokens column means one of the two styles never gave the right answer for that task. Its token count is then the price of a wrong answer, not a saving, so no percentage is shown.

This run was stopped before it finished and before the runner saved results after every run. Each record holds what the runner printed for that run: total tokens, model turns and whether the answer matched the ground truth. The input/output split, cost, answers and scripts were not kept.

openai/gpt-5-nano

Run on 2026-12-04 through ai-gateway.vercel.sh, codemode-mcp 0.2.0 (commit 96a4827). The run was stopped early: 16 of 36 planned runs finished. Where a task has two runs the figure is their median; the score column shows how many runs each row rests on.

Tool definitions sent with every request: 5,975 tokens for classic MCP (46 tools from 5 servers) against 556 for Code Mode.

Task We expected Right answers
classic → Code Mode
Classic tokens Code Mode tokens Tokens LLM turns
What time is it in Tokyo?
1 tool call, tiny result
no saving 2/2 → 2/2 7,767 12,138 +56% 2 → 4
Commit count and first commit
1 tool call, small result
no saving 2/2 → 0/2 10,092 95,876 — 2 → 24
Top 5 customers by paid order value
a few calls; the database does the aggregation
some saving 1/1 → 1/1 18,535 37,198 +101% 4 → 12
Join a file against the database
2 servers; a 40-line file joined with SQL results
some saving 0/1 → 0/1 68,798 117,615 — 8 → 14
Find which source files use an API
read ~15 files (about 3,500 lines), keep a short list
large saving 1/1 → 0/1 544,063 54,003 — 12 → 19
Which recent commit changed the most files?
1 call per commit, each returning a full diff
large saving 1/1 → 0/1 126,912 110,116 — 6 → 25
All runs, total 7/8 → 3/8

A dash in the Tokens column means one of the two styles never gave the right answer for that task. Its token count is then the price of a wrong answer, not a saving, so no percentage is shown.

This run was stopped before it finished and before the runner saved results after every run. Each record holds what the runner printed for that run: total tokens, model turns and whether the answer matched the ground truth. The input/output split, cost, answers and scripts were not kept.

Costs use Google's published Gemini API prices per million tokens (input / output / cached input): $0.30 / $2.50 / $0.03 for gemini-3.5-flash-lite and $0.75 / $3.75 / $0.075 for gemini-3.8-flash. Your Vertex AI bill may differ slightly.

What these results say

  • It works, and it is more reliable than classic here. Code Mode missed 2 runs of 240. Classic missed 21, twenty of them on one task: asked which source files contain a piece of text, the smaller model read some of the files and answered with two of the four, every time. A script that loops over all the files does not get tired.
  • The token saving is real and grows with the work. On the two tasks that read many files or diffs, Code Mode used 68% to 91% fewer tokens. Classic spent a median of 604,898 tokens on one git question with gemini-3.8-flash because whole diffs went through its context.
  • Fewer tokens is not always fewer dollars. On gemini-3.5-flash-lite Code Mode cost $0.83 against $0.75 for classic. Google bills repeated input at a tenth of the normal price, and classic's large, unchanging block of tool definitions qualifies on every turn: 81% of classic's input was billed at the cached rate, against 33% of Code Mode's, whose requests are mostly too small to qualify. Code Mode also writes more output, which is the expensive part. On gemini-3.8-flash, where classic's context grew very large, Code Mode cost 78% less.
  • The proxy behaves like the agent loop. Through codemode-mcp serve, with no system prompt, the smaller model was right in 119 of 120 runs and the larger in 60 of 60, at the same token cost as the Python loop to within a few percent. Turning on persistent_state made no measurable difference to accuracy, tokens or turns, so the default (off) is fine.
  • The gains hold on tasks the fixes had not seen. On the four later tasks Code Mode was right in 79 of 80 runs on the smaller model, by either route, and in all 40 on the larger one. Classic was right in 68 of 80 and 40 of 40; its misses were all on the counting task, where the smaller model read the files and miscounted in 12 runs of 20.
  • We expected no saving on three of those four tasks and were wrong. They are short tasks, yet Code Mode used 35% to 70% fewer tokens. The reason is the tool definitions: classic sends 5,975 tokens of them on every turn, Code Mode 746. With 46 tools connected, that alone outweighs the extra turn a script costs. With a handful of tools it would not.
  • The cost pattern repeats. On the later tasks the smaller model again cost more with Code Mode ($0.23 and $0.24 against $0.20 for classic), and the larger model half as much ($0.38 and $0.34 against $0.76).
  • One-call tasks are still not its strength. For "how many commits are there", the smaller model used 23% more tokens in Code Mode and got one run of twenty wrong, counting seven commits instead of six while parsing the log text. This is the kind of task we expected no saving on. With the larger model the same task was 95% cheaper, but only because classic made expensive choices of its own.

What was wrong in 0.2.0, and what changed

When 0.2.0 failed we replayed the failing tasks with every script printed. The model never called a tool. It treated run_code as an ordinary Python interpreter:

What the model wrote in 0.2.0
import subprocess
commit_count = subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'])

That cannot work: the sandbox has no processes and no files, which is the point of it. The model then gave up and asked the user for the data, or kept trying until the turn limit. The tool names were listed in the instructions, but nothing said outright that the sandbox is empty and that the tools are the only way to reach anything.

Three changes fixed it, in this order:

  1. Instructions that cannot be misread. They now state that the sandbox is empty, show a call that exists in your own catalog instead of a server.tool_name placeholder, and say whether variables survive between scripts. A script that still reaches for subprocess or open() gets a one-line correction in its result.
  2. Results that are really values. The SQLite server returns rows as Python-style text, not JSON, so scripts received a string where they expected a list and spent many turns finding out. Such text is now parsed into lists and dictionaries.
  3. Variables that last for the conversation. Models work like people in a notebook: fetch, look, then process. When every script started from nothing, a common error was a follow-up script using a variable that no longer existed. The Python agent loops now keep variables until the conversation ends, and a script that trips over this is told so in its result.

The first change took Code Mode from failing to 235 of 240 right. The second and third brought it to 238 of 240 and cut tokens by a further 19% on the smaller model and 8% on the larger one. The tables for the first change alone are folded away above.

The proxy runs let us separate the last two. The proxy does not keep variables unless persistent_state is on, and it did just as well either way. So most of that further gain comes from the second change and from the correction messages, not from keeping variables.

Read these numbers with care

  • The runs were made just before 0.3.0 was cut. The main tables are from the development tree before the safety fixes in 0.3.0 (access token, memory limit, approval handling); the proxy and later-task runs are from the tree after them. None of those fixes changes what the model is told or what a script receives. The released package was not benchmarked again.
  • The first six tasks are the ones the fixes were developed on. We watched Code Mode fail on them, changed the library, and measured again. The four later tasks are the check on that, and they agree. But they are only four, written by the same people, over the same five servers. Run the suite on your own servers before relying on a number here.
  • The proxy runs are not a client app. They use a plain loop that speaks MCP to codemode-mcp serve. Claude Desktop, Cursor and others add their own system prompts and may load tools differently, which these runs do not capture.
  • Fewer repetitions on the larger model for the newer runs. The proxy and later-task runs used 10 repetitions on gemini-3.8-flash and 20 on gemini-3.5-flash-lite. The proxy table shows averages per run so that rows with different run counts compare.
  • One Code Mode run crashed. The provider returned a reply with no message and the agent loop raised an error. It is counted as a wrong answer. The loop now asks again in that case; the run was not repeated.
  • The classic runs were not repeated for the final version. Classic tool calling does not go through codemode-mcp, so the same 20 classic repetitions are the baseline for both the first fix and the current version.
  • Only the 0.2.0 results are from OpenAI models. The fixed version has not been measured on them, and 0.2.0 has not been measured on Gemini. The two sets show a before and an after, not a comparison between model families.
  • One run was repeated. A classic run on gemini-3.8-flash was lost to a network timeout and run again on its own. No run was dropped for its answer.

Run it yourself

You need Node.js and uv on your PATH (the reference servers start through npx and uvx), and an API key for an OpenAI-compatible endpoint. The default is the Vercel AI Gateway.

git clone https://github.com/shivamkr09/codemode-mcp && cd codemode-mcp
uv sync --all-extras
uv run codemode-mcp setup
uv run python benchmarks/make_data.py

export AI_GATEWAY_API_KEY="..."        # or put it in .env.local, which git ignores
uv run python benchmarks/run.py -m openai/gpt-4.1-mini
uv run python benchmarks/report.py     # rewrites the Results section above

On Google Cloud Vertex AI there is no key to set. Sign in with gcloud auth login, then:

uv run python benchmarks/run.py --vertex-project MY_PROJECT -m google/gemini-3.5-flash-lite \
    --price 0.30 2.50 0.03

Useful options for run.py:

Option Meaning
-m MODEL Model id as the endpoint names it
--base-url URL / --api-key-env VAR Use another OpenAI-compatible endpoint
--reps N Repetitions per task and style (default 3). Medians are reported
--only KEY … Run only some tasks. --list prints the keys
--styles classic codemode proxy proxy-state Which ways to run each task (default classic codemode). proxy goes through codemode-mcp serve; proxy-state does so with persistent_state on
--group original / --group unseen Run only the first six tasks, or only the four added later
--suite NAME Which part of the report the runs belong to: main (default), proxy or unseen
--vertex-project ID / --gcloud-account EMAIL Use Vertex AI in that project, with gcloud sign-in
--price IN OUT CACHED Dollars per million tokens, for endpoints that do not publish prices
--tag NAME / --label TEXT Write a separate result file, so several processes can share one model; group results in the report

Raw results, including every answer and every script the model wrote, are saved as JSON in benchmarks/results/ after every run, so stopping early keeps what was measured. The tables on this page are generated from those files and are not edited by hand.

The servers can write

The filesystem and git servers are given this repository, including their write tools, because that is what a real setup looks like. The tasks only ask questions, but run the suite in a checkout you don't mind a model having access to.

What these numbers do not tell you

  • Other models. Two Gemini models have been measured with the fixed version. Larger models, and other families, have not. In particular the two small OpenAI models that failed on 0.2.0 have not been run again.
  • Clients that load tools on demand. The classic runs send every tool definition on every request. A client that defers definitions until they are needed already avoids part of that cost, so the gap on small tasks narrows.
  • Your servers. Five servers is a modest setup. Savings on definitions grow with the number of tools, and savings on results grow with how large and how numerous they are.
  • Your prices. How much of the token saving turns into money depends on your provider's discount for cached input and on what it charges for output.
  • Variance. Models are not deterministic. Twenty repetitions and a median smooth this out; they do not remove it.

Measure one prompt of your own

For a quick comparison on your own servers, without the suite:

codemode-mcp benchmark -c mcp.json -m gpt-4.1-mini "your real task"

It prints tokens, turns, tool calls, time and both answers, and saves the result for the dashboard.

Earlier figures

Before this suite existed, the project quoted two numbers from its bundled example servers. Both are reproducible, and both need their context:

Figure What it is
78,933 → 1,697 definition tokens (97.9%) A synthetic 306-tool catalog (examples/mcp.big.json), built to show how definitions scale. Counted with tiktoken; no model involved
8,463 → 1,634 input tokens (80.7%) A scripted replay of one task on the demo shop server (examples/benchmark.py). It counts the tokens each style would send, assuming the model writes a correct script on the first try. No model involved