← Back to directory
P

Playwright MCP

Official
Microsoft's official Playwright-based browser automation MCP server
Category
Browser #1 of 32
Stars
★ 38.3k Very popular
Transport
stdio (local process)
Runtime
Node.js 18+ · Docker
Credentials
No credential needed
License
Apache-2.0
Last commit
Tools
10
78FMRS · B

Officially maintained by Microsoft; using accessibility-tree snapshots instead of screenshot analysis makes this one of the best-documented browser automation MCP servers with the widest client support. This review is a static check of the source and docs, not an actual run.

Strongest · Documentation 18/20 Weakest · Security and permissions 12/20

Reliability
13/20
Security and permissions
12/20
Maintenance
18/20
Documentation
18/20
Setup experience
17/20

Test out of dateListed 2026-07-24

Read the FMRS scoring method →

Fit and risk

What it can accessWrites / deletes local filesRuns commands or codeUses the networkControls a browser

Best for

  • Scenarios where an AI assistant needs to actually drive a browser to complete a task
  • Web automation testing and end-to-end verification

Not for

  • Simple static-text scraping (a lightweight scraper is a better fit)
  • Environments sensitive to browser resource usage that can't run a full browser engine

Required permissions

  • Requires installing and running a browser engine (Chromium/Firefox/WebKit) locally or on a server
  • browser_navigate can visit any URL; browser_evaluate can run arbitrary JavaScript in the page context

Risks and side effects

  • browser_evaluate executing arbitrary scripts carries risk if a malicious page is visited — restrict to trusted sites or an isolated environment
  • Long-running browser instances consume significant memory and CPU

Setup

Before you start

Runtime:Node.js 18+ · Docker

Other optional settings (46)
PLAYWRIGHT_MCP_ALLOWED_HOSTS optional List of hosts the server is allowed to serve from; mirrors --allowed-hosts.
PLAYWRIGHT_MCP_ALLOWED_ORIGINS optional Semicolon-separated list of trusted origins the browser may request; mirrors --allowed-origins.
PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS optional Allow access to files outside workspace roots and file:// URLs; mirrors --allow-unrestricted-file-access.
PLAYWRIGHT_MCP_BLOCKED_ORIGINS optional Origins the browser is blocked from requesting; mirrors --blocked-origins.
PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS optional Block service workers; mirrors --block-service-workers.
PLAYWRIGHT_MCP_BROWSER optional Browser or channel to use (chrome/firefox/webkit/msedge); mirrors --browser.
PLAYWRIGHT_MCP_CAPS optional Additional capabilities to enable (vision/pdf/devtools); mirrors --caps.
PLAYWRIGHT_MCP_CDP_ENDPOINT optional CDP endpoint to connect to; mirrors --cdp-endpoint.
PLAYWRIGHT_MCP_CDP_HEADERS optional CDP headers sent with the connect request; mirrors --cdp-header.
PLAYWRIGHT_MCP_CDP_TIMEOUT optional Timeout in ms for connecting to a CDP endpoint; mirrors --cdp-timeout.
PLAYWRIGHT_MCP_CODEGEN optional Code generation language (typescript/python/java/csharp/none); mirrors --codegen.
PLAYWRIGHT_MCP_CONFIG optional Path to a JSON configuration file; mirrors --config.
PLAYWRIGHT_MCP_CONSOLE_LEVEL optional Console message level to return (error/warning/info/debug); mirrors --console-level.
PLAYWRIGHT_MCP_DEVICE optional Device to emulate, e.g. "iPhone 15"; mirrors --device.
PLAYWRIGHT_MCP_MOBILE optional Emulate a generic mobile device; mirrors --mobile.
PLAYWRIGHT_MCP_EXECUTABLE_PATH optional Path to the browser executable; mirrors --executable-path.
PLAYWRIGHT_MCP_EXTENSION optional Connect to a running browser instance (requires the Playwright Extension); mirrors --extension.
PLAYWRIGHT_MCP_ENDPOINT optional Bound browser endpoint to connect to; mirrors --endpoint.
PLAYWRIGHT_MCP_GRANT_PERMISSIONS optional Permissions to grant the browser context, e.g. geolocation; mirrors --grant-permissions.
PLAYWRIGHT_MCP_HEADLESS optional Run the browser headless; mirrors --headless.
PLAYWRIGHT_MCP_HOST optional Host to bind the server to; mirrors --host.
PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS optional Ignore HTTPS errors; mirrors --ignore-https-errors.
PLAYWRIGHT_MCP_INIT_PAGE optional TypeScript file evaluated on the Playwright page object; mirrors --init-page.
PLAYWRIGHT_MCP_INIT_SCRIPT optional JavaScript init script evaluated in every page; mirrors --init-script.
PLAYWRIGHT_MCP_ISOLATED optional Keep the browser profile in memory; mirrors --isolated.
PLAYWRIGHT_MCP_IMAGE_RESPONSES optional Whether to send image responses (allow/omit); mirrors --image-responses.
PLAYWRIGHT_MCP_NO_SANDBOX optional Disable the sandbox for sandboxed process types; mirrors --no-sandbox.
PLAYWRIGHT_MCP_OUTPUT_DIR optional Directory for output files; mirrors --output-dir.
PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE optional Threshold in bytes for evicting old output files; mirrors --output-max-size.
PLAYWRIGHT_MCP_PORT optional Port for SSE/HTTP transport; mirrors --port.
PLAYWRIGHT_MCP_PROXY_BYPASS optional Comma-separated domains to bypass the proxy; mirrors --proxy-bypass.
PLAYWRIGHT_MCP_PROXY_SERVER optional Proxy server to use, e.g. http://myproxy:3128; mirrors --proxy-server.
PLAYWRIGHT_MCP_SANDBOX optional Enable the sandbox for normally unsandboxed process types; mirrors --sandbox.
PLAYWRIGHT_MCP_SAVE_SESSION optional Save the MCP session into the output directory; mirrors --save-session.
PLAYWRIGHT_MCP_SECRETS_FILE optional Path to a dotenv secrets file used to redact sensitive text in tool responses; mirrors --secrets.
PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT optional Reuse one browser context across connected HTTP clients; mirrors --shared-browser-context.
PLAYWRIGHT_MCP_SNAPSHOT_BOXES optional Include element bounding boxes in snapshots; mirrors --snapshot-boxes.
PLAYWRIGHT_MCP_SNAPSHOT_MODE optional Snapshot mode (full/none); mirrors --snapshot-mode.
PLAYWRIGHT_MCP_STORAGE_STATE optional Storage state file path for isolated sessions; mirrors --storage-state.
PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE optional Test id attribute, defaults to data-testid; mirrors --test-id-attribute.
PLAYWRIGHT_MCP_TIMEOUT_ACTION optional Action timeout in ms (default 5000); mirrors --timeout-action.
PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION optional Navigation timeout in ms (default 60000); mirrors --timeout-navigation.
PLAYWRIGHT_MCP_TIMEOUT_SETTLE optional Settle wait after each action in ms (default 500); mirrors --timeout-settle.
PLAYWRIGHT_MCP_USER_AGENT optional User agent string to use; mirrors --user-agent.
PLAYWRIGHT_MCP_USER_DATA_DIR optional Path to the browser user data directory; mirrors --user-data-dir.
PLAYWRIGHT_MCP_VIEWPORT_SIZE optional Browser viewport size, e.g. "1280x720"; mirrors --viewport-size.

Run @playwright/mcp@latest directly via npx — the required browser engine downloads automatically on first run. Flags like --browser (chromium/firefox/webkit), --headless, and --isolated (isolated user profile) are also supported; see the repo README for the full list.

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

Shown for Claude Desktop. Other clients may use a different file or key (VS Code uses "servers") — the configurator below converts it.

.vscode/mcp.json
{
  "servers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

Goes in your project's .vscode/mcp.json (VS Code uses a "servers" key).

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

Run it in a terminal; replace any <…> placeholders with your own values first.

Check that it works

After installing, Playwright tools such as browser_navigate and browser_snapshot should appear in the client's tool list; asking the model to browser_navigate to any URL and getting back a page snapshot confirms the connection works.

Troubleshooting

  1. Missing browser engine: ensure network access to Playwright's browser download location on first run
  2. Element location fails: prefer the stable references from browser_snapshot over coordinate clicks
  3. Rendering issues in headless mode: try disabling --headless to rule out an environment-specific issue

Things to try

Once connected, you can ask your AI assistant things like:

  • Navigate to https://example.com and give me an accessibility snapshot of the page
  • Take a screenshot of the current page and save it as home.png
  • Type 'playwright' into the search box and click the submit button
  • List all network requests made since the page loaded

Tools 10

browser_click writes
Click an element on the page
browser_close writes
Close the current page
browser_console_messages read-only
Return browser console messages
browser_navigate writes
Navigate to a URL
browser_snapshot read-only
Capture an accessibility-tree snapshot for locating elements
browser_type writes
Type text into an input field
browser_take_screenshot read-only
Take a screenshot of the current page
browser_fill_form writes
Fill multiple form fields at once
Show 2 more tools
browser_evaluate writes
Execute JavaScript in the page context
browser_network_requests read-only
List network requests made by the page

Use cases

Automate web interaction flows for testing and generate reproducible steps
Scrape dynamic content that requires JS rendering
Have an AI assistant fill forms and click through a web task
Inspect console errors and network requests while debugging a page

Supported clients

Claude Desktop
Claude Code
VS Code
Cursor
Windsurf
JetBrains IDEs
Zed
Cline
Amp
Kiro
LM Studio
Antigravity
Goose

Listed from the project's documentation, not tested by this site.

Overview

Officially maintained by Microsoft, this MCP server wraps Playwright for browser automation. It uses accessibility-tree snapshots rather than pixel-based screenshot analysis to understand page structure, letting an AI assistant click, type, navigate, screenshot, and read console/network activity reliably without a vision model.

Similar servers

Source revision b8b4183e099f Data synced 2026-10-19 Read the FMRS scoring method