Most things a model would reach a browser for, like checking that a deploy preview renders, scraping a page that requires login, or verifying that a form actually submits, are awkward with plain HTTP fetches. Playwright MCP gives the model a real, headed-or-headless Chromium it can actually click around in.
It is the second MCP server worth installing on every machine. Anything that involves a screenshot, a logged-in session, or interacting with JavaScript-rendered UI ends up routed through it, and "test this PR's preview deploy" stops being a manual job.
§01What it can do
The server exposes the full Playwright surface as MCP tools:
- Navigate, click, type, and scroll: the full DOM-interaction API.
- Screenshot: the model gets a real image back, which it can reason about. Especially useful for visual regression checks.
- Network capture: inspect requests and responses while a flow runs.
- Multiple contexts: isolate sessions per task, so cookies do not bleed between flows.
- Persistent profiles: reuse a logged-in profile across runs, with care.
§02When it earns its keep
Playwright is overkill for read-only public pages, where a fetch MCP or simple HTTP tool is cheaper and faster. It earns its keep when the page is JavaScript-rendered and the HTML a fetch would return is empty, when the flow requires login or session continuity, when a screenshot is the actual deliverable rather than text, or when the work involves testing a deploy preview, filling forms, or anything where state matters.
§03Setup
claude mcp add playwright -- npx -y @microsoft/playwright-mcp
# the first run pulls Chromium (~150MB).
# subsequent runs are instant.
By default the browser runs headless. Watching the agent work in real time is worth doing at least once for the dopamine; pass --headed through the args. It is also useful when an agent's clicks are not landing and you cannot tell why.
§04An example worth keeping
After a Vercel preview deploys, the prompt that pays off most often:
◆ pull quote
“Open the deploy preview at https://my-app-pr-42.vercel.app, log in as the test user, add a product to the cart, go to checkout, and screenshot each step. Tell me if anything looks off compared to production.”
The agent opens the browser, navigates the flow, screenshots each page, and writes back a paragraph plus a list of attached images. What used to be a manual five-minute pre-merge ritual takes one prompt and runs in the background.
§05Caveats
- Token-heavy. Page DOMs and screenshots are big, so Playwright runs cost real money. Do not loop them in autonomous agents without a budget.
- Do not pass real credentials. Use a dedicated test account, ideally with limited blast radius.
- Headless is not the same as invisible. Some sites detect headless Chromium, so headed mode is the workaround when unexpected captchas show up.
- Persistent profiles are a footgun. A logged-in profile that the agent inherits is a logged-in profile the agent can do anything with. Profile per task, when in doubt.