作者用 Claude Code 評測四種 Browser MCP 方案,turbo-browser-mcp 初測成本排名第三
I Benchmarked Four Browser MCP Stacks with Claude Code, and Mine Lost on Cost First
作者用 Claude Code 對四種 Browser MCP 方案進行端到端基準測試,turbo-browser-mcp 0.6.1 三項任務全數通過,成本排名第三。
Per-tool benchmarks are flattering because there is no model in the loop. When I first measured turbo-browser-mcp on local HTML fixtures with tiktoken, compact DOM snapshots and single-call form fills shrank tool output by more than 90%. Then readers on Hacker News and DEV asked the question that actually matters: what happens when a real coding agent drives a multi-step task end to end, and an external server checks whether the job actually worked?
So I built an end-to-end agent harness in benchmarks/e2e-agent/ and ran Claude Code (--model sonnet) across four browser stacks: turbo-browser-mcp 0.6.1, agent-browser 0.43.0, browse 0.0.17, and browser-use 1.0.5.
My server finished in the shortest total wall time (85.8 s), and came in third on dollar cost ($0.395 across 42 turns, versus $0.237 and 20 turns for browse). Reading the transcripts showed why, and led to the changes in 0.7.2 that brought the same three-task run down to 23 turns, 20 tool calls, $0.223, and 76.5 s.
Grading the browser state, not the agent's summary
If you ask an LLM agent whether it submitted a form, it will happily read a validation banner or an old confirmation string on the page and report success. In this harness, the local fixture server decides pass or fail from its own state after the agent exits:
- On the job application task (
application), the agent fills candidate fields, picks a region from a portaled combobox with its own search input, attaches a real PDF from disk, passes a review step, and commits once. The server checks the stored record, exact uploaded file bytes, and whether the receipt ID in the agent's final answer matches the committed row. - On the paginated catalog task (
catalog), the agent searches a multi-page product list and returns all 37 in-stock rows in order with exact prices. - On the booking wizard (
booking), the agent saves a draft step, completes the reservation, and returns the server-generated confirmation code.
Every run used Claude Code with Claude Sonnet 5.5, isolated from personal settings (--setting-sources project --disable-slash-commands --strict-mcp-config, CLAUDE_CODE_DISABLE_CLAUDE_MDS=1), with only the MCP server or CLI under test enabled.
Stage 1 results: fast in the browser, expensive in turns
All 12 trials passed (3/3 per stack). With one trial per cell, this sample cannot rank the four projects; a second pass could reorder them, and two stacks (turbo-browser-mcp and agent-browser) ran headless while browse and browser-use drove a visible Chrome window.
| Stack | Tasks passed | Turns | Cost (USD) | Wall time (s) |
|---|---|---|---|---|
turbo-browser-mcp 0.6.1 (headless) |
3/3 | 42 | 0.395 | 85.8 |
agent-browser 0.43.0 (headless) |
3/3 | 33 | 0.440 | 196.8 |
browse 0.0.17 (headed Chrome, extension) |
3/3 | 20 | 0.237 | 118.6 |
browser-use 1.0.5 (headed Chrome) |
3/3 | 33 | 0.344 | 120.6 |
Look at application alone: turbo-browser-mcp took 23 turns and $0.205 (995,969 input + cached + output tokens), while browse finished the same task in 8 turns and $0.082.
Why did nearly a million tokens get billed when each compact DOM snapshot was under 1,200 tokens? Because an empty Claude Code session already carries roughly 36,000 tokens of system prompt and built-in tool schemas on every turn. Even with prompt caching, re-sending the growing conversation 23 times cost far more than the browser payloads themselves. Saving 2,000 tokens in a snapshot does not rescue a workflow that takes 13 extra model round trips.
Four bugs the transcripts exposed
Enabling stream-json transcripts (BENCH_TRANSCRIPT=1) made the wasted turns obvious:
1. The model ignored the batch form tool unless nudged
turbo-browser-mcp already had smart_fill_form, which fills inputs, checkboxes, selects, and file uploads in one call. In 0.6.1, the tool descriptions treated act_fast and smart_fill_form as peers, so Sonnet defaulted to calling act_fast one field at a time. Worse, when it hit the portaled Region listbox, the dropdown rendered a separate search box inside a portal, and smart_fill_form could not filter and pick that option on its own.
Tightening the server instructions and tool descriptions so multi-field forms explicitly point to smart_fill_form, plus adding a keyboard search fallback for portaled comboboxes, cut application from 23 turns ($0.205) to 10 turns ($0.079).
2. Multi-page reading still cost two calls per page
On catalog, the agent had to visit four result pages and extract rows from each. Previously that meant alternating navigation calls with extract_clean_text, burning 12 turns.
We added navigate (GET only), extract (text or markdown), and collect (scroll a container, read matching items on each pass, and deduplicate recycled nodes in virtualized feeds) directly as step types inside batch_actions:
{
"name": "batch_actions",
"arguments": {
"steps": [
{ "action": "navigate", "url": "http://127.0.0.1:43110/catalog?page=2" },
{ "action": "extract", "format": "text", "selector": "main", "maxChars": 3000 },
{ "action": "navigate", "url": "http://127.0.0.1:43110/catalog?page=3" },
{ "action": "extract", "format": "text", "selector": "main", "maxChars": 3000 }
]
}
}
catalog dropped from 12 turns to 6 turns (5 tool calls, $0.075).
3. Fixed post-click sleeps either wasted time or snapped too early
Waiting a fixed 300 to 500 ms after a click with returnSnapshot: true missed fast SPA navigations that started at 120 ms and still penalized clicks that did nothing. Replacing the fixed sleep with a quiet-DOM settle check (wait up to 150 ms for navigation to start, wait for domcontentloaded if it did, then wait until the DOM stays quiet for 80 ms with no young pending requests, capped at 800 ms) stopped returning half-rendered pages to the model.
4. Receipt checks matched text that was already on the page
batch_actions blocks Submit, Publish, Pay, and modal OK/Confirm clicks unless allowSubmit: true is set, and supports an expect check so the server verifies the submission before returning submitVerified: true. Originally expect only had textMatches. On pages where words like "Submitted" or "Order" already existed in a header or sidebar, textMatches passed immediately even if the click failed.
0.7.x added textNew, which records matching elements before the batch runs and only passes when a new match appears afterwards. In the same 0.7.1 and 0.7.2 cycle we also shipped:
- Element reference fingerprints (including clone-group index and
WeakMapowner checks suggested by reader Renhua Wei) so recycled rows in virtualized lists fail fast instead of clicking the wrong item. -
--secrets <dotenv-file>with$secret:NAMEplaceholders that inject credentials at typing time and redact them from snapshots, errors, and saved files. -
--content-boundaries(<<page:nonce>> ... <</page:nonce>>) and--allow-hosts/TURBO_BROWSER_ISOLATE_HOSTSfor untrusted pages.
Re-running the harness on 0.7.2
Running the exact same three tasks and prompts on turbo-browser-mcp 0.7.2 (Claude Code 2.1.329, sonnet, BENCH_TRANSCRIPT=1):
| Task |
0.6.1 (turns / cost / s) |
0.7.2 turns |
0.7.2 tool calls |
0.7.2 tokens |
0.7.2 cost (USD) |
0.7.2 time (s) |
|---|---|---|---|---|---|---|
application |
23 / $0.205 / 44.5 s | 10 | 9 | 227,216 | $0.079 | 24.7 s |
catalog |
12 / $0.110 / 24.0 s | 6 | 5 | 157,407 | $0.075 | 21.5 s |
booking |
7 / $0.080 / 17.3 s | 7 | 6 | 190,786 | $0.068 | 30.3 s |
| Total | 42 / $0.395 / 85.8 s | 23 | 20 | 575,409 | $0.223 | 76.5 s |
Claude Code 2.1.329 also introduced ToolSearch (1 call per task), keeping deferred schemas out of the base prompt and trimming total billed tokens another 33.7% compared with our 16 Nov pre-release run (575,409 vs 867,474 tokens).
Caveats and reproducibility
- This is still one trial per cell, and the other three stacks were not re-run in the
20 Novpass. Treat the numbers as a before-and-after check on our own server, not a leaderboard win. - Two evaluator bugs caught during Stage 1 are documented in
benchmarks/E2E_RESULTS.md: the catalog grader originally rejected numeric strings like"25.75"when the prompt never required JSON numbers (fixed inrescore.mjsand applied equally to all saved runs), andbrowseneeded three harness setup fixes before its clean trial. - The 10-trial randomized protocol in
benchmarks/E2E_PLAN.mdhas not been run yet.
Source, fixture apps, and raw JSONL records are MIT-licensed at github.com/Tthanh2k6/turbo-browser-mcp. If you want to try the server in Claude Code or Cursor:
claude mcp add turbo-browser -- npx -y turbo-browser-mcp
來源:DEV Community · dev.to