Playwright MCP
Playwright
Microsoft's official MCP — LLM controls your local Chromium / Firefox / WebKit through the accessibility tree. More accurate than vision-on-screenshot. The go-to for form-filling, e2e flows, and web scraping.
No token5-min install
Why client-side
Browsers are stateful (cookies, login sessions, tab history). A hub-shared instance would let users see each other's logged-in state — non-starter. The only safe path is local install where your Claude Desktop drives the browser directly via stdio.
Prerequisites
- Node.js ≥ 18 (recommend nvm)
- MCP-capable client: Claude Desktop / Cursor / Continue / Cline / etc.
- macOS / Linux / Windows all supported
Install
Claude Desktop (macOS)
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
}
}
}Cursor
{
"name": "playwright",
"command": "npx -y @playwright/mcp@latest"
}First run
Try this prompt
Open example.com and take a full-page screenshot
Common tools
browser_navigate(url)— load a pagebrowser_snapshot()— accessibility-tree dump of the current page (replaces screenshot for most tasks)browser_click(ref)— click an elementbrowser_type(ref, text)— type into an inputbrowser_take_screenshot()— actual screenshot (for vision models)
Troubleshooting
| Symptom | Fix |
|---|---|
| npx hangs on first run | Playwright downloads ~300 MB of browsers on first install. Wait. |
| macOS: 'unverified developer' | System Settings → Privacy & Security → Allow |
| Tools don't show up | Fully quit Claude Desktop (cmd+Q) and reopen. Validate the JSON. |
| Want persistent login sessions | Add --user-data-dir /Users/yourname/.playwright-profile to args |