Skip to content
Skillpedia
βœ“ Official Β· Microsoft● Free and open sourceπŸ’» LocalπŸ”“ No API keyWeb and browser

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

Node.js 18 or newer and an MCP client such as VS Code, Cursor, Windsurf or Claude Desktop. No account or API key.

Skills that pair well

⭐ Skillpedia MCP Β· freeYour agent finds the right skill on its ownInstall our MCP and your agent searches 15,000+ skills whenever it needs one.Install for free β†’

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.