MCP.so
Sign In

Playwright McpFeatured

@microsoft

About Playwright Mcp

Playwright MCP server

Config

Add this server to your MCP-compatible client using the configuration below.

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

Tools

24

Close the page

Resize the browser window

Returns all console messages

Handle a dialog

Evaluate JavaScript expression on page or element

Upload one or multiple files

Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.

Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref.

Fill multiple form fields

Press a key on the keyboard

Type text into editable element

Navigate to a URL

Go back to the previous page in the history

Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.

Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.

Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.

Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.

Capture accessibility snapshot of the current page, this is better than screenshot

Perform click on a web page

Perform drag and drop between two elements

Hover over element on page

Select an option in a dropdown

List, create, close, or select a browser tab.

Wait for text to appear or disappear or a specified time to pass

Overview

What is Playwright MCP?

A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. It enables LLMs to interact with web pages through structured accessibility tree snapshots, bypassing the need for screenshots or visually-tuned models.

How to use Playwright MCP?

Install the server with your MCP‑compatible client (e.g., VS Code, Cursor, Claude Desktop). Use the standard JSON configuration: "command": "npx" and "args": ["@playwright/mcp@latest"]. Detailed setup guides for each client are in the README.

Key features of Playwright MCP

  • Fast and lightweight – uses accessibility tree, not pixel input.
  • LLM‑friendly – no vision models needed.
  • Deterministic tool application – avoids ambiguity of screenshot‑based approaches.
  • Runs on Node.js 18 or newer.
  • Supports a wide range of MCP clients.

Use cases of Playwright MCP

  • Exploratory automation with persistent browser state.
  • Self‑healing tests that iterate over page structure.
  • Long‑running autonomous workflows requiring continuous context.
  • General browser automation driven by language models.

FAQ from Playwright MCP

How does Playwright MCP differ from the Playwright CLI?

The MCP variant is suited for agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure. The CLI + SKILLs approach is more token‑efficient for high‑throughput coding agents.

What are the system requirements?

Node.js 18 or newer is required. No additional runtime dependencies are mentioned.

Which clients can I use with Playwright MCP?

It works with VS Code, Cursor, Windsurf, Claude Desktop, Goose, Junie, Copilot, Gemini CLI, Warp, and many other MCP‑compatible tools. Detailed per‑client installation instructions are provided.

How do I install Playwright MCP?

Run the standard MCP configuration: npx @playwright/mcp@latest. Specific commands for each client (e.g., claude mcp add, code --add-mcp) are documented in the README.

Are there any security or host filtering options?

Yes, you can pass --allowed-hosts <hosts...> to limit which hosts the server can serve from. The environment variable PLAYWRIGHT_MCP_ALLOWED_HOSTS can also be used.

Frequently asked questions

How does Playwright MCP differ from the Playwright CLI?

The MCP variant is suited for agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure. The CLI + SKILLs approach is more token‑efficient for high‑throughput coding agents.

What are the system requirements?

Node.js 18 or newer is required. No additional runtime dependencies are mentioned.

Which clients can I use with Playwright MCP?

It works with VS Code, Cursor, Windsurf, Claude Desktop, Goose, Junie, Copilot, Gemini CLI, Warp, and many other MCP‑compatible tools. Detailed per‑client installation instructions are provided.

How do I install Playwright MCP?

Run the standard MCP configuration: `npx @playwright/mcp@latest`. Specific commands for each client (e.g., `claude mcp add`, `code --add-mcp`) are documented in the README.

Are there any security or host filtering options?

Yes, you can pass `--allowed-hosts <hosts...>` to limit which hosts the server can serve from. The environment variable `PLAYWRIGHT_MCP_ALLOWED_HOSTS` can also be used.

Comments

More Browser Automation MCP servers