Playwright: Microsoft’s web testing/automation framework for browser control.

playwright-mcp

microsoft/playwright-mcp: Playwright MCP server

Claude code

Add (for project)

Add the following in $PROJECT/.mcp.json

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest", "--headless", "--no-sandbox", "--isolated"]
    }
  }
}

The commands that claude uses often end up putting config in $HOME which is annoying.

Troubleshooting

point-chrome-to-chromium

Example use case: If you have chromium installed on docker, but you do not have chrome installed at location where playwright is going to look for chrome.

Instead of installing chrome into your Dockerfile you can create a at the location where playwright expects to find chrome to point to chromium by running the following commands.

sudo mkdir -p /opt/google/chrome
sudo ln -s /usr/bin/chromium /opt/google/chrome/chrome
Link to original

Remove

claude mcp remove playwright
Link to original