▌BestMCPTools.org
Playwright MCP logo

Playwright MCP

Microsoft's official MCP server for driving a real browser from AI agents

Browser AutomationOpen SourceClaude DesktopClaude CodeCursorVS CodeWindsurfEasy

Last verified: October 20, 2026

Own Playwright MCP? Boost it to the top.✦ Upgrade to Featured

Maintenance status

Active
Last code update: October 19, 2026License: Apache-2.0Checked October 20, 2026

How to Install Playwright MCP

$npx @playwright/mcp@latest

Compatible with: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf.

Setup by client

Claude Desktop (claude_desktop_config.json)

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

Cursor (~/.cursor/mcp.json)

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

VS Code (.vscode/mcp.json)

{
  "servers": {
    "playwright-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

Claude Code (terminal)

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

Add any API keys or environment variables the server's README lists.

About Playwright MCP

What it does

Playwright MCP is Microsoft's official Model Context Protocol server for browser automation. It lets an AI agent open pages, click, type, fill forms and read content by working on Playwright's accessibility tree instead of screenshots, so the model reads structured page data and does not need a vision model. It runs locally through npx and works with most MCP clients, which is why it shows up on so many lists of Claude Code MCP servers and Cursor MCP servers.

Key features and tools

The README describes three design goals: fast and lightweight (accessibility tree, not pixel input), LLM friendly (no vision model needed) and deterministic tool application (less ambiguity than screenshot based approaches).

Core automation tools available by default:

  • browser_navigate, browser_navigate_back, browser_tabs, browser_close, browser_resize
  • browser_snapshot (page snapshot) and browser_find (find in page snapshot)
  • browser_click, browser_hover, browser_drag, browser_drop, browser_type, browser_press_key, browser_select_option, browser_fill_form, browser_file_upload, browser_handle_dialog, browser_wait_for
  • browser_take_screenshot, browser_console_messages, browser_network_requests, browser_network_request
  • browser_evaluate (run JavaScript) and browser_run_code_unsafe (run Playwright code)
  • browser_emulate_media

Opt in tool groups, enabled with the --caps flag:

CapabilityExample tools
networkbrowser_route, browser_route_list, browser_unroute, browser_network_state_set
storagebrowser_cookie_list, browser_cookie_set, browser_localstorage_get, browser_storage_state, browser_set_storage_state
devtoolsbrowser_start_tracing, browser_start_video, browser_highlight, browser_annotate
visionbrowser_mouse_click_xy, browser_mouse_drag_xy, browser_mouse_wheel
pdfbrowser_pdf_save
testingbrowser_generate_locator, browser_verify_element_visible, browser_verify_text_visible, browser_verify_value
configbrowser_get_config

Each tool in the README is marked read only or not, which helps when a client asks you to approve tool calls.

Setup

Requirements are Node.js 18 or newer and an MCP client. The standard config, which the README says works in most tools, is:

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

In Claude Code, add it with claude mcp add playwright npx @playwright/mcp@latest. In Cursor, go to Cursor Settings, then MCP, then Add new MCP Server, choose the command type and enter npx @playwright/mcp@latest. VS Code users can run code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'. The README also has instructions for Claude Desktop, Windsurf, Codex, Copilot CLI, Gemini CLI, Goose, Kiro, LM Studio, opencode, Warp and others.

Useful options, passed in the args list or as environment variables:

  • --headless runs the browser headless (it is headed by default).
  • --isolated keeps the browser profile in memory instead of saving it to disk; pair it with --storage-state to load cookies and local storage.
  • --browser picks chrome, firefox, webkit or msedge.
  • --caps turns on extra tool groups such as vision, pdf or devtools.
  • --extension connects to a running Chrome or Edge browser through the Playwright Extension, so the agent can use your logged in tabs.
  • --allowed-origins and --blocked-origins filter what the browser requests, and --proxy-server routes traffic through a proxy.
  • --port starts HTTP transport, for example npx @playwright/mcp@latest --port 8931, and clients then connect to http://localhost:8931/mcp.

There is no API key and no account. Transport is stdio by default, with optional HTTP via --port. A Docker image (mcr.microsoft.com/playwright/mcp) is also documented.

Use cases

  • Letting a coding agent open your local dev server, click through a flow and read console errors or network requests.
  • Filling and submitting forms, or walking multi step web flows, for repetitive browser chores.
  • Generating Playwright locators and checking that text or elements are visible with the testing capability.
  • Saving pages as PDF or recording traces and video for debugging with the pdf and devtools capabilities.
  • Reading pages that need a signed in session, using a persistent profile or the browser extension.

You can find more browser tools in the browser automation category.

Limitations and things to watch

  • The README states plainly that Playwright MCP is not a security boundary. The origin allow and block lists do not serve as a security boundary either and do not affect redirects.
  • browser_evaluate and browser_run_code_unsafe execute code in the page or against Playwright, so review those calls before approving them.
  • By default the persistent profile stores logged in state on disk. A persistent profile can only be used by one browser at a time, so parallel clients in the same workspace need --isolated or separate --user-data-dir folders.
  • File access is limited to workspace roots by default; --allow-unrestricted-file-access lifts that.
  • The Docker image supports headless Chromium only.
  • Microsoft itself notes that coding agents may get better token efficiency from Playwright CLI with skills, because MCP loads tool schemas and accessibility trees into the model context. MCP is positioned for long running, stateful agent loops.
  • Headless browsers close after one hour without a tool call by default (--idle-timeout), and the next call relaunches them.

Pros and cons

Pros

  • Official Microsoft project under the Apache 2.0 license.
  • Works on structured accessibility snapshots, so no vision model is needed.
  • One npx command, no API key, and setup instructions for a long list of clients.
  • Chromium, Firefox, WebKit and Edge support, plus device emulation.
  • Fine grained control through capability flags and dozens of options.

Cons

  • Accessibility snapshots can be large and use a lot of context tokens.
  • Not a security boundary, so it needs care around untrusted sites and code execution tools.
  • Runs a real browser on your machine, which needs Node.js and local resources.
  • Many useful tools are off until you enable the matching --caps value.

Who it is for

Developers who want an agent to drive a real browser: front end engineers checking their own app, QA engineers writing or repairing Playwright scripts, and anyone automating web tasks from Claude Code, Cursor, VS Code or Windsurf. Teams that need hosted browsers with proxy handling at scale may prefer a cloud service. If the page you are checking was designed in Figma, the Figma MCP server gives the same agent the layout, components and variables to build it from.

Pricing

As of October 2026, Playwright MCP is free and open source under the Apache 2.0 license. There is no paid tier; you only need Node.js and a browser.

Alternatives

Sources

Pricing

Open Source: from Free (open source, as of October 2026)

Our Take on Playwright MCP

Playwright MCP is the default choice when an agent needs a real browser on your own machine. It is official, free, quick to install in Claude Code, Cursor and VS Code, and its accessibility snapshots let a text model act on pages without vision. Plan for the token cost of large snapshots, turn on only the capability groups you need, and remember the README's warning that it is not a security boundary; coding agents that care most about context size may also look at Microsoft's Playwright CLI.

Alternatives to Playwright MCP

Bright Data MCPBrowser Automation

Web scraping and data extraction at scale for AI agents

View Bright Data MCP →
BrowserStack MCPBrowser Automation

Real-device cross-browser testing wired directly into your AI agent

View BrowserStack MCP →
Chrome DevTools MCPBrowser Automation

Google's official MCP server that gives AI agents a live Chrome DevTools session.

View Chrome DevTools MCP →

Frequently Asked Questions

Tags