Skip to content

What Is Playwright MCP? Letting an AI Assistant Use a Browser: Setup, Price and Security

You tell your coding assistant what to do on a page; Playwright MCP opens the page in a real browser (Chrome, Firefox, WebKit, Edge), navigates, clicks and fills in forms. It reads the page not as a screenshot but as structured text called the accessibility tree. It is Microsoft's free, open-source (Apache-2.0) MCP server; it needs no account or API key, and you add a single configuration to your assistant's MCP settings. The browser opens on your computer and by default saves your logins to disk. The README states clearly that it is not a security boundary.

What it does
Has the assistant browse and fill forms in a real browser
Type
MCP server (runs on your computer)
Where
Claude Code, Claude Desktop, Cursor, VS Code, Codex
Requirements
Node.js (README 18+, docs 20+)
Security
README: not a security boundary
Latest version
0.0.83 (28.09.2026)
Price
Free, Apache-2.0

What does Playwright MCP do?

If a coding assistant can't see the site you're building, it works by guesswork. Playwright MCP gives the assistant a real browser: it opens the site, clicks, fills in forms, and looks at console errors and network requests. An MCP server is a small program that works through the standard AI programs use to connect to outside tools; Playwright is Microsoft's browser testing and automation library.

YouYou say what to do on the page
AssistantClaude Code, Claude Desktop, Cursor, VS Code, Codex
Playwright MCPRuns on your computer
BrowserChrome, Firefox, WebKit, Edge

Reads the page as an accessibility tree; logins are saved to disk by default.

The assistant reads the page not as pixels but by each element's name, role and text (the accessibility tree); this is more precise and cheaper than screenshots.

Who it's for: people building a website or app who want an assistant such as Claude Code or Cursor to test things in a browser. If you don't write code, it won't help you.

The README's own comparison: for coding agents, the Playwright CLI and skills use fewer tokens; MCP still makes sense for specialized loops that need persistent state and iterative reasoning.

How do you install Playwright MCP?

No account or key is needed; you add one configuration to the assistant's MCP settings and the package is pulled from npm on the first run. The README says Node.js 18 or later, playwright.dev says 20 or later; 20 or later is the safest choice. The commands are taken verbatim from the official README.

One command› claude mcp add playwright npx @playwright/mcp@latest

Type /mcp in Claude Code to see that it's installed.

For an isolated session, add --isolated to the settings: the browser profile stays in memory and logins are not written to disk. To run headless, add --headless.

How do you use Playwright MCP?

Once it's installed, you write a normal request to the assistant; the assistant uses the browser tools on its own when needed. By default a headed browser window opens and you can watch what it does.

Test your site"Open the site at localhost:3000 in the browser, fill in and submit the contact form, and tell me if there are any errors in the console."
Mobile view"Open the home page at a mobile screen size and check whether any element overflows or gets cut off."

If you use it from several clients in the same working folder, the persistent profile collides ("Browser is already in use"). Give additional clients --isolated or a separate --user-data-dir.

Which apps does Playwright MCP work in?

Claude CodeYesThe README gives a one-line install command.
Claude Desktop, Gemini CLI, WindsurfYesThe README says to use the standard configuration and follow the client's own MCP documentation.
Cursor, VS Code, Codex, GitHub Copilot CLIYesThe README gives an install command or steps for each.
Amp, Factory, Grok, opencode, Goose, Junie, Cline, Kiro, LM Studio, Qodo Gen, Warp, AntigravityYesInstall path from the README.
ChatGPT and claude.ai (remote)UnclearThe server is designed to run locally; users report that in remote use the session closes after every tool call.

"Not in the documentation" does not mean it doesn't work. The list is compiled from the README.

What does Playwright MCP access? Security

Reads

The content and screenshots of pages it opens, console messages and network requests. Optionally it can also read cookies and local storage. By default it does not access files outside the working folder.

Writes

It clicks, types, fills in forms, uploads files and runs JavaScript on the page. One tool runs arbitrary code in the Playwright server process; the README flags it as "RCE-equivalent" and says it is for trusted clients only.

Saved logins

The default persistent profile saves logins and cookies to a profile folder on your computer; with --isolated they are kept in memory. Extension mode opens the tabs you're already logged into to the assistant.

Internet and data

