Playwrite MCP Server

Playwright wrapper for MCP (Model Context Protocol). This server enables LLM-powered clients to control a browser for automation tasks.

Local serverstdioGo

What is the Playwrite MCP MCP server?

Playwright wrapper for MCP (Model Context Protocol). This server enables LLM-powered clients to control a browser for automation tasks. Exposed over MCP by the playwrite mcp mcp server, that capability becomes something an assistant can invoke while it works, not something you go and do afterwards.

Its toolset

Everything the assistant can do here goes through one of these:

  • navigate — Go to a specific URL
  • new_page — Create a new browser page with a specific ID
  • switch_page — Switch to a different browser page
  • get_pages — List all available browser pages
  • click — Click on an element using CSS selector
  • type — Type text into an input element
  • wait_for_selector — Wait for an element to appear on the page
  • get_text — Get text content from an element
  • get_page_content — Get the entire page HTML
  • take_screenshot — Capture visual state of the page or element
  • Resources — The server exposes resources for accessing browser screenshots: - Screenshot resource URI: screenshot://{page_id} - Screenshot resources are
  • Prompts — The server provides a prompt to help clients interpret web pages: - interpret-page: Analyzes the current web page content and structure - Optional

Adding it to your client

@modelcontextprotocol/inspector on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Configuration

You will need one environment variable: UV_PUBLISH_TOKEN. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

When to reach for it

Plenty of browser automation servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Playwrite MCP's toolset — navigate, new_page, switch_page and 11 more — is a fair guide to whether it matches your workflow. It is maintained by misanthropic-ai; worth a glance at recent repository activity before you build anything load-bearing on it.

SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.

Caveats

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 14 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Playwrite MCP.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the playwrite mcp mcp server does with a few real requests.

Available tools

ToolWhat it does
navigateGo to a specific URL
new_pageCreate a new browser page with a specific ID
switch_pageSwitch to a different browser page
get_pagesList all available browser pages
clickClick on an element using CSS selector
typeType text into an input element
wait_for_selectorWait for an element to appear on the page
get_textGet text content from an element
get_page_contentGet the entire page HTML
take_screenshotCapture visual state of the page or element
ResourcesThe server exposes resources for accessing browser screenshots: - Screenshot resource URI: screenshot://{page_id} - Screenshot resources are automatically available for all open pages
PromptsThe server provides a prompt to help clients interpret web pages: - interpret-page: Analyzes the current web page content and structure - Optional page_id argument to select which page to interpret - Optional focus argum
ToolsThe server implements a comprehensive set of browser automation tools:
DebuggingSince MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).

How to install the Playwrite MCP MCP server

{
  "mcpServers": {
    "playwrite": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/inspector"],
      "env": {
        "UV_PUBLISH_TOKEN": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
UV_PUBLISH_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • Use Playwrite MCP to navigate.
  • Use Playwrite MCP to new page.
  • Use Playwrite MCP to switch page.

Frequently asked questions

It connects Playwrite MCP to MCP-compatible AI assistants such as Claude and Cursor, exposing 14 tools (navigate, new_page, switch_page, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Playwrite MCP directly.