Playwright MCP

Microsoft’s official (plus community) Model Context Protocol server wrapping Playwright for coding agents. Drives automation off the accessibility tree rather than raw DOM/CSS selectors or screenshots, which makes interactions deterministic and far less prone to breaking when the UI changes.

Description

21 tools across navigation (navigate, goBack, goForward, reload), interaction (click, fill, select, hover, press, drag, uploadFile), element queries (getElement(s), waitForSelector), assertions (assertVisible, assertText, assertTitle), page state (screenshot, getAccessibilityTree, evaluateScript) and browser management (newPage, closePage). Cross-browser: Chromium, Firefox, WebKit. ~13.7k tokens (6.8% of a 200k context) — the lowest of the three main browser-automation MCPs.

Download or use

npx playwright install
claude mcp add playwright -s user -- npx @playwright/mcp@latest

Free, no subscription; Node.js required locally.

Reasoning for

The default choice for day-to-day E2E testing and test-script generation: cross-browser coverage, deterministic accessibility-tree selectors (fewer flaky tests than CSS/XPath), excellent CI/CD and headless support, and it can generate reusable Playwright test files from natural-language instructions rather than just performing one-off actions. Lowest token footprint of the three browser MCPs, leaving more context for actual code.

Weaker than Chrome DevTools MCP on performance tracing and deep network inspection, and weaker than Claude in Chrome when the task specifically needs your logged-in session rather than a fresh isolated context.

Alternatives considered

Resources


Template: tool