The server runs locally; the browser itself connects to the sites you visit. Content read from the page goes to your assistant, and from there to the assistant's model provider. Network inspection tools can also show requests that contain cookies and auth tokens.

Recorded security advisories

No recorded advisory affecting the current version appears; a DNS rebinding advisory (CVE-2025-9611) was published for versions before 0.0.40 and fixed in that version. This is not a security certification.

The README says plainly that "Playwright MCP is not a security boundary"; the allowed/blocked origin settings don't count as a security boundary either. Be careful on pages you don't trust, especially with logged-in sessions and in extension mode: page content reaches the assistant and can steer it with hidden instructions.

Is Playwright MCP free?

Yes. Playwright MCP is free and open source (Apache-2.0); there is no account, subscription or paid tier. Commercial use is allowed. The assistant's own plan and quota are separate.

Allowed
  • Use, modify and distribute it, including commercially (Apache-2.0)
Not allowed
  • Remove the copyright and license notice from copies

Source: LICENSE and the npm listing. The terms of use of the sites you visit are a separate matter. This is not legal advice.

Common issues and fixes

What happensWhat to do
"Browser is already in use for mcp-chrome" errorThe persistent profile can be used by only one browser instance at a time. Give additional clients --isolated or a separate --user-data-dir.
A headed browser won't open on a server without a display or in the IDE's worker processRun the server separately (npx @playwright/mcp@latest --port 8931) and give the client the URL; or use --headless.
The HTTP connection times outplaywright.dev: HTTP sessions have a five-second heartbeat timeout; increase PLAYWRIGHT_MCP_PING_TIMEOUT_MS.
The browser closes on its own after a whileA headless browser closes after an hour idle and the next tool call reopens it; set this with --idle-timeout.
Reported by users "chrome is not found" error on WindowsReported on GitHub (issue #13); no official fix. The README offers the --browser and --executable-path options.
Reported by users In remote use (ChatGPT, claude.ai) the session closes after every callReported on GitHub (issue #1045); the server is designed for local use.

The README's "Browser installation" section is empty: the official documentation doesn't say whether the browser downloads automatically on the first run. If no browser is found, make sure Chrome or Edge is installed.

How do you remove Playwright MCP?

  1. Remove it from the client: Delete the "playwright" entry from your MCP settings (in Claude Code, claude mcp remove playwright).
  2. Clear logins: Because the persistent profile keeps logins, delete the profile folder: on Windows the mcp-… folder under %USERPROFILE%\AppData\Local\ms-playwright; on macOS ~/Library/Caches/ms-playwright; on Linux ~/.cache/ms-playwright.
  3. If you used the extension: Remove Playwright Extension from Chrome or disconnect from the extension's status page.

Frequently asked questions

What is Playwright MCP and what does it do?

Microsoft's free MCP server that lets an AI assistant open, browse, click and fill in forms in a real browser. It reads the page by each element's name and role (the accessibility tree) instead of screenshots.

How do you install Playwright MCP?

For Claude Code, type claude mcp add playwright npx @playwright/mcp@latest. Other clients use the standard configuration: command npx, args @playwright/mcp@latest. Node.js is required; the README says 18, playwright.dev says 20 or later.

Which apps does Playwright MCP work in?

The README covers installation for Claude Code, Claude Desktop, Cursor, VS Code, Codex, Gemini CLI, Windsurf, GitHub Copilot CLI and other clients. The server is designed for local use; problems have been reported in remote use.

What is the difference between Playwright MCP and Playwright CLI?

According to the README's comparison, the CLI and skills use fewer tokens for coding agents; MCP makes sense for specialized loops that need persistent state and iterative reasoning. MCP opens a headed browser by default.

Is Playwright MCP free and safe?

It is free and open source (Apache-2.0). On security, the README says it is not a security boundary; no recorded advisory affecting the current version appears, but that does not mean it is safe.

Does Playwright MCP store my logins?

The default persistent profile saves logins and cookies to a profile folder on your computer. With --isolated they are kept in memory and not written to disk. You can clear logins by deleting the profile folder.

Tasks and setup kits that use Playwright MCP

Related guides

Sources

Not clear in the official sources: Whether the browser downloads automatically on the first run (the related README section is empty) · whether Node.js 18 or 20 is required (the README and playwright.dev differ) · the server's own telemetry · Turkish. Each is covered in its section, along with what you can do.