playwright-mcp
π§MCP ServerOfficialA Microsoft tool that lets Claude open and control a web browser. It reads each page as a clear outline of buttons, links and text, so it works without screenshots.
Installation
claude mcp add playwright-mcp -- npx -y @playwright/mcpClaude Code commands built from the official MCP Registry entry.
What this MCP server does
Overview
Playwright MCP is an MCP server, a small program that gives Claude new tools, built on the Playwright browser automation library. Instead of looking at screenshots, it reads the page's accessibility tree, a structured outline of every button, link and field. Microsoft notes that coding agents may do better with the separate Playwright CLI and skills, which use fewer tokens (the units of text an AI model reads).
Key Features
- Control a browser from Claude using the page structure instead of images, so no vision model is needed.
- Get the same result each time a tool runs, without guessing what a screenshot shows.
- Add it to Claude Code with
claude mcp add playwright npx @playwright/mcp@latest. - Use it in VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client.
- Run it on any machine with Node.js 18 or newer.
Who is this for?
It fits long browser tasks where Claude must keep the same page open, such as exploring a site, tests that fix themselves or long automated workflows. If you mainly want a coding agent to check pages while it works in a large codebase, Microsoft suggests trying the Playwright CLI first.
Summarized by AI from this repo's README. Suggest a better one
README.md
View on GitHub βPlaywright MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
Playwright MCP vs Playwright CLI
This package provides MCP interface into Playwright. If you are using a coding agent, you might benefit from using the CLI+SKILLS instead.
-
CLI: Modern coding agents increasingly favor CLIβbased workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.Learn more about Playwright CLI with SKILLS.
-
MCP: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns.
Key Features
- Fast and lightweight. Uses Playwright's accessibility tree, not pixel-based input.
- LLM-friendly. No vision models needed, operates purely on structured data.
- Deterministic tool application. Avoids ambiguity common with screenshot-based approaches.
Requirements
- Node.js 18 or newer
- VS Code, Cursor, Windsurf, Claude Desktop, Goose or any other MCP client
Getting started
First, install the Playwright MCP server with your client.
Standard config works in most of the tools:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
Add via the Amp VS Code extension settings screen or by updating your settings.json file:
"amp.mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
Amp CLI Setup:
Add via the amp mcp addcommand below
amp mcp add playwright -- npx @playwright/mcp@latest
Use the Claude Code CLI to add the Playwright MCP server:
claude mcp add playwright npx @playwright/mcp@latest
Follow the MCP install guide, use the standard config above.
Follow the instruction in the section Configuring MCP Servers
Example: Local Setup
Add the following to your [cline_mcp_settings.json](https://docs.cline.bot/mcp/configuring-mcp-servers#edi
Playwright MCP: How AI Agents Can Control Your Browser
Playwright MCP Master Class π | Playwright + TypeScript + GitHub Copilot
π Related Resources

1. Introduction End-to-end testing has evolved dramatically, and Playwright stands at the forefront. Playwright offers a full ecosystem empowering developers to write, debug, and maintain tests with s
Test automation has come a long way, from scripted flows to self-healing and now AI-driven testing. With the introduction of Model Context Protocol (MCP),...