Third-party toolUpdated 2026.11.16

Playwright MCP Setup: Claude Code, Codex, Cursor and Fixes

Playwright MCP installation and getting started: client setup or a local workflow, three practical examples, tested findings, common errors, costs and alternatives.

Aaron recommends Open official GitHub

Playwright MCP gives an AI client browser tools for navigating pages, inspecting snapshots and interacting with controls. It is useful for website checks and repeatable browser tasks. Configure a client first, then verify a small read-only task before asking it to change data on a live site.

Install and choose a working environment

Tool version 0.0.85. Documentation checked 2026-11-16. The upstream source snapshot and installed package are pinned separately; the snapshot is not claimed to be the package’s release commit.

node --version
npx -y @playwright/mcp@0.0.85 --help

These settings use the officially documented stdio configuration format. They are documentation-based and were not tested inside the three client apps. Tool version: 0.0.85; client documentation checked 2026-11-16 (rolling docs, no fixed client release claimed).

Claude Code

claude mcp add --transport stdio playwright-mcp -- npx -y @playwright/mcp@0.0.85
claude mcp get playwright-mcp

Open /mcp in Claude Code and verify the server and discovered tools.

Claude Code official MCP configuration

Codex

codex mcp add playwright-mcp -- npx -y @playwright/mcp@0.0.85
codex mcp list

Start a fresh session and check the server’s tools before running the examples.

Codex official MCP configuration

Cursor

Merge this entry into the project’s .cursor/mcp.json; preserve other entries. Enable it in Cursor’s MCP settings and inspect the tool list.

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

Cursor official MCP configuration

On Windows, if npx fails to launch, use command cmd with args beginning /c, npx, then the same arguments. For example, the CLI launch portion becomes -- cmd /c npx -y <the pinned package above>. Do not change package versions while troubleshooting.

Three practical uses

1. Inspect a page before summarizing

Open https://example.com/, take a current browser snapshot, and report the page title, heading and visible links. Do not sign in or submit anything.

Expected: a response that follows the stated scope and exposes the requested source or tool result. Verify those references before acting.

2. Check a navigation path

On my local test site, snapshot the page, follow the Documentation link, then verify the URL, page title and main heading. Refresh snapshots after navigation.

Expected: a response that follows the stated scope and exposes the requested source or tool result. Verify those references before acting.

3. Exercise validation in a test form

Use only my local test form: submit empty required fields, capture the visible validation messages, then retry with test data. Report the before/after state.

Expected: a response that follows the stated scope and exposes the requested source or tool result. Verify those references before acting.

What our tests established

The isolated 0.0.85 run read five rows, followed a known link and checked the destination URL, title and content. Invalid references and obsolete arguments failed. This validates that fixture, not arbitrary sites, login flows or a live session in all three clients.

Tests were run by Codex on synthetic data; no claim of the owner personally testing or reviewing this guide. Examples added above are documentation-based unless included in that recorded scope.

Common errors and fixes

A snapshot reference no longer exists

Take a new snapshot after navigation or DOM changes, then use its current reference.

Tool arguments fail validation

The recorded 0.0.85 tool accepted target and rejected the older element/ref shape. Inspect the current schema.

Browser executable is unavailable

Verify the browser executable and Linux dependencies. Use the documented headless option on machines without a display.

Limits, costs and license

Apache-2.0. The package has no separate usage fee; your AI client or model can cost money. Logins, CAPTCHAs and changing layouts still affect reliability. Prefer ordinary Playwright tests for deterministic regression suites.

When to choose an alternative

  • For content extraction rather than interactive clicking:Crawl4AI。

  • For lightweight static-HTML extraction:Trafilatura。

FAQ

How do I add Playwright MCP to Claude Code?

Use the stdio setup below, check /mcp, then request one snapshot.

Is this a browser or an MCP server?

It is an MCP server that launches or connects to a browser and exposes browser tools.

Does it require Claude?

No. Other compatible MCP clients, including Codex and Cursor, can launch it.

Official sources

For content extraction, compare Crawl4AI's web workflow. If you only need article text, inspect Trafilatura's text extraction before choosing browser interaction.

Subscribe to AI tool picks and practical advice

Get worthwhile tool picks, test findings and important updates in your inbox.

Get a monthly-updated list of AI tools and Skills right away. We email when there are worthwhile tool picks, test findings or important updates. Unsubscribe anytime. Privacy

Almost done: check your inboxClick the button in the confirmation email and you will get the download link for the tool list. If you do not see it, check your spam or Promotions folder.

Or follow us on: