Repolode
microsoft

microsoft/playwright-mcp

A Model Context Protocol server that lets LLM clients drive a real browser through Playwright using structured accessibility snapshots.

Stars
38,397
Forks
3,288
Open issues
0
Last commit
21 hours ago

What is it?

Playwright MCP is a Model Context Protocol server that gives LLM clients browser automation powered by Playwright. Instead of sending screenshots to a vision model, it exposes the page as a structured accessibility snapshot, so the model acts on elements through references from that snapshot or unique selectors.

The server works with MCP clients such as VS Code, Cursor, Windsurf, Claude Desktop, Claude Code, Codex and Copilot, and is launched with npx or run as a Docker container. Browser sessions can use a persistent profile, an isolated in-memory context, or attach to an existing Chrome or Edge instance through a browser extension. Options control the browser, viewport, proxy, origin allow and block lists, output directories and snapshot format.

The tool set covers clicking, typing, drag and drop, file upload, form filling, JavaScript evaluation, console messages, media emulation and in-page search. Optional capabilities add vision coordinate interactions, PDF handling and devtools features. The project notes that it is not a security boundary.

Key features

  • 01Uses Playwright accessibility snapshots instead of screenshots, so no vision model is required.
  • 02Works with a wide range of MCP clients, including VS Code, Cursor, Claude Desktop and Codex.
  • 03Supports persistent, isolated, and existing-browser (via extension) sessions.
  • 04Provides tools for clicking, form filling, file upload, drag and drop, and JavaScript evaluation.
  • 05Offers a JSON config file and many command-line options for browser, network and output settings.

Use cases

  • Letting an AI coding agent open a web app, check its state and verify changes.
  • Exploratory testing or self-healing test workflows driven by an LLM.
  • Automating logged-in browser tasks with a persistent or attached browser profile.
  • Running headless browser automation for agents inside a Docker container.

Quick start

  1. 1

    Add the standard config to your MCP client (runs via npx)

    npx @playwright/mcp@latest
  2. 2

    Install the Playwright MCP server with Claude Code

    claude mcp add playwright npx @playwright/mcp@latest

Things to know

  • Requires Node.js 18 or newer.
  • Designed for MCP clients, so it needs an MCP-compatible tool to be useful.
  • The README notes that a CLI with skills may be more token-efficient for coding agents.

Topics

FAQ

What is playwright-mcp?
A Model Context Protocol server that lets LLM clients drive a real browser through Playwright using structured accessibility snapshots. Playwright MCP is a Model Context Protocol server that gives LLM clients browser automation powered by Playwright. Instead of sending screenshots to a vision model, it exposes the page as a structured accessibility snapshot, so the model acts on elements through references from that snapshot or unique selectors.
Is playwright-mcp free to use? What license does it have?
playwright-mcp is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is playwright-mcp still maintained?
Actively maintained. The last commit to playwright-mcp was on Oct 19, 2026.
What can I use playwright-mcp for?
Letting an AI coding agent open a web app, check its state and verify changes. Exploratory testing or self-healing test workflows driven by an LLM. Automating logged-in browser tasks with a persistent or attached browser profile. Running headless browser automation for agents inside a Docker container.
How do I install playwright-mcp?
Add the standard config to your MCP client (runs via npx): npx @playwright/mcp@latest Install the Playwright MCP server with Claude Code: claude mcp add playwright npx @playwright/mcp@latest
Where can I get playwright-mcp?
The source code and installation instructions are on GitHub: https://github.com/microsoft/playwright-mcp

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects