MCP Playwright is a Model Context Protocol server that gives an LLM control of a real browser through Playwright. A connected assistant can navigate pages, click and type, take screenshots, scrape page content, execute JavaScript, and generate test code, so you can describe UI and API tests in plain language from clients such as Claude Desktop, Claude Code, VS Code with GitHub Copilot, and Cursor.
The server runs in two modes. Standard stdio mode is used by Claude Desktop, with logs written to a file to keep the JSON-RPC channel clean. HTTP mode starts a standalone server (default port 8931) exposing SSE, message, unified MCP, and health endpoints; it suits VS Code, custom clients, background services, multiple clients sharing one server, and headed browsers on machines without a display. The server binds to localhost only, so remote access goes through an SSH tunnel.
Browser binaries install automatically on first use: when Chromium, Firefox, or WebKit is missing, the server downloads it, shows progress, and retries the request. Version 1.0.10 added device emulation with 143 device presets.
Features
- Browser automation tools: navigate, click, fill, screenshot, scrape, and run JavaScript in a live browser session
- Test code generation: records interactions into Playwright test code
- API testing: exercise HTTP APIs alongside UI flows from natural-language instructions
- Device emulation: 143 presets covering iPhone, iPad, Pixel, Galaxy, and desktop browsers with viewport, user agent, touch events, and pixel ratio; orientation can be switched
- stdio and HTTP transports: stdio for Claude Desktop; HTTP/SSE with a health endpoint for VS Code, custom clients, and remote deployments
- Automatic browser installation: missing Chromium, Firefox, or WebKit binaries are fetched on demand
- Client coverage: Claude Desktop, Claude Code, VS Code and VS Code Insiders, GitHub Copilot agent mode, and any custom MCP client
- Evals: an mcp-eval harness runs the server's tools against an LLM for regression checks
