Automation

Playwright MCP Token Cost: 2026 Benchmarks, CLI Trade-Offs & 6 Production Fixes

Early-2026 benchmarks claimed Playwright MCP burned 114,000 tokens per task, yet a 19-release audit shows page loads dropped 99.5% to 79 tokens after v0.0.69. Here is what 1 session actually costs in November 2026—and 6 flags in v0.0.86 to cut your bill.

By 0xScorPionSon

11 min read

Playwright MCP Token Cost: 2026 Benchmarks, CLI Trade-Offs & 6 Production Fixes

Playwright MCP token cost architecture and 2026 benchmark breakdown

Browser automation is one of the fastest ways to blow through an AI coding agent's token budget—not because the browser is slow, but because every click and navigation can dump thousands of lines of accessibility-tree text back into the model's conversation history. Widely cited early-2026 benchmarks warned that a single Playwright MCP session burned 114,000 tokens compared to 26,800 for the Playwright CLI, yet a November 20, 2026 benchmark across 19 releases by TestDino and the November 18, 2026 release of @playwright/mcp v0.0.86 (GitHub Releases) show a very different picture in production.

Executive Summary

  • Page-Load Response Dropped 99.5%: Since @playwright/mcp v0.0.69 (March 30, 2026), browser_navigate writes the page accessibility snapshot to a .yml file on disk and returns a compact file link—cutting a Hacker News page-load response from 15,317 tokens (v0.0.68) to 79 tokens (v0.0.69–v0.0.85) (TestDino).
  • Turn Count Beats Idle Context Size: In a controlled e-commerce add-to-cart benchmark (OpenCode 1.18.35), current Playwright MCP 0.0.85 processed 266,247 tokens (12–13 requests, ~$0.08 on Claude Sonnet 5.5), outperforming both Playwright CLI 0.1.24 (554,973 tokens across 20 requests, ~$0.15) and legacy MCP 0.0.68 (673,253 tokens, ~$0.17) (TestDino).
  • Latest Release Requires Node.js 20+: @playwright/mcp v0.0.86 (released November 18, 2026 under Apache-2.0) raises the minimum runtime floor to Node.js 20+, ships an Ubuntu Noble + Node.js 26 Docker image, adds Linux ARM64 Chrome support, and introduces resumable extension tab groups (GitHub Releases).
  • Operational Takeaway: Token spend is now governed by whether your agent calls full browser_snapshot, how many round-trips it takes, and whether you convert stable agent-discovered flows into zero-token npx playwright test specs.

What Changed: From Inline DOM Dumps to File-Linked Snapshots

Microsoft's Playwright MCP server (@playwright/mcp, 40,000+ GitHub stars, Apache-2.0 license) lets LLMs drive Chromium, Firefox, or WebKit using structured accessibility trees rather than pixel screenshots. Through v0.0.68 (February 14, 2026), every action tool call returned the entire accessibility tree inline inside the JSON-RPC response. Because LLM agents replay full conversation history on every subsequent turn, a single 15,000-token snapshot was re-read by the model on every remaining step of the workflow.

Starting with v0.0.69 (March 30, 2026), the server silently adopted the same disk-offload pattern used by the Playwright CLI: action responses write the snapshot to .playwright-mcp/page-<timestamp>.yml and return a lightweight Markdown link alongside the executed Playwright code. Then, in v0.0.78 (July 9, 2026), Microsoft added browser_find—a targeted search tool that queries the accessibility tree by text or regex and returns only matching nodes with a few lines of surrounding context (GitHub Releases).

