Playwright MCP: let an AI assistant explore your app, then write the test (Claude Code, Copilot, Cursor) Microsoft's official Playwright MCP server lets AI assistants such as Claude Code, GitHub Copilot and Cursor drive a real browser through structured accessibility snapshots rather than screenshots, so no vision model is needed. The walkthrough covers installation via npx, an explore-then-generate workflow that produces Playwright Test specs using getByRole and getByLabel locators, and how MCP compares with the Playwright CLI and Playwright Test Agents. Playwright MCP is Microsoft's official Model Context Protocol server for Playwright. It gives an AI assistant such as Claude Code, GitHub Copilot or Cursor the tools to drive a real browser: navigate, click, fill forms and read the page. The interesting part for testers: the assistant reads the page through structured accessibility snapshots , not screenshots, so no vision model is needed and it naturally "sees" the roles and accessible names that good Playwright locators are built on. This post walks through installation, a first explore-then-generate scenario, how MCP compares with Playwright CLI and the Playwright Test Agents, and the rules we teach to keep AI-generated tests trustworthy. Node.js is the only prerequisite the server runs with npx . The browser is headed by default, which is handy to watch what the assistant does. Claude Code claude mcp add playwright npx @playwright/mcp@latest VS Code GitHub Copilot agent mode code --add-mcp '{"name":"playwright","command":"npx","args": "@playwright/mcp@latest" }' Cursor and other MCP clients accept the standard JSON configuration: { "mcpServers": { "playwright": { "command": "npx", "args": "@playwright/mcp@latest" } } } Options worth knowing append them after @playwright/mcp@latest : --headless : no visible browser CI machines, containers --isolated : keep the profile in memory, start from a clean session every time --storage-state