# Playwright

> Official Microsoft browser automation across Chromium, Firefox, and WebKit.

[Canonical HTML page](https://top-mcps.com/mcp/playwright) · [server.json](https://top-mcps.com/mcp/playwright.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

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

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
claude mcp add playwright -- npx -y @playwright/mcp@latest
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

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

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "playwright": {
      "command": "npx",
      "args": [
        "-y",
        "@playwright/mcp@latest"
      ]
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

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

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

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

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "-y",
            "@playwright/mcp@latest"
          ]
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.playwright]
command = "npx"
args = [
  "-y",
  "@playwright/mcp@latest",
]
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "playwright": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@playwright/mcp@latest"
        ]
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Apps directory`

Playwright doesn't ship a hosted HTTPS endpoint today. ChatGPT supports remote MCP servers only — to use this server in ChatGPT you'll need to deploy it to a public HTTPS URL first (e.g. via Cloudflare Workers or Vercel) or wait for an official remote build.

```none

```

## At a glance

- **Maintainer:** Microsoft
- **Transport:** stdio
- **Auth model:** None
- **Required secrets:** None
- **Supported clients:** Claude, Cursor, VS Code, Any MCP-compatible client
- **License:** Apache-2.0
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-05-26
- **GitHub stars:** 33,036 (fetched 2026-05-26T10:50:22.804Z)
- **Score:** 94/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/microsoft/playwright-mcp

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `browser_navigate` | Navigate to a URL. | `url: string` | network |
| `browser_click` | Click an element. | `selector: string` | exec |
| `browser_type` | Type text into an input. | `selector: string, text: string` | exec |
| `browser_screenshot` | Take a screenshot. | `name: string, fullPage?: boolean` | read |
| `browser_evaluate` | Run JavaScript in the page context. | `script: string` | exec |

## Security & scope

- **Access scope:** exec
- **Sandbox:** Spawns a real browser process under the user account. Has full network access; can execute arbitrary JS on pages it visits.
- **Gotchas:**
  - Three browser engines downloaded on first run (~400 MB total) unless pinned.
  - Downloads and uploads default to the user home directory.
  - Auto-wait can mask broken pages — combine with explicit assertions.

## Quick answer

**What it does.** Exposes Playwright's automation surface as MCP tools: navigate, click, type, screenshot, evaluate JavaScript, and assert on page state across three real browser engines.

**Best for:**
- Cross-browser testing
- Auto-wait selector reliability
- Real Firefox or WebKit
- Trace-based debugging
- Headed and headless flows

**Not for:**
- Static-HTML scraping
- Bare-metal speed at scale
- Resource-constrained environments

## Description

The Playwright MCP wraps Microsoft's cross-browser automation framework. Drive Chromium, Firefox, or WebKit headlessly or headed, navigate pages, fill forms, capture screenshots, and run end-to-end assertions with first-class auto-wait so flaky selectors disappear.

## Why it matters

Playwright is the most-installed cross-browser test framework in the JavaScript ecosystem. The MCP version means agents can drive the same browsers your QA team already trusts.

## Key features

- Chromium, Firefox, WebKit
- Auto-wait stability
- Trace viewer
- Network interception
- Multi-tab contexts
- Official Microsoft maintenance

## FAQ

### Does it work with all three browsers out of the box?

Yes — `npx playwright install` runs the first time the MCP launches and downloads bundled builds of Chromium, Firefox, and WebKit. Pin a single engine with `BROWSER=firefox` if you want to save disk.

### How does it compare to Puppeteer for an agent?

Playwright auto-waits for elements to be actionable before clicking, which removes the most common source of agent flake. Puppeteer is fine for Chromium-only flows, but Playwright is the safer default if you are starting fresh.

### Can it record and replay browser sessions?

Yes. Playwright traces capture every action, network request, and DOM snapshot. The MCP exposes a trace mode that the agent can hand back to you as a single archive for post-hoc inspection.

## Changelog

- **2026-05-26** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-02-15** — Initial directory listing.
