+40
日增长
+322
周增长
39,685
stars
3,442
forks
149
watchers
881
prs
946
issues
75
releases
README
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, Grok, Junie or any other MCP client
Getting started
First, install the Playwright MCP server with your client.
Standard config works in most of the tools:
js
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
Amp
Add via the Amp VS Code extension settings screen or by updating your settings.json file:
json
"amp.mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
Amp CLI Setup:
Add via the amp mcp add command below
bash
amp mcp add playwright -- npx @playwright/mcp@latest
Antigravity
Add via the Antigravity settings or by updating your configuration file:
json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
Claude Code
Use the Claude Code CLI to add the Playwright MCP server:
bash
claude mcp add playwright npx @playwright/mcp@latest
Claude Desktop
Follow the MCP install guide, use the standard config above.
Cline
Follow the instruction in the section Configuring MCP Servers
Example: Local Setup
Add the following to your cline_mcp_settings.json file:
json
{
"mcpServers": {
"playwright": {
"type": "stdio",
"command": "npx",
"Top issues
#1864`browser_close` ("Close the page") closes all open tabs, not only the current one0 comments · 2026-11-14#1861docs: README documents wrong/unsupported PLAYWRIGHT_MCP_* env vars (including PLAYWRIGHT_MCP_NO_SANDBOX)0 comments · 2026-11-13#1860Verity — an independent bench record for the reference implementation0 comments · 2026-11-13
Latest release
v0.0.85 v0.0.85 2026-11-09✨ Highlights - 🌙 Keep the browser in the background (microsoft/playwright42973) — connecting through the extension activated the tab and focused the browser window, taking the screen from the app you were working in. Pass --background alongside --extension (config background: true, env PLAYWRIGHT_MCP_BACKGROUND=1) to leave the connected tab inactive and its window unfocused, and to open the client's new tabs in the background. With PLAYWRIGHT_MCP_EXTENSION_TOKEN set, the connect page opens in the background too (Chrome 158.0.8127.2 or later, with the browser already running). Requires exten