What Is Playwright MCP Server?

Playwright MCP Server exposes browser automation capabilities to Claude through the Model Context Protocol, enabling agents to navigate pages, fill forms, extract content, and capture screenshots. It is maintained by Microsoft as part of the Playwright project.

Quick Facts

FieldValue
Package@playwright/mcp
Installnpx @playwright/mcp
Compatible withClaude Code, Claude Desktop
Statusactive
GitHubhttps://github.com/microsoft/playwright-mcp

What You Can Do With It

  • Browser automation: Instruct Claude to click elements, navigate URLs, and interact with web pages programmatically without writing Playwright scripts manually.
  • UI testing: Run through user flows and verify page states by having Claude interact with a live browser session and report what it observes.
  • Web scraping: Extract structured content from pages — text, links, table data — by directing Claude to navigate and parse target URLs.
  • Screenshot capture: Capture full-page or element-level screenshots during a session, useful for visual debugging or documentation workflows.

How to Set It Up

Prerequisites: Node.js 18+ installed locally.

Step 1 — Verify the package runs:

npx @playwright/mcp --help
**Step 2 — Configure Claude Desktop** by editing `claude_desktop_config.json` (macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`):

```json
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp"]
    }
  }
}

Step 3 — Configure Claude Code by adding to .claude/mcp.json in your project root, or using the global config:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp"]
    }
  }
}

After saving, restart Claude Desktop or reload Claude Code. The server will launch a browser process on demand when Claude invokes a browser tool.

Works Best With

Playwright MCP Server is compatible with both Claude Code and Claude Desktop. Claude Code is the stronger pairing for automated workflows — scraping pipelines, test scaffolding, or CI-adjacent tasks where you want Claude to generate and validate browser interactions in the same session. Claude Desktop works well for interactive, ad-hoc use cases like exploring a site or capturing screenshots on request.

Known Limitations

  • Browser process lifecycle: Each server session typically manages its own browser context. State does not persist automatically between separate Claude conversations unless the server process stays alive.
  • Authentication: The server does not handle login flows automatically. If a target site requires authentication, you’ll need to set up saved browser state or cookies externally and ensure the server can access them.
  • Headless vs. headed mode: Default behavior is headless. Some sites detect headless browsers and block requests. Check the GitHub repo for flags to run in headed mode if you encounter this.
  • No built-in rate limiting: The server does not throttle requests to target sites. Rapid scraping can trigger bot detection or IP blocks — that responsibility sits with the user.
  • Playwright browser dependencies: On a fresh system, Playwright may need to download browser binaries. Run npx playwright install if you encounter missing browser errors.

Community Resources

This article contains affiliate links. We may earn a commission at no extra cost to you. Learn more.

Share: X