Giving your agent a browser. Playwright MCP, honestly reviewed.


A coding agent without a browser lives in a strange half-world: it can refactor your entire E2E suite but cannot see the page the suite renders. I wired Playwright MCP into Claude Code two weeks ago and let it drive. These are the notes.

What it is

Microsoft’s MCP server over Playwright — the same automation engine that runs your test suite, exposed as tools: navigate, click, type, fill_form, snapshot, take_screenshot, manage tabs, upload files. Setup is one line:

claude mcp add playwright -- npx @playwright/mcp@latest

The design decision that matters: by default it drives the page through the accessibility tree, not pixels. Each snapshot hands the agent a numbered list of interactive elements, and the agent clicks by reference, not by coordinate. No vision model, no screenshot diffing, no “the button moved between screenshots”. There is an opt-in vision mode; the a11y route is the default, and it is the right default — deterministic, fast, and far cheaper than tokenizing images.

What it is good at

Token economics

The snapshot is the page for the agent, and a complex dashboard snapshot runs to thousands of tokens; a long session accumulates them. The fix is phrasing: “find the invoice link” costs a fraction of “describe the page”. Tell the agent what it is looking for and the meter stays polite.

The honest trade-offs

Where it landed

The deploy smoke check is the keeper. The E2E suite still owns regressions — deterministic, versioned, fast; a browser-driven agent is none of those things. But the ad-hoc “is it up and does it look alive” question, which used to be me opening six tabs after every release, now goes to the agent with a browser. That division of labor has held for two weeks, which in this space is a longevity record.