Playwright MCP Server

Official

Use Microsoft’s Playwright MCP server to navigate pages, inspect accessibility snapshots, fill forms and capture browser screenshots.

Local serverstdioTypeScriptApache-2.0★ 21.0k

What is the Playwright MCP Server?

The Playwright MCP server lets an assistant operate a browser through Microsoft’s Playwright tools. It reads structured accessibility snapshots to identify page controls, then uses tools to navigate, click, type or inspect the result. Screenshots are available when the visual appearance matters.

Test a complete browser journey

A useful first task is to open a staging page, follow a navigation path and check the resulting page. Include the starting URL, expected text and stopping point. For a form, inspect the fields before entering values and check the confirmation afterward. These observations can help reproduce a problem; they do not replace assertions in a maintained test suite.

Choose the browser session

Install the npm package with Node.js 18 or later and register it as a stdio server. Playwright opens a headed browser by default; add --headless to hide the window. The --isolated option keeps the session profile in memory, which is useful for an independent test run. The repository documents persistent profiles, extensions and remote connections separately.

Setup and tool documentation. Explore related MCP servers.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
browser_navigateOpen a URL in the browser.
browser_snapshotRead the current accessibility snapshot.
browser_clickClick an identified page element.
browser_fill_formFill several form fields.
browser_take_screenshotCapture the browser view.

How to install the Playwright MCP Server

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

Remove --isolated if you need the documented persistent browser profile.

Configuration

Node.js 18 or later. The browser installation and session options are documented in the Microsoft README.

Example prompts to try

  • “Open our staging homepage and check whether the pricing link reaches the expected page.”

Frequently asked questions

No. The documented default is a headed browser. Add --headless when you want a headless session.