sequenceDiagram
    participant Agent as LLM Agent (Claude Code / OpenCode)
    participant MCP as @playwright/mcp (v0.0.86)
    participant Disk as Workspace (.playwright-mcp/*.yml)
    Agent->>MCP: browser_navigate(url)
    MCP->>Disk: Write full accessibility tree (8k-22k tokens)
    MCP-->>Agent: Return 79-97 token link + generated JS
    Agent->>MCP: browser_find(text="Add to cart")
    MCP-->>Agent: Return 168-397 token matching refs
    Agent->>MCP: browser_click(ref)
    MCP-->>Agent: Return 27-86 token confirmation

Fixed vs. Variable Token Spend

A Playwright MCP session consumes tokens in four distinct places (TestDino):

  1. Tool Definitions (Fixed Per-Request Overhead): By v0.0.85, the default set grew from 21 tools (2,203 tokens in v0.0.41) to 25 tools (3,919 tokens)—a 78% increase—and enabling every optional capability (--caps=vision,pdf,devtools, etc.) expands the schema to 72 tools (8,391 tokens). Clients like Claude Code defer MCP tool schemas at session start (loading only names and server instructions), whereas clients like OpenCode send full definitions on the first request (+4,607 tokens observed).
  2. Page Snapshots (Largest Variable Item): While browser_navigate now returns 79–97 tokens, an explicit browser_snapshot call still returns the full tree inline—ranging from 8,331 to 22,279 tokens across real-world pages (o200k_base tokenizer). Claude Code warns whenever a single MCP tool output exceeds 10,000 tokens and caps output at 25,000 tokens by default (MAX_MCP_OUTPUT_TOKENS).
  3. Screenshots & Console Logs: On Anthropic's vision pricing (ceil(width / 28) * ceil(height / 28)), a 1280x720 screenshot consumes 1,196 visual tokens.
  4. Conversation Replay (Compounding Multiplier): Every tool response stays in the message history and is re-processed as cached or uncached input on every subsequent request.

Minimal Production Configuration (v0.0.86)

For headless CI or local coding agents, pair the leanest runtime flags with explicit workspace rules so the agent defaults to browser_find instead of full snapshots:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@0.0.86",
        "--headless",
        "--isolated",
        "--image-responses",
        "omit"
      ]
    }
  }
}

Reliability, Cost & Performance Analysis

19-Release Page-Load & Snapshot Telemetry

Testing 19 releases side-by-side on headless Chrome (1280x720, counted with o200k_base on November 17, 2026) highlights the exact architectural inflection point at v0.0.69 (TestDino):

Version Release Date Hacker News (browser_navigate) Playwright Docs GitHub Repo Wikipedia Article
0.0.41 Oct 1, 2025 15,219 tokens 8,634 tokens 19,727 tokens 16,670 tokens
0.0.68 Feb 14, 2026 15,317 tokens 8,633 tokens 19,729 tokens 16,295 tokens
0.0.69 Mar 30, 2026 79 tokens (-99.5%) 79 tokens 97 tokens 90 tokens
0.0.85 Nov 9, 2026 79 tokens 79 tokens 97 tokens 90 tokens

Note that the underlying browser_snapshot payload itself barely shrank (15,203 -> 13,544 tokens on Hacker News; 20,120 -> 22,279 on a GitHub repo page) even after v0.0.78's snapshot distillation. Clients that lack filesystem access (such as pure web chat UIs) cannot read .yml disk links and are still forced onto the full-snapshot path—though v0.0.82 added --file-paths=absolute for agents without a workspace root (GitHub Releases).

Real-Task Benchmark: MCP 0.0.85 vs. CLI 0.1.24 vs. MCP 0.0.68

Microsoft's own README recommends playwright-cli + SKILLs over MCP for coding agents to avoid loading tool schemas and accessibility trees. However, when TestDino ran an identical multi-step e-commerce task (navigate to products, select Dell XPS 13, add to cart, verify cart summary) twice per tool using OpenCode 1.18.35, total tokens processed (fresh input + cache reads) flipped the conventional wisdom (TestDino):

Tool & Run Requests First Request Peak Context Tokens Processed Wall Time
MCP 0.0.68 (Run 1 / Run 2) 13 / 22 14,702 47,907 / 52,512 505,633 / 840,872 71 s / 116 s
CLI 0.1.24 (Run 1 / Run 2) 20 / 20 11,723 34,236 / 45,838 421,118 / 688,827 103 s / 107 s
MCP 0.0.85 (Run 1 / Run 2) 13 / 12 16,330 31,674 / 30,275 291,135 / 241,358 48 s / 65 s

Why did MCP 0.0.85 beat the CLI by 52% on average tokens processed (266,247 vs. 554,973)? Two operational mechanics explain it:

  1. Fewer Round-Trips: MCP 0.0.85 completed the task in 12–13 requests using 3–4 targeted browser_find calls, whereas the CLI needed 20 shell-command requests—re-reading the conversation history 7–8 extra times.
  2. Skill-File Parity: Once loaded, the CLI skill file (3,760 tokens) nearly matched the 25 MCP tool definitions (3,919 tokens), though the CLI retains an idle advantage (47-token header before loading) for code-heavy sessions that rarely open a browser.

Dollar Cost at Scale (November 2026 Anthropic Pricing)

Applying Anthropic's November 2026 rates (where cache reads on Sonnet 5.5 cost $0.10/1M vs. $2.00/1M fresh input—a 95% discount—and accounted for 90.8% of processed tokens in MCP 0.0.85 runs) yields the following modeled per-session and monthly team costs (TestDino):

Tool (Average Usage) Fresh Input Cache Read Output Haiku 5.5 Sonnet 5.5 Opus 5.5
MCP 0.0.85 24,583 241,664 693 $0.005 $0.08 $0.16
CLI 0.1.24 36,061 518,912 2,136 $0.010 $0.15 $0.29
MCP 0.0.68 45,157 628,096 1,492 $0.012 $0.17 $0.34

Without prompt caching, the average MCP 0.0.85 session on Sonnet 5.5 would jump from $0.08 to $0.54. At a modest CI scale of 200 agent-driven browser flows per day over 22 working days, MCP 0.0.85 models to $353/month on Sonnet 5.5 or $706/month on Opus 5.5—making prompt caching and flow-to-test conversion essential before scaling. (For context, Anthropic's Claude Code cost docs put average enterprise developer spend around $13/day.)

Security Boundaries & v0.0.86 Operational Gotchas

Before deploying @playwright/mcp v0.0.86 in shared or CI environments, note three verified constraints:

  • browser_run_code_unsafe Is RCE-Equivalent: As highlighted in DataImpulse's November 20, 2026 audit and Microsoft's docs, the default browser_run_code_unsafe tool executes arbitrary JavaScript in the Playwright server process with full access to that process's environment and permissions. Never expose it to untrusted prompts or unauthenticated network endpoints.
  • --allowed-origins Is Not a Security Boundary: Microsoft explicitly documents that --allowed-origins and --blocked-origins do not cover HTTP redirects and do not constitute a security boundary (GitHub README). Enforce egress restrictions at the container or proxy layer.
  • Node.js 20+ Floor & Extension Breakage in v0.0.86: v0.0.86 drops Node.js 18 support, refuses browser-wide cookie-clearing/permission-granting calls from extension clients, and limits CDP attachment on unresponsive tabs to 10 seconds (GitHub Releases).

Practical Implementation & Trade-Offs

6 Verified Settings to Cut Playwright MCP Token Spend

Every optimization below is built into @playwright/mcp v0.0.85+ and verified against TestDino's Wikipedia and demo-store runs (TestDino):

Optimization Mechanism / Flag Measured Before Measured After
1. Search Instead of Snapshot Call browser_find instead of browser_snapshot 17,226 tokens 397 tokens (-97.7%)
2. Scope Snapshot Depth Pass depth: 3 or target to browser_snapshot 17,226 tokens 415 tokens (-97.6%)
3. Save Snapshots to Disk Pass filename parameter to browser_snapshot 17,226 tokens 46 tokens (-99.7%)
4. Trim Action Responses Pass --snapshot-mode none --codegen none 86 tokens/click 27 tokens/click (-68.6%)
5. Omit Inline Screenshots Pass --image-responses omit (or filename on screenshot) 1 image + 122 tokens 122 text tokens
6. Limit Loaded Capabilities Use default 25 tools instead of all capabilities (72 tools) 8,391 tokens 3,919 tokens (-53.3%)

(Caution: Keep --codegen enabled—its default typescript output—when your goal is to turn an exploratory agent session into a repeatable .spec.ts file. Also test --mobile on your own app before assuming savings: while Microsoft's README notes mobile views are usually lighter, only 1 of 4 pages shrank meaningfully in testing.)

Decision Framework: MCP vs. CLI vs. Deterministic Specs

  • Use Playwright MCP (v0.0.86) when the agent needs persistent browser state, interactive exploration, self-healing locator repair, or multi-tab extension workflows (--extension with --session-name and --background), and your client supports local workspace file reads.
  • Use Playwright CLI + Skills when your coding agent spends 90%+ of its turns editing large codebases and only occasionally checks a UI—especially in clients that do not defer MCP tool schemas—so you avoid paying the 3,919-token schema tax on every non-browser turn.
  • Compile to npx playwright test Immediately: An agent session burns tokens on every run; a generated Playwright spec runs in CI for $0 in LLM tokens. Use MCP once to explore and generate the spec, then execute the spec deterministically in CI.

Frequently Asked Questions

How many tokens does Playwright MCP use per page load in 2026?

On @playwright/mcp v0.0.69 through v0.0.85+, a browser_navigate call returns 79 to 97 tokens because the accessibility snapshot is written to a .yml file on disk. Only an explicit browser_snapshot call returns the full tree inline (8,331 to 22,279 tokens on tested pages).

Why do people still cite 114,000 tokens for Playwright MCP?

That figure comes from a February 6, 2026 Playwright CLI vs. MCP demo video recorded before v0.0.69 (March 30, 2026). Releases up to v0.0.68 returned the full accessibility tree inline on every action response, rapidly inflating context size.

Is Playwright CLI always cheaper than Playwright MCP?

No. While the CLI has a smaller idle footprint (47-token header vs. 3,919 tokens for 25 MCP tool definitions), TestDino's November 2026 benchmark found MCP 0.0.85 processed fewer total tokens (266,247 avg) than CLI 0.1.24 (554,973 avg) on a multi-step checkout flow because MCP finished in 12–13 requests instead of 20.

What changed in @playwright/mcp v0.0.86?

Released on November 18, 2026, v0.0.86 requires Node.js 20+, updates the Docker image to Ubuntu Noble with pinned Node.js 26, adds Linux ARM64 Chrome installation, introduces resumable and color-coded extension tab groups (--session-name, --session-color), and caps unresponsive CDP tab attachment at 10 seconds.

How can I measure my own Playwright MCP token usage?

In Claude Code, run /context and /usage inside a session; in OpenCode, run opencode export <session-id> to inspect per-request provider token logs. You can also connect directly to @playwright/mcp via @modelcontextprotocol/sdk and count listTools() and callTool() outputs locally with js-tiktoken (o200k_base).

Sources

More on Automation

Automation

GitLab 19.6.1, 19.5.8, and 19.4.10 Fix Ruby2Shell (CVE-2026-132825) Ahead of November 25 PoC

On November 20, 2026, GitLab shipped critical patch releases 19.6.1, 19.5.8, and 19.4.10 bundling Ruby 3.3.14 and 3.4.13 to remediate Ruby2Shell (CVE-2026-132825) ahead of Veria Labs' planned November 25 Rails PoC release. While GitLab.com and GitLab Dedicated are already patched, self-managed CE/EE instances require an immediate upgrade—with zero migrations and no multi-node downtime.

7 min read

Automation

Elecbrakes ICSA-26-323-02: Unauthenticated BLE Flaws (CVSS 9.6) Expose Trailer Brake Controllers

On November 19, 2026, CISA issued advisory ICSA-26-323-02 warning of three critical vulnerabilities (CVSS v3 base score 9.6) in Elecbrakes EB2, VM1, and ELBC2000 trailer brake controllers. Unauthenticated Bluetooth Low Energy command injection and an unprotected firmware-update channel allow in-range attackers to alter braking or disable safety features. While EB2 3.0.4.4.3 and VM1 1.3.4.2.1 ship fixes, the discontinued ELBC2000 currently has no patch.

5 min read

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla