Playwright MCP

Microsoft's official MCP server for driving a browser with Playwright through the accessibility tree, no screenshots needed

  • 38,768 ★ on the repository
  • Last commit
  • Apache-2.0
MCP serverOfficialEditors’ pick

Extended access

Why this level

  • The agent opens arbitrary sites and can submit forms
  • The persistent profile keeps cookies and sessions
All reasons and checks

microsoft/playwright-mcp

Install

Manual install

claude mcp add playwright npx @playwright/mcp@latest

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • The agent opens arbitrary sites and can submit forms
  • The persistent profile keeps cookies and sessions

This is third-party code. Review the repository files before installing.

What it does

The server launches a browser through Playwright and gives the agent tools to navigate, click, type and read pages. Pages reach the model as structured accessibility tree snapshots, so no vision model is needed. You can pick Chrome, Firefox, WebKit or Edge, emulate a mobile device, run headless, or attach to an open browser through an extension. Extra vision, pdf and devtools capabilities can be switched on.

Who it is for. For developers and QA engineers who need their agent to work with live web pages.

Good fit when

  • The agent must walk through a site flow: log in, fill a form, check the result
  • You need exploratory automation or self-healing tests with a persistent browser context
  • You need data from a page that renders on the client

Not a fit when

  • A coding agent in a large project needs to save context: the README recommends Playwright CLI with skills
  • A plain HTTP request without a browser is enough

Example request

Open our staging site, register a test user and check that the confirmation email notice appears

MCP

Transport
stdio
Authentication
not required

Environment variables

PLAYWRIGHT_MCP_BROWSER
Browser or Chrome channel: chrome, firefox, webkit, msedge
PLAYWRIGHT_MCP_HEADLESS
Run the browser headless
PLAYWRIGHT_MCP_CAPS
Extra capabilities: vision, pdf, devtools
PLAYWRIGHT_MCP_SECRETS_FILE secret
Path to a dotenv file with secrets

Limitations

Requires Node.js 18 or newer. Page snapshots and tool schemas use many tokens. A persistent browser profile can serve only one client at a time; parallel clients need --isolated or a separate --user-data-dir. Allowed and blocked origin lists are not a security boundary.

How to disable. Remove the playwright server from your client's MCP config, in Claude Code with claude mcp remove playwright.

FAQ

How does MCP differ from Playwright CLI?

The README recommends the CLI with skills for coding agents because it uses fewer tokens. MCP fits cases that need a persistent browser and rich page introspection.

Can I keep logins?

Yes, a persistent profile is used by default. For isolated sessions pass a storage state file with --storage-state.

How is Playwright MCP different from screenshot-based browser tools?

The server hands the model the page as a structured accessibility tree snapshot, not an image. The agent clicks and types by element, which is more precise and cheaper than screenshots. The project is official, from Microsoft.

How do I connect Playwright MCP to Claude Code and Cursor?

In Claude Code: claude mcp add playwright npx @playwright/mcp@latest. The server also works in Cursor, VS Code, Claude Desktop, Codex, Windsurf, Goose and Amp, with a config for each in the install block.

How is the official Playwright MCP different from community servers?

It is the server from the Microsoft team itself: it hands the page to the model as an accessibility tree, and browsers, modes and flags evolve together with Playwright. Community servers such as ExecuteAutomation and Automata Labs ship their own tool sets, and some generate test code.

Discussion

No questions or reviews yet.

Playwright-based MCP server for browsing sites, clicking, filling forms, taking screenshots and running JavaScript in a browser

MCP serverBroad access297Repository stars
Official

An MCP server and Chrome extension that let the agent drive your already open browser with your logged-in sessions, all locally

MCP serverBroad access7.2KRepository stars
Needs a VPN

An MCP server that lets an agent drive a real browser: open pages, click and fill forms through Playwright

MCP serverExtended access849Repository stars
Official

An MCP and CLI that let an agent control your real Chrome, with its own logins and extensions, through Playwright

MCP serverBroad access4KRepository stars

A Chrome extension with an MCP server: the agent drives your everyday browser with its sessions, tabs, bookmarks and history

MCP serverBroad access12.5KRepository stars

An MCP server that opens pages in headless Chromium through Playwright and hands the agent the main text as Markdown, even from JavaScript-heavy sites

MCP serverExtended access1.1KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialAuthenticationRepository starsMain difference
Playwright MCP (this entry)yesnot required38,768
Playwright MCP Servernonot required5,675generates test code, emulates devices
MCP Server Playwright by Automata Labsnonot required297third-party server on an early SDK

README in short

The README first compares MCP with Playwright CLI and explains when to choose each. It then gives a standard JSON snippet and install commands for VS Code, Cursor, Claude Code, Codex, Goose, Windsurf and other clients. A large section lists launch arguments with matching environment variables, plus notes on user profiles, initial state and the config file. Apache-2.0 licensed.

README badge

Report a problem

Foxx AIPlaywright MCP
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.