Playwright MCP: what it does, how to set it up,
and when you want a verdict instead.
Playwright MCP is Microsoft's Model Context Protocol server for Playwright. It gives an AI agent a real browser and a set of tools to drive it: go to a page, click, type, read what is there. This guide covers what it is, how to install it in the common coding agents, the tools it offers, and where it stops. It hands the agent a browser, and the agent decides what passed.
Testorim publishes this page and makes a hosted testing service with its own MCP server, compared near the end. Facts about Playwright MCP and Chrome DevTools MCP come from their own READMEs, checked in September 2026, and the sources are at the bottom.
What Playwright MCP is.
The README describes a server that "provides browser automation capabilities using Playwright" and "enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models." In practice the agent reads each page as an accessibility tree, a text outline of roles and names, and acts on elements by the references in that outline.
- Open source. Apache-2.0, published on npm as @playwright/mcp.
- Runs where you are. It needs Node.js 18 or newer and an MCP client; the README names VS Code, Cursor, Windsurf, Claude Desktop, Goose, Grok and Junie among others.
- Your browser choice. It can drive Chrome, Firefox, WebKit or Edge, headed by default; --headless turns the window off.
- Profiles. A persistent profile by default, so logins survive between sessions; --isolated keeps it in memory, and a browser extension connects to tabs you already have open.
How to set it up.
The README's standard config works in most clients, including Cursor, Windsurf and Claude Desktop. Claude Code, Codex and VS Code also have a one-line install.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}claude mcp add playwright npx @playwright/mcp@latestcodex mcp add playwright npx "@playwright/mcp@latest"code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'Options go in the args list, for example --headless, --isolated or --caps=testing. It can also run as a standalone HTTP server with --port, or from Microsoft's Docker image, which supports headless Chromium only.
The tools it gives the agent.
The core set is always on. These are the ones an agent reaches for most; the README lists a few more, such as hover, drag, file upload and dialogs.
| Tool | What it does |
|---|---|
| browser_navigate | Navigate to a URL. |
| browser_snapshot | Capture an accessibility snapshot of the current page; the README calls it better than a screenshot. |
| browser_click | Click an element, by its reference from the snapshot or a selector. |
| browser_type, browser_fill_form | Type into an editable element, or fill several form fields at once. |
| browser_select_option, browser_press_key | Choose from a dropdown; press a key. |
| browser_wait_for | Wait for text to appear or disappear, or for time to pass. |
| browser_take_screenshot | A screenshot to look at. Actions still come from the snapshot. |
| browser_console_messages, browser_network_requests | The page's console messages and the network requests since it loaded. |
| browser_evaluate | Evaluate JavaScript on the page or an element. |
| browser_tabs | List, create, close or select tabs. |
| browser_run_code_unsafe | Run a Playwright snippet. The README labels it RCE-equivalent. |
Further groups are opt-in. You turn them on with --caps, for example --caps=testing,devtools.
| Group | --caps value | What it adds |
|---|---|---|
| Network | network | Mock requests matching a URL pattern, or switch the browser offline. |
| Storage | storage | Read and set cookies, local storage and session storage; save storage state for reuse. |
| DevTools | devtools | Traces, video, and recording your own actions as Playwright code. |
| Coordinate-based | vision | Mouse clicks, drags and scrolls at x, y positions. |
| Save the page as a PDF. | ||
| Test assertions | testing | Verify that an element, text, list or value is on the page, and generate a locator for a test. |
| Configuration | config | Read the final resolved config. |
Security, in its own words.
The README is plain about this: "Playwright MCP is not a security boundary." It points to the MCP security best practices for securing a deployment.
- Origin lists are not a fence. The allowed and blocked origin options each carry the note that they do not serve as a security boundary and do not affect redirects.
- One tool runs arbitrary code. browser_run_code_unsafe executes JavaScript in the server process, which the README calls RCE-equivalent.
- Files stay in the workspace by default. File access is limited to the workspace roots and file:// pages are blocked unless you pass --allow-unrestricted-file-access.
- The profile keeps logins. With the default persistent profile, whatever the browser is signed in to, the agent can use.
MCP or CLI for a coding agent.
The README itself raises this. "If you are using a coding agent, you might benefit from using the CLI+SKILLS instead." Its reason is context: "CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context." It keeps MCP for "specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure," such as exploratory automation or long-running autonomous workflows.
Either way the shape is the same: the agent drives, step by step, and decides for itself what it saw.
Chrome DevTools MCP, the other one people search for.
Chrome DevTools for agents (chrome-devtools-mcp), published by the ChromeDevTools organization on GitHub, lets a coding agent "control and inspect a live Chrome browser." Its focus is debugging and performance: it records performance traces and extracts insights, lists network requests and console messages with source-mapped stack traces, takes screenshots, and automates input through Puppeteer. Its tool reference also covers Lighthouse audits and heap snapshots. It is Apache-2.0.
{
"mcpServers": {
"chrome-devtools": {
"command": "npx",
"args": ["-y", "chrome-devtools-mcp@latest"]
}
}
}claude mcp add chrome-devtools --scope user npx chrome-devtools-mcp@latest- It officially supports Google Chrome and Chrome for Testing only.
- Google collects usage statistics by default; --no-usage-statistics turns that off.
- Performance tools may send trace URLs to Google's CrUX API; --no-performance-crux turns that off.
Reach for it when the question is why a page is slow or what threw in the console. Reach for Playwright MCP to drive flows, in more than one browser engine.
A browser to drive, or a verdict.
Both servers above give the agent a browser. Testorim's MCP server works the other way round: the agent describes the test, Testorim runs it on its own browsers, and the agent gets the result.
| Question | Playwright MCP | Testorim MCP |
|---|---|---|
| What the agent gets | Tools to drive a browser: navigate, click, type, read the page | One run_test call that returns a verdict |
| Who decides pass or fail | The agent, from what it reads; opt-in verify tools help | Testorim's run: checks on each step, then a written report |
| When a step fails | The agent works out why | Each failed step says whether the app or the test was at fault |
| Where the browser runs | Your machine, or a server you run | Testorim's hosted browsers |
| Reaches localhost | Yes | No: needs a public address, such as a preview deployment or a tunnel |
| Evidence | Snapshots and screenshots; traces and video with --caps=devtools | Video, Playwright trace, final screenshot and a written report |
| Running a check again | The agent drives it again | Saved tests replay their steps without planning them again |
| License and price | Open source, Apache-2.0, free | Paid hosted service after a 3-day trial with a card; the CLI is MIT |
Playwright MCP is the better choice when
- the site only runs on your machine or a private network, which Testorim cannot reach;
- you want to explore or debug a page step by step and see what the agent sees;
- you want Playwright code out of the session, from its locator and action-recording tools;
- you need it free and open source;
- the agent should work in your own signed-in browser, through the extension.
A verdict fits better when
- the question is whether sign-up still works, and the agent should get an answer rather than decide one;
- you want each failure attributed, so the agent fixes the app and not the test;
- a person should be able to check the result later from a video and a trace;
- the same check should run the same way again, from the agent, from CI or on a schedule.
They work side by side. Both are ordinary MCP servers, so one agent can have both: Playwright MCP against the dev server while it writes the change, Testorim against the preview deployment before the pull request merges.
Quick answers
What is Playwright MCP?
Playwright MCP is Microsoft's Model Context Protocol server for Playwright. It gives an AI agent browser tools such as navigate, click, type and snapshot, and lets the agent read pages as structured accessibility snapshots instead of screenshots.
How do I install Playwright MCP in Claude Code?
Run claude mcp add playwright npx @playwright/mcp@latest. Other clients take the README's standard config, which starts the server with npx @playwright/mcp@latest. It needs Node.js 18 or newer.
Is Playwright MCP free?
Yes. It is open source under the Apache-2.0 license and runs on your own machine.
Can Playwright MCP run test assertions?
With --caps=testing it adds tools that verify an element, text, list or value is on the page, and one that generates a locator. The agent still chooses what to check, when, and what a result means.
Is Playwright MCP a security boundary?
No. Its README says so directly, and says the same of its allowed and blocked origin options, which also do not affect redirects. It points to the MCP security best practices for securing a deployment.
Playwright MCP or Chrome DevTools MCP?
Playwright MCP is built around driving pages through the accessibility tree and can run Chrome, Firefox, WebKit or Edge. Chrome DevTools MCP is built around debugging and performance in Chrome: traces, network, console, Lighthouse audits and memory. Neither runs a whole test and returns a verdict on it; that is the gap a hosted runner such as Testorim fills.
Sources, checked September 2026
Every claim about another product on this page comes from that vendor's own site or documentation. Prices and features change; check the vendor's page before you decide.
- Playwright MCP, README: github.com/microsoft/playwright-mcp
- Playwright MCP, license: github.com/microsoft/playwright-mcp/blob/main/LICENSE
- Playwright CLI, linked from the README: github.com/microsoft/playwright-cli
- MCP security best practices: modelcontextprotocol.io/docs/tutorials/security/security_best_practices
- Chrome DevTools MCP, README: github.com/ChromeDevTools/chrome-devtools-mcp
- Chrome DevTools MCP, client setup: github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/client-configurations.md
- Chrome DevTools MCP, tool reference: github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/docs/tool-reference.md
- Chrome DevTools MCP, license: github.com/ChromeDevTools/chrome-devtools-mcp/blob/main/LICENSE
- Testorim, MCP server: testorim.com/mcp
- Testorim, pricing: testorim.com/pricing
Keep reading.
Testorim MCP server
Six tools, setup for each agent, and what a verdict means.
Playwright alternatives
Eight tools compared, for teams leaving Playwright itself.
No-code QA vs Playwright
Where a described flow beats a written one, and where it does not.
AI browser testing
What happens inside a run: planning, the browser, and the report.