Playwright MCP
MCP serversMicrosoft's official Playwright MCP server: lets your agent open, click through and inspect a web app.
Install
$ claude mcp add playwright npx @playwright/mcp@latest
Works with Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot and any other MCP client.
Update
$ claude mcp add playwright npx @playwright/mcp@latest
npx-launched and pinned to @latest: restarting Claude Code fetches the newest published version.
When to use it
- You want Claude to run your local app in a real browser, click through a flow and report what broke.
- You are debugging a front-end issue and need the page's console messages and structure.
- You want exploratory or self-healing browser testing where persistent browser state helps.
- You need to test across Chromium, Firefox and WebKit.
Commands & flags
- browser_navigate / browser_click
- Open a page and click through it using structured accessibility snapshots.
- browser_console_messages
- Read console output from the page while you debug.
- --headless
- Server flag: run the browser without a window (it is headed by default).
- --browser <browser>
- Server flag: pick chrome, firefox, webkit or msedge.
- --isolated
- Server flag: keep the browser profile in memory instead of on disk.
- --caps=vision,pdf,devtools
- Server flag: switch on extra capabilities such as coordinate-based input or PDF output.
How to use it
This is an MCP server. Register it once with the Claude Code CLI:
claude mcp add playwright npx @playwright/mcp@latest
Then ask Claude to drive your app. It reads the page through Playwright's accessibility tree, so it does not need a vision model. Add flags after the package name to change behaviour, for example --headless or --isolated. Take screenshots when you want to check layout by eye.
Microsoft's README says coding agents may prefer the token-lighter Playwright CLI with skills (see the Playwright CLI entry). Use this MCP server when persistent browser state and rich page introspection matter more than token cost.
Why it earns its place
It is maintained by the Playwright team at Microsoft, so it tracks Playwright itself. Working from the accessibility tree makes actions deterministic and avoids guessing from pixels, which is what lets an agent open your app, follow a flow and catch broken behaviour instead of reading code and hoping.
The tool schemas and page snapshots take context, so a long coding session can feel it. For short browser checks inside a coding task, the CLI route can be cheaper. Do not point it at sites you do not control with a logged-in profile.
Try it
> Open http://localhost:3000, sign up with a test account, click through the checkout and tell me what breaks.