Playwright MCP
Lets your AI agent control a web browser through Playwright: open pages and interact with them using page structure, not screenshots.
39k stars on GitHubby MicrosoftLicense Apache-2.0Updated 18 days ago
How to install
This MCP is local: it runs on your computer.
It works in apps installed on your PC (Claude Desktop, Claude Code, Cursor, VS Codeβ¦). Choose your app:
Paste in the terminal:
claude mcp add playwright -- npx -y @playwright/mcp
Ready! Now test it
Restart the app and paste one of these requests in the chat:
Open our pricing page and tell me what plans it lists
Go through the sign-up form on my site and tell me if any step breaks
What it is
This server connects your AI agent to a browser driven by Playwright. Instead of looking at screenshots, the agent reads a structured snapshot of each page (the accessibility tree), so it does not need a vision model. You can use it to explore sites, automate steps and test web pages.
What it can do
- Read pages as structured accessibility snapshots
- Interact with web pages from your AI client
--allowed-hosts: limit which hosts the server may serve from--allowed-origins: list trusted origins the browser may request--allow-unrestricted-file-access: allow files outside the workspace
When to use
- βΊWhen you want your agent to explore a website and report what it finds
- βΊWhen you need self-healing or exploratory browser tests
- βΊWhen you want a long-running automation that keeps one browser session open
What you need
Skills that pair well
MCP or skill?
The MCP gives the agent the hands. The skill teaches the right way to use them. Together, the result is better and uses fewer tokens.
agent-browserLets your agent open websites, fill in forms, click buttons, take screenshots, and pull data from web pages on your behalf.ego-browserLets your agent open websites, click buttons, fill forms, take screenshots, and pull data from web pages using the ego-browser tool.dev-browserLets your agent control a real Chrome browser to open pages, fill forms, click buttons, take screenshots and collect data from websites.Frequently asked questions
Is it free?
The readme does not mention any price and the server runs locally through npx. You only need Node.js and an MCP client.
Does it need screenshots or a vision model?
No. It uses Playwright's accessibility tree and works on structured data only.
Which clients does it work with?
VS Code, Cursor, Windsurf, Claude Desktop, Claude Code, Goose, Grok, Junie, Codex, Copilot, Cline and other MCP clients.
How do I install it?
Add a server that runs npx with @playwright/mcp@latest to your client's MCP config. For Claude Code, run: claude mcp add playwright npx @playwright/mcp@latest.
Is there a lighter alternative for coding agents?
The readme points to Playwright CLI with SKILLS, which it says uses fewer tokens. The MCP server suits long-running loops that need a persistent browser.
Can I limit which sites it visits?
You can pass options such as --allowed-hosts and --allowed-origins. The readme notes that allowed-origins is not a security boundary.
If it does not work
- βΊCheck that Node.js 18 or newer is installed and that npx works in a terminal.
- βΊRestart your MCP client fully after adding the server to the config.
- βΊIf a file or host is blocked, review the --allowed-hosts and file access options in the configuration.
5 new skills a week. 1 minute to read.