Omniscio

OmniscioGuidesPlaywright MCP

Playwright MCP: giving Claude Code a browser it can drive

A Playwright server gives Claude a real browser: it opens pages, clicks, types, reads what rendered, takes screenshots and saves the output files it produces.

That is a different thing from fetching a page. A fetch returns the HTML; the browser returns what the page looked like after its scripts ran, which is the only way to check a login form, a chart or a layout.

Sources read November 25, 2026. By the Omniscio team. Updated .

What it gives Claude Code

Microsoft's README describes the package in one line: an MCP server that provides browser automation capabilities using Playwright. In a session that means Claude can navigate to a URL, find an element by its role or text, fill a field, press a key, read the visible text, and capture a snapshot or a screenshot.

Ask for what a user would call the thing, a sign in button or a search field, rather than for a CSS selector: the server drives the browser for Claude, so Claude describes the page the way a person would.

Extra capabilities are off unless you ask for them. The README's options table names vision, pdf and devtools, and its tool reference documents four more groups under the same flag: config, network, storage and testing.

The command

The package is @playwright/mcp, run by npx at its latest version. Run this in your terminal, not inside a Claude Code session, from the project folder you want the server registered in:

claude mcp add playwright -- npx @playwright/mcp@latest

Microsoft's README prints the same line without the double dash, which works only while the server takes no flag. Adding one flag to that line is what breaks it: Claude Code reads an option before the double dash as its own, so everything after the dash is where the server's flags belong.

With flags, pick one line: each replaces the bare command above rather than following it.

claude mcp add playwright -- npx @playwright/mcp@latest --headless
claude mcp add playwright -- npx @playwright/mcp@latest --browser chrome --headless
claude mcp add playwright -- npx @playwright/mcp@latest --isolated --caps vision
The flags worth knowing
FlagWhat it does
--headlessRuns the browser in headless mode; the server is headed by default
--browser <name>Chooses the browser or channel: chrome, firefox, webkit or msedge
--isolatedKeeps the browser profile in memory and does not save it to disk
--caps <list>Adds capability groups, comma-separated. The options table names vision, pdf and devtools; the tool reference documents config, network, storage and testing
--config <path>Points at a configuration file instead of the defaults

The same server can run on its own port instead, with npx @playwright/mcp@latest --port 8931 serving http://localhost:8931/mcp, and then registered as a URL: claude mcp add --transport http playwright http://localhost:8931/mcp. The README gives its case: a server started once and connected to from somewhere else, such as a headed browser on a machine with no display, or one launched from an IDE's worker process.

The .mcp.json equivalent

The entry Microsoft's README shows, which is what project scope writes:

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

With a flag, it goes in the same array, where Claude Code does not have to guess:

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

Which scope to use

Local is the default: your configuration, this project only. Project scope writes .mcp.json at the repository root so a team shares one browser setup, and user scope makes it available everywhere.

A browser server is usually a team decision, so project scope is a reasonable default here: the flags that make it work, such as headless on a build machine, are the same for everyone. Where it needs a login, keep it local, because the browser profile holds the session.

A project-scoped server is one Claude Code makes you approve on first load. Inside a session, /mcp shows it and whether it is approved, and claude mcp reset-project-choices clears those answers.

The auth step

There is none: the server runs on your machine and needs no token. That is worth stating because it changes what the browser can reach. It carries whatever session the profile holds, so a site you are signed in to in that profile is a site Claude can act on.

Use --isolated for a run that should start from a clean browser, and the default profile when the job is to check something behind a login you have already done by hand.

Confirm it connected

claude mcp list
claude mcp get playwright

The list prints a health status beside the name, such as ✔ Connected, ! Needs authentication or ✘ Failed to connect, plus configuration statuses such as ⏸ Pending approval for a project server nobody has approved yet. A Playwright server never needs authentication, so a failure status means Claude Code could not connect to it, not that the list command failed.

Inside a session, /mcp lists the tools. Their names follow mcp__playwright__<tool>, which is how a permission rule names one and how you can tell from the transcript which server answered.

The first real check is one page: ask Claude to open a URL and read the title back. A headed run opens a window you can watch, and a headless run answers without one, so the title coming back is the proof either way.

The failure people hit

The server is added and then fails to start, and the cause is usually Node. The README asks for Node.js 20 or newer, and a session does not always inherit the node your terminal has, so the first thing to check is the version on the path Claude Code actually uses.

The second is the flag on the wrong side of the double dash: a headless request written before it is read as a Claude Code option, and the add command is refused rather than silently ignored.

The rest of the messages are in the MCP errors guide. The add command's own flags and scopes are in Add an MCP server to Claude Code.

Sources

Every line on this page rests on one of these. The date beside each one is the day we read it.

  • microsoft/playwright-mcp README, for what the server does, the Node.js 20 requirement, the Claude Code line it prints, every flag in the table, the standalone port form and the two JSON entries. Read November 25, 2026.
  • Anthropic: Connect Claude Code to tools via MCP, for the double dash, the scope table, the project-scope approval prompt, the health statuses and the tool-name pattern. Read November 25, 2026.

Common questions

What is the command to add Playwright MCP to Claude Code?

claude mcp add playwright -- npx @playwright/mcp@latest, run in a terminal rather than inside a session. Microsoft's README prints the same command without the double dash, since nothing in it takes a flag.

Does Playwright MCP need Node.js?

Yes. Microsoft's README states Node.js 20 or newer, and the server is published as an npm package that npx runs, so the version Claude Code can see on its path is the one that decides whether the server starts.

How do I run the browser headless?

Add the headless flag after the double dash, because the server is headed by default: claude mcp add playwright -- npx @playwright/mcp@latest --headless.

Which browser does it drive?

The browser flag chooses it, with chrome, firefox, webkit and msedge as the documented values. Without the flag the server picks its own default.

Where do the screenshots and other output files go?

A file the server names itself, such as a screenshot taken without an explicit name, lands in its output directory, and the output directory setting decides where that is.

Every session, one window

Omniscio runs several agent sessions side by side in one window, each with its own context and its own diff view. Any model, any harness — Claude Code, Codex, OpenCode, Devin, Pi, and Hermes all supported.