~/ai_assets_directory_
MCP Server verified · tested by us published by the official vendor 36.9k stars
playwright-mcp.mcp

Playwright MCP

Microsoft's official MCP server for browser automation, driving Playwright through structured accessibility snapshots instead of screenshots, so any MCP client can browse, click and fill forms without a vision model.

Overview

Playwright MCP exposes browser automation capabilities through the Model Context Protocol, built on top of Playwright. Instead of feeding screenshots to a vision model, it hands the agent a structured accessibility snapshot of the page.

How it works

It's fast and lightweight, using Playwright's accessibility tree instead of pixel input; LLM-friendly, since it works purely on structured data with no vision model required; and deterministic, avoiding the ambiguity common with screenshot-based approaches.

It supports a persistent profile (keeps you logged in across sessions, like a regular browser) or an isolated profile per session (nothing persists after the browser closes), plus connecting to an existing browser via the Playwright browser extension. Requires Node.js 18+ and works with VS Code, Cursor, Windsurf, Claude Desktop, Goose, Grok, Junie and other MCP clients.

  1. Register the server with your MCP client using the standard npx @playwright/mcp@latest config.
  2. The agent asks the server to navigate, click, type or take a snapshot.
  3. Playwright executes the action in a real (headed or headless) browser and returns the resulting accessibility snapshot.
  4. Optional capabilities (--caps=vision,pdf,devtools,network,storage,testing) can be opted into for coordinate-based interaction, PDF generation, or test assertions.

Examples

// Standalone HTTP mode, e.g. for headed browsers without a display
npx @playwright/mcp@latest --port 8931
"Go to our staging site, log in as demo@example.com, and tell me what the
dashboard's empty state looks like."
"Open /checkout, fill the form with test data, and report any console errors."

Useful for exploratory automation, self-healing test generation and long-running agentic browsing where the agent needs to reason over page structure, not pixels.

Installation

You need Node.js 18+.

  1. Add the server to your MCP client's config using the block in the sidebar.
  2. Restart your client. It downloads the Playwright browser binaries on first run if they aren't already installed.
  3. Optional: add --caps=vision,pdf,devtools,network,storage,testing for extra capabilities, or run npx @playwright/mcp@latest --port 8931 for standalone HTTP mode.
  4. Ask the agent to open a page and take a snapshot to confirm the browser launches correctly.

Related assets