Playwright MCP
Microsoft's open-source MCP server that gives AI agents structured browser automation via Playwright's accessibility tree.
Playwright MCP is Microsoft's open-source MCP server that lets AI agents drive a real browser via Playwright. It acts on the accessibility tree rather than screenshots, so interactions are deterministic, token-efficient, and need no vision model — navigation, clicks, forms, tabs, and console/network inspection across Chromium, Firefox, and WebKit.
Playwright MCP is a Model Context Protocol server from Microsoft that lets an AI agent drive a real browser. It is not a standalone app — you register it with an MCP client like Claude Code, and the agent gains a set of tools for navigating pages, clicking, typing, filling forms, and reading results. Under the hood it uses Playwright, the same automation engine that powers Microsoft's end-to-end testing framework.
Its defining choice is to act on the page's accessibility tree rather than screenshots. Each action returns a structured snapshot of elements, their roles, and their text, so the model interacts with semantic targets instead of guessing pixel coordinates. That makes it fast, deterministic, and token-efficient, and means no vision model is required. It is aimed at developers who want an agent that can actually exercise a running web app — reproducing bugs, checking flows, scraping state, or driving QA — instead of only reasoning about source code.
Highlights
- Accessibility-tree based — operates on structured page snapshots (roles, names, text), not pixel screenshots, so interactions are deterministic and cheap on tokens.
- No vision model needed — the agent reads semantic element references and targets them directly; optional
--caps=visionadds coordinate-based clicks when you really need them. - Full browser tool set — navigation, clicks, typing, form fills, drag-and-drop, tab management, file uploads, dialog handling, and console/network inspection.
- Cross-browser — runs Chromium, Firefox, or WebKit (and named Chrome/Edge channels), headed or headless.
- Profile control — a persistent profile by default, so the agent reuses your logged-in state across sessions, or pass
--isolatedfor an ephemeral session that is discarded when the browser closes. - Microsoft-maintained, Apache-2.0 — published as
@playwright/mcpon npm and tracked in the open in themicrosoft/playwright-mcprepo.
In an AI-assisted workflow
Because it is an MCP server, you add it once to your client and every session can reach for it. In Claude Code:
claude mcp add playwright npx @playwright/mcp@latestOr drop it into an MCP config block directly:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}From there the agent can verify its own work — start the dev server, navigate to the page it just changed, click through the flow, and read back the accessibility snapshot to confirm the result. A typical loop: ask the agent to reproduce a reported bug, let it drive the browser to the failing state, then have it write a Playwright test that locks the fix in place.
TIP
Pair it with a testing-focused agent (see test-engineer) so the model knows to write a regression test once it has reproduced an issue in the browser, not just confirm the page loads.
NOTE
The first run downloads the browser binaries via Playwright. If your environment blocks that, install browsers ahead of time with npx playwright install.
Good to know
Playwright MCP is free and open source under Apache-2.0; you run it locally via Node.js (npx @playwright/mcp@latest) and there is no hosted tier or account. It works with any MCP-capable client — Claude Code, the Claude Desktop app, VS Code, Cursor, and others — not just Claude Code.
WARNING
A browser agent can navigate to and act on any site it is pointed at. Run it against your own apps and trusted URLs, pass --isolated to run untrusted pages in an ephemeral profile (the default profile is persistent and retains your login state), and use --allowed-origins / --blocked-origins to limit which origins it can request — note these are best-effort filters, not a hard security boundary, and do not affect redirects.
Frequently asked questions
- What is Playwright MCP?
- Playwright MCP is a Model Context Protocol server from Microsoft that gives an AI agent a full browser tool set — navigating, clicking, typing, filling forms, managing tabs, and reading console/network output. It's built on Playwright and operates on the page's accessibility tree, returning structured snapshots instead of screenshots, so no vision model is needed.
- How do I add Playwright MCP to Claude Code?
- Run claude mcp add playwright npx @playwright/mcp@latest, or add it to an mcpServers config block with command npx and the @playwright/mcp@latest argument. The first run downloads browser binaries via Playwright; if your environment blocks that, run npx playwright install ahead of time.
- Is Playwright MCP free?
- Yes — free and open source under Apache-2.0, published as @playwright/mcp on npm and maintained by Microsoft in the microsoft/playwright-mcp repo. You run it locally via Node.js; there's no hosted tier or account, and it works with any MCP-capable client.
- Is Playwright MCP safe to run?
- A browser agent can act on any site it's pointed at, so run it against your own apps and trusted URLs. Pass --isolated for an ephemeral profile (the default profile persists your logged-in state) and use --allowed-origins / --blocked-origins to limit reachable origins — best-effort filters, not a hard security boundary.
Related
- Claude CodeAnthropic’s official agentic coding tool that runs in the terminal, IDE, and web.
- Test EngineerUse this agent to write and improve automated tests — unit, integration, and edge cases. Examples — adding coverage to an untested module, writing regression tests for a bug, designing a test plan.
- Browser Agent EngineerUse this agent to build, harden, or debug browser-automation agents — web tasks via Browser Use, Stagehand, Skyvern, or Playwright-based stacks. Examples: automate a portal workflow, make a flaky browser agent reliable, add verification and guardrails to web automation, choose between vision and DOM grounding.
- Browser Agents in 2026: Browser Use vs Stagehand vs Skyvern vs Playwright MCPFour ways to give AI a browser — Browser Use, Stagehand, Skyvern, and Playwright MCP compared honestly on control, cost, and reliability for 2026.
- How Computer-Use Agents WorkInside the perception-action loop that lets AI operate real software — screenshots in, clicks out — plus grounding, reliability, and when to use APIs instead.
- The Best MCP Servers in 2026The MCP servers actually worth connecting in 2026 — Context7, GitHub, Chrome DevTools, Playwright, Serena, Exa, Firecrawl, and official vendor servers.
- Chrome DevTools MCPGoogle's official MCP server that gives coding agents a live Chrome — Puppeteer automation plus DevTools network, console, and performance insights.
- StagehandBrowserbase's open-source SDK for browser agents — act, extract, observe, and agent primitives that mix natural language with code-level control.
- Computer UseComputer use is an AI agent operating software through its real interface — reading the screen, moving the cursor, clicking, and typing like a person would.