🔗 View on GitHub: microsoft/playwright-mcp
🚀 Quick Installation
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright.
Standard Config
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}Claude Code
claude mcp add playwright npx @playwright/mcp@latestWhat It Does
This MCP server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
- ⚡ Fast and lightweight — Uses Playwright's accessibility tree, not pixel-based input
- 🤖 LLM-friendly — No vision models needed, operates purely on structured data
- 🎯 Deterministic — Avoids ambiguity common with screenshot-based approaches
Key Capabilities
Core Automation
browser_navigate— Navigate to URLsbrowser_click— Click elementsbrowser_type— Type text into fieldsbrowser_fill_form— Fill multiple form fieldsbrowser_snapshot— Capture accessibility snapshotsbrowser_take_screenshot— Take screenshots
Advanced Features (Opt-in)
--caps=network— Network mocking and route management--caps=storage— Cookie and storage management--caps=devtools— Tracing and video recording--caps=vision— Coordinate-based interactions--caps=pdf— PDF generation--caps=testing— Test assertions and locators
Example Usage
"Navigate to example.com and click the login button"
"Fill in the form with email [email protected] and password secret"
"Take a screenshot of the current page"
"Get the accessibility snapshot of the page"Configuration Options
| Option | Description |
|---|---|
--browser |
chrome, firefox, webkit, msedge |
--headless |
Run browser in headless mode |
--viewport-size |
Set viewport size (e.g., 1280x720) |
--device |
Emulate device (e.g., "iPhone 15") |
--isolated |
Keep browser profile in memory only |
Requirements
- Node.js 18 or newer
- VS Code, Cursor, Claude Desktop, or any MCP client
📚 Playwright Docs | 🐛 Report Issues