What it does
playwright-mcp spins up a Playwright-controlled browser and exposes it as an MCP server, giving Claude and Cursor live access to page state. It provides tools to capture screenshots, extract the DOM, record interactions, and execute JavaScript. This lets an AI assistant write Playwright tests with real visual and structural context instead of guessing selectors.
Who it's for
QA engineers, frontend developers, and test automation specialists who use Claude or Cursor to generate Playwright tests and want the AI to see the actual page DOM and visual state instead of working blind.
Common use cases
- Generate Playwright test cases based on live page screenshots and DOM inspection
- Extract reliable selectors from the live DOM instead of asking the AI to guess them
- Record user interactions and convert them into reproducible test scripts
- Debug test failures by capturing page state and running JavaScript validators in-context
Setup pitfalls
- Requires Node.js and Playwright (with Chromium) pre-installed—the server doesn't manage these dependencies
- IDE integration varies: Cursor uses
npx -y playwright-mcp; Claude Desktop requires manual config file edits at~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows) - Browser startup is on-demand and requires explicit approval in your AI tool—you must call
init-browserbefore using page interaction tools - Last commit was 211 days ago; may have compatibility issues with recent Playwright or Node.js versions