# microsoft/playwright-mcp [Verified] [Health: Active]

**Category:** 📂 Browser Automation  
**Repository:** https://github.com/microsoft/playwright-mcp  
**GitHub Stars:** 38702  
**npm Downloads (last month):** 24354243  
**Views:** 8  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/microsoft-playwright-mcp

## Description
Official Microsoft Playwright MCP server, enabling LLMs to interact with web pages through structured accessibility snapshots

## Tools
Capabilities this server exposes over MCP:

- **browser_close** — Close the page
- **browser_resize** — Resize the browser window
- **browser_console_messages** — Returns all console messages
- **browser_handle_dialog** — Handle a dialog
- **browser_emulate_media** — Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.
- **browser_evaluate** — Evaluate JavaScript expression on page or element
- **browser_file_upload** — Upload one or multiple files
- **browser_drop** — 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.
- **browser_find** — 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.
- **browser_fill_form** — Fill multiple form fields
- **browser_press_key** — Press a key on the keyboard
- **browser_type** — Type text into editable element
- **browser_navigate** — Navigate to a URL
- **browser_navigate_back** — Go back to the previous page in the history
- **browser_network_requests** — Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.
- **browser_network_request** — 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.
- **browser_run_code_unsafe** — Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.
- **browser_take_screenshot** — Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
- **browser_snapshot** — Capture accessibility snapshot of the current page, this is better than screenshot
- **browser_click** — Perform click on a web page
- **browser_drag** — Perform drag and drop between two elements
- **browser_hover** — Hover over element on page
- **browser_select_option** — Select an option in a dropdown
- **browser_tabs** — List, create, close, or select a browser tab.
- **browser_wait_for** — Wait for text to appear or disappear or a specified time to pass

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

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

## Documentation

## What microsoft/playwright-mcp does

The microsoft/playwright-mcp MCP server exposes Playwright browser automation through the Model Context Protocol. Agents can inspect a page’s accessibility snapshot, locate elements by text or regular expression, and perform actions against referenced nodes. This makes the interaction model based on structured page data rather than pixel coordinates or visual interpretation.

It can navigate to URLs, move backward in browser history, click, hover, drag between elements, select dropdown options, fill forms, type text, press keys, and wait for page state changes. Browser tabs can be listed, created, closed, or selected. The server also supports screenshots, console message retrieval, dialog handling, file uploads, and dropping files or MIME-typed data onto an element.

The tool set includes network request listing and detailed request inspection. Agents can evaluate JavaScript on a page or element, run Playwright code through an explicitly unsafe tool, and inspect or call WebMCP tools registered by the page.

## How it works

The server uses Playwright to control the browser and returns accessibility-oriented page representations to the MCP client. `browser_snapshot` is the primary inspection tool for actions, while `browser_find` searches the current snapshot and returns matching nodes with surrounding context and their paths.

This approach fits exploratory automation, iterative browser workflows, and tasks that need ongoing browser state. It does not require a vision model to identify page controls. The MCP connection allows an agent to combine inspection, action, waiting, and verification steps within one browser session.

## Setup and configuration

The microsoft/playwright-mcp MCP server requires Node.js 18 or newer and an MCP-compatible client. The standard local configuration starts it with `npx`:

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

The repository documents setup paths for clients including VS Code, Cursor, Windsurf, Claude Desktop, and Cline. Cursor can add it from MCP settings or use the equivalent `npx @playwright/mcp@latest` command. Cline’s example uses a local STDIO server configuration and adds `-y` to the `npx` arguments. Claude Desktop uses the standard MCP configuration format.

## Tools and capabilities

Available operations include:

- Navigate, go back, resize the browser, and manage tabs.
- Capture accessibility snapshots or screenshots and search snapshots.
- Click, hover, drag, type, press keys, select options, and fill multiple fields.
- Upload files or drop paths and data onto page elements.
- Handle dialogs, wait for text or time, and read console messages.
- List network requests and retrieve details for an individual request.
- Evaluate page or element JavaScript and run Playwright code.
- List and call WebMCP tools exposed by the current page.

## Limitations and notes

The microsoft/playwright-mcp MCP server is an MCP interface, while the repository notes that Playwright CLI with skills may suit coding-agent workflows where lower token usage is important. MCP is positioned for workflows that benefit from persistent state, introspection, and repeated reasoning over page structure.

`browser_run_code_unsafe` executes arbitrary JavaScript in the Playwright server process and is equivalent to remote-code execution in terms of risk. Use it only when that level of access is acceptable. WebMCP tool output is provided by the page and should be treated as untrusted. Screenshots cannot be used as the action basis according to the tool guidance; use `browser_snapshot` for page actions.

_Full upstream README: https://allmcps.com/mcp/microsoft-playwright-mcp/readme_

