cursor mcpindependent directory
Playwright logo

Servers / Playwright

Install Playwright MCP in Cursor

Microsoft · Local stdio · None

Direct answer

Playwright MCP runs locally. In ~/.cursor/mcp.json add a playwright server with command npx and args ["-y", "@playwright/mcp@latest"]. Save, accept Cursor's stdio trust warning, and restart. You do not need an API key. The agent then gets browser tools in that workspace.

ProviderMicrosoft
Classificationofficial
TransportLocal stdio
AuthNone

Cursor mcp.json

Paste this into ~/.cursor/mcp.json (global) or.cursor/mcp.json (this repo). Merge it with servers you already have. Primer: how Cursor loads MCP.

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

Source: Microsoft Playwright MCP.

What it is

Playwright MCP is Microsoft's browser MCP. It launches Playwright from your machine over stdio. Cursor can then open pages, read accessibility snapshots, click, type, and take screenshots. That is how you check a UI the agent just wrote, instead of asking it to imagine the DOM.

The problem it solves

Cursor can edit the React tree. It cannot see the running app unless something opens a browser. Playwright is that something. It is also the usual pick when a remote HTTP MCP is not enough because the page is localhost.

Install steps

  1. Require Node. npx has to work on your PATH. Node 18 or newer is enough.
  2. Add the stdio server. Paste the playwright command block into mcp.json. This is a local server, so Cursor will warn that it runs with your user privileges. Only continue if you trust @playwright/mcp.
  3. Restart and try a page. After reload, ask Cursor to open http://localhost:8080 and describe the heading. First run may download browsers.

A prompt that uses it

Start the dev server if it is not running, open the home page in Playwright, and tell me whether the H1 is visible without horizontal scroll at 390px width.

If it will not connect

If the server never starts, npx is missing or blocked from the network. If tools appear but the browser does not, the first Playwright download may still be running. Cursor must be allowed to spawn processes; sandboxed or remote-SSH setups often break stdio MCPs.

FAQ

Is Playwright MCP remote?

The install this page documents is local stdio via npx @playwright/mcp@latest. Microsoft also publishes other deploys; Cursor users usually run it on the same machine as the IDE.

Do I need an API key?

No.

Why does Cursor warn me before install?

Stdio servers execute as you. The warning is the same for every local MCP, not specific to Playwright.

Can it hit production sites?

Yes, if the machine can reach them. Treat that like giving the agent a logged-in browser.