Data as of
Playwright MCP Server for Claude Code: Setup & Config
Claude Code: ExecuteAutomation’s Playwright MCP Server lets AI clients automate real browsers, capture screenshots, scrape pages, and generate tests.
What you can do with Playwright in Claude Code
Pick it for Playwright automation with device presets, test generation, and automatic browser setup.
- Test responsive pages using phone and tablet emulation profiles.
- Scrape page content or run JavaScript in a real browser.
Before you start: Playwright in Claude Code
- An MCP-compatible client
- npm/npx tooling
- Playwright browser binaries, installed automatically if missing
This is the documented stdio configuration. HTTP mode uses --port 8931 and requires type: http in the client. The server binds to localhost; the README describes SSH tunneling for remote access.
Playwright Claude Code configuration
Choose Claude Code configuration scope
For Playwright MCP Server, open Project scope: .mcp.json at the repository root. Project JSON: merge into mcpServers; user scope: use the CLI.
Add Playwright MCP Server to Claude Code
Use the mcp-playwright entry below in mcpServers. Keep Playwright MCP Server's documented stdio connection fields and your other Claude Code entries.
Check Playwright MCP Server in Claude Code
Playwright MCP Server: Inspect claude mcp list and /mcp status.
Config file · Project scope: .mcp.json at the repository root
{
"mcpServers": {
"mcp-playwright": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@executeautomation/playwright-mcp-server"
],
"env": {}
}
}
}claude mcp add-json --scope project 'mcp-playwright' '{"type":"stdio","command":"npx","args":["-y","@executeautomation/playwright-mcp-server"],"env":{}}'Playwright tools available to Claude Code
Playwright's stored tool list documents 1 tool; compare it with Claude Code's connected tool list, because the stored list is not a live check.
- playwright_resize
For Playwright's playwright_resize, review the permission request and arguments in Claude Code before approval.
Change browser dimensions or select a device preset and orientation.
Troubleshooting Playwright in Claude Code
- If Playwright MCP Server fails to start, check npx @executeautomation/playwright-mcp-server (Node.js/npm), the working directory, and Claude Code's selected scope; inspect claude mcp list and /mcp.
- Playwright MCP Server uses stdio here: Claude Code must keep the configured process running; protocol output belongs on stdout and diagnostics on stderr.
- Known limitation: HTTP clients must explicitly set their transport type correctly.
- Known limitation: The HTTP service binds locally; remote access needs an additional approach such as SSH tunneling.
- General Claude Code troubleshooting lives in the /clients/claude-code guide.
Playwright MCP Server — details. Claude Code guide