Playwright MCP Server
Web automation and testing using accessibility tree (no screenshots)
The Playwright MCP Server enables browser automation using the full browser API via Microsoft Playwright. Unlike screenshot-based approaches, it uses the accessibility tree for reliable, structured interactions — making it faster and less prone to hallucination on UI elements.
Installation & Configuration
Add this block to your claude_desktop_config.json (or your agent framework's MCP config file):
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@latest"]
}
}
}
Config file location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Available Tools (6)
browser_navigatebrowser_clickbrowser_typebrowser_screenshotbrowser_wait_forbrowser_evaluate
Use Cases
- E2E testing — have Claude write and run Playwright tests
- UI automation — fill forms, extract data from web apps
- Accessibility audits — use the accessibility tree to analyze UI structure
Source & Documentation
GitHub Repository: https://github.com/microsoft/playwright-mcp
Protocol: Model Context Protocol (MCP) — modelcontextprotocol.io