Skip to content

mcp: token-cost benchmark in the README + reproducible script - #26

Merged
Arman-Luthra merged 1 commit into
mainfrom
mcp-token-benchmark
Jul 11, 2026
Merged

mcp: token-cost benchmark in the README + reproducible script#26
Arman-Luthra merged 1 commit into
mainfrom
mcp-token-benchmark

Conversation

@arham766

Copy link
Copy Markdown
Member

Adds a Token cost section to mcp/README.md and a reproducible mcp/benchmark_tokens.py.

What it shows

Handing an agent a raw web page is expensive. The "Web scraping" Wikipedia article is 68,240 tokens of HTML; Nike's homepage is 353,000 (tiktoken cl100k_base). A built-in web fetch summarizes readable pages cheaply and clears anti-bot on many sites, but returns nothing on JavaScript-rendered pages and some hard walls, where the agent falls back to raw HTML and still fails. The Fortress MCP returns bounded clean output there: 285 tokens for the JS quotes page, about 700 for Nike instead of a 403.

Page Raw HTML Built-in web fetch Fortress MCP
Wikipedia (Web scraping) 68,240 tok ~950 tok summary full clean markdown
Nike homepage 353,241 tok HTTP 403 ~700 tok clean text
quotes.toscrape.com/js empty shell "NO QUOTES FOUND" 285 tok, all 10 quotes
Ticketmaster 151,946 tok cleared cleared
Indeed 403 to a naive client cleared cleared
Hacker News 11,765 tok cleared cleared

Reproduce

benchmark_tokens.py counts the tokens each path returns for a list of URLs and flags which ones a naive client is blocked on. Measured on one residential IP; numbers vary by IP and site.

Docs plus one script. No engine or server code changed.

Adds a Token cost section to mcp/README.md and mcp/benchmark_tokens.py.

Handing an agent a raw web page is expensive: the Web scraping Wikipedia
article is 68,240 tokens of HTML and Nike's homepage is 353,000 (tiktoken
cl100k_base). A built-in web fetch summarizes readable pages cheaply and
clears anti-bot on many sites, but returns nothing on JS-rendered pages and
some hard walls, where the agent falls back to raw HTML and still fails. The
Fortress MCP returns bounded clean output there (285 tokens for the JS quotes
page, about 700 for Nike instead of a 403).

benchmark_tokens.py counts the tokens each path returns for a list of URLs and
flags which ones a naive client is blocked on. Docs plus one script; no engine
or server code changed.
@Arman-Luthra

Copy link
Copy Markdown
Member

reproduced and works well on my device. lgtm!

@Arman-Luthra
Arman-Luthra merged commit 8a10c03 into main Jul 11, 2026
5 of 6 checks passed
@Arman-Luthra
Arman-Luthra deleted the mcp-token-benchmark branch July 11, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants