Playwright MCP
Playwright MCP is a fast, lightweight server providing browser automation via structured accessibility snapshots using Playwright. It enables LLMs to interact with web pages deterministically without vision models or screenshots.
How to Install and Use Playwright MCP
Playwright MCP is a special server that helps computers control web browsers in a smart way. It uses Playwright’s accessibility tree instead of pictures or vision models. This means it works fast and is easy for language models to use. Here’s how you can install and start using Playwright MCP.
What You Need Before Installing
Before starting, make sure you have Node.js version 18 or newer installed on your computer. You will also need one of the supported MCP clients like VS Code, Amp, or Claude Desktop. These are the tools that talk to Playwright MCP.
Installing Playwright MCP with a Simple Configuration
Most tools use a similar setup to install Playwright MCP. The easiest way is to run the server using the Node.js package runner npx. The standard config looks like this:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
You add this config in your MCP client tool’s settings. For example, in VS Code, you can add the above JSON to your settings. Or you can run a command in your terminal to install it.
Installing in Popular MCP Clients
Here are some quick examples for different tools:
-
Amp (VS Code extension or CLI)
Add this insettings.jsonor use the CLI:amp mcp add playwright -- npx @playwright/mcp@latest -
Claude Code CLI
Run:claude mcp add playwright npx @playwright/mcp@latest -
Copilot CLI
Run interactively with:/mcp addor add this in your config file:
{ "mcpServers": { "playwright": { "type": "local", "command": "npx", "args": ["@playwright/mcp@latest"] } } } -
Goose Extension in Browser
Add custom extension with command:npx @playwright/mcp -
VS Code CLI
Run to add Playwright MCP server:code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
Running Playwright MCP Server with Options
You can also add extra options when running Playwright MCP inside "args". For example, to run the server with a headless browser and isolated profile:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--headless",
"--isolated"
]
}
}
}
These options control the browser type, permissions, user profile, and other settings.
Using Playwright MCP Standalone or with Docker
If you want to run Playwright MCP by itself on a server or in a container:
-
Start the server on port 8931:
npx @playwright/mcp@latest --port 8931 -
Then connect your MCP client to:
{ "mcpServers": { "playwright": { "url": "http://localhost:8931/mcp" } } } -
Or use Docker to run the official Playwright MCP image:
docker run -i --rm --init --pull=always mcr.microsoft.com/playwright/mcp
Summary
Playwright MCP is easy to install with npx @playwright/mcp@latest. Add it to your tool’s MCP servers settings or run it standalone with options like --headless. Many MCP clients support it through simple CLI commands or JSON configs. You can also run it with Docker for more advanced setups. Just make sure you have Node.js 18+ before you start. This setup lets you automate browsers quickly and reliably using Playwright MCP’s powerful tools.