microsoft /
playwright-mcp
Browser automation server that lets AI assistants drive web pages through Playwright
- 38.5k stars
- 766 stars since 3 Oct
- TypeScript
- Updated today
- Some experience
- Browser & computer use
Language models can't use a web page on their own. This project is a Model Context Protocol (MCP) server that gives any MCP-aware AI client a set of browser tools, built on Playwright, Microsoft's browser automation library.
Instead of sending screenshots, it gives the model an accessibility snapshot of the page: a structured text description of buttons, links, fields and other elements. The model works from that text, so it needs no vision model, and its actions are less ambiguous than guessing from pixels.
The README compares it with Playwright CLI plus SKILLS, a separate project. It says the CLI uses fewer tokens and suits coding agents with limited context. The MCP server fits longer loops that need a persistent browser session and rich page detail, such as exploratory automation or self-healing tests, where token cost matters less.
What it does
Accessibility-tree based
It uses Playwright's structured accessibility snapshots rather than pixel input, which the README describes as fast and lightweight.
No vision model needed
The model works on structured data alone. A vision capability can be switched on with the --caps option if you want it.
Works with many MCP clients
The README gives setup steps for VS Code, Cursor, Claude Code, Claude Desktop, Codex, Copilot, Gemini CLI, Goose, Windsurf, Warp and more. Most use the same npx config.
Browser and connection options
You can choose Chrome, Firefox, WebKit or Edge, connect to an existing browser over a CDP endpoint, and enable extras like PDF and devtools.
Access controls
Options let you allow or block origins and restrict file access to the workspace by default. The README says the origin lists are not a security boundary.
What you could build
- Ask an AI assistant to fill in and submit a web form while you watch.
- Let an agent explore a web app and report what it finds on each page.
- Run self-healing tests where a model adjusts to changed page structure.
- Have an agent read and collect information from sites that need clicking through.
- Connect a local model in LM Studio to a real browser for web tasks.
Get started
Make sure Node.js 18 or newer is installed, then add the server to your MCP client using the standard config, or run the Claude Code command if you use it. The README has per-client instructions for the rest.
claude mcp add playwright npx @playwright/mcp@latestcodex mcp add playwright npx "@playwright/mcp@latest"amp mcp add playwright -- npx @playwright/mcp@latestCommands are copied from the project's README. Read it on GitHub for the full setup.