Playwright MCP guide

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.

Standard config
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"]
    }
  }
}
Claude Code
claude mcp add playwright npx @playwright/mcp@latest
Codex
codex mcp add playwright npx "@playwright/mcp@latest"
VS Code, for GitHub Copilot
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.

ToolWhat it does
browser_navigateNavigate to a URL.
browser_snapshotCapture an accessibility snapshot of the current page; the README calls it better than a screenshot.
browser_clickClick an element, by its reference from the snapshot or a selector.
browser_type, browser_fill_formType into an editable element, or fill several form fields at once.
browser_select_option, browser_press_keyChoose from a dropdown; press a key.
browser_wait_forWait for text to appear or disappear, or for time to pass.
browser_take_screenshotA screenshot to look at. Actions still come from the snapshot.
browser_console_messages, browser_network_requestsThe page's console messages and the network requests since it loaded.
browser_evaluateEvaluate JavaScript on the page or an element.
browser_tabsList, create, close or select tabs.
browser_run_code_unsafeRun 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 valueWhat it adds
NetworknetworkMock requests matching a URL pattern, or switch the browser offline.
StoragestorageRead and set cookies, local storage and session storage; save storage state for reuse.
DevToolsdevtoolsTraces, video, and recording your own actions as Playwright code.
Coordinate-basedvisionMouse clicks, drags and scrolls at x, y positions.
PDFpdfSave the page as a PDF.
Test assertionstestingVerify that an element, text, list or value is on the page, and generate a locator for a test.
ConfigurationconfigRead 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.

Standard config
{
  "mcpServers": {
    "chrome-devtools": {
      "command": "npx",
      "args": ["-y", "chrome-devtools-mcp@latest"]
    }
  }
}
Claude Code
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.

QuestionPlaywright MCPTestorim MCP
What the agent getsTools to drive a browser: navigate, click, type, read the pageOne run_test call that returns a verdict
Who decides pass or failThe agent, from what it reads; opt-in verify tools helpTestorim's run: checks on each step, then a written report
When a step failsThe agent works out whyEach failed step says whether the app or the test was at fault
Where the browser runsYour machine, or a server you runTestorim's hosted browsers
Reaches localhostYesNo: needs a public address, such as a preview deployment or a tunnel
EvidenceSnapshots and screenshots; traces and video with --caps=devtoolsVideo, Playwright trace, final screenshot and a written report
Running a check againThe agent drives it againSaved tests replay their steps without planning them again
License and priceOpen source, Apache-2.0, freePaid 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.

Join the waitlist

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.