MCP servers / Playwright

Playwright MCP server: setup for Claude Code, Claude Desktop and Cursor

Playwright's MCP server lets your AI drive a real browser: open pages, click, type, fill forms, read the page structure and take screenshots. It is the quickest way to have the AI check that a change to a web page actually works.

It mostly reads the page as a structured "accessibility snapshot" rather than looking at pixels, which is what the server's own description recommends over screenshots.

Runs with
npx (Node.js)
Package
@playwright/mcp on npm
Needs
Node.js (for npx) and a supported browser on your machine.
Tools
25 (7 read-only, 18 can change things)
Source
microsoft/playwright-mcp
Last checked
2026-09-20 (server reported version 1.64.0-alpha-1789764292000)

Config for Playwright

Generated by the same code as the free builder, so it matches what you get there. Pick your client, then copy.

Claude Code

Save as .mcp.json in your project root. Claude Code asks you to approve it the first time.

Claude Code config
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

Or add it from a terminal instead (single quotes work in bash, zsh and PowerShell; more on this command):

Terminal command
claude mcp add playwright -- npx @playwright/mcp@latest

Claude Desktop

Merge into claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and restart Claude Desktop.

Claude Desktop config
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

Cursor

Save as .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects.

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

What it can do

These are all 25 tools the server reported when we started it and asked on 2026-09-20. The labels come from the hints each tool declares about itself.

Watch out for

Variations

Headless and isolated

No visible browser window, and nothing saved to disk between sessions. Good for automated checks and for keeping logins from lingering. We started the server with these flags to confirm it accepts them.

Variation: Headless and isolated
{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest",
        "--headless",
        "--isolated"
      ]
    }
  }
}

The same in Claude Code, Claude Desktop and Cursor.

Try asking

Related servers

Building a full setup? Combine this with other servers in the config builder. Trouble connecting? See fixing connection errors.

Open the config builder Get early access to Pro