Feedback

Playwright Browser Automation MCP Server Verified Featured

@microsoft Claim

Basic information

Runtime
TypeScript
Version
1.0.0
License
Apache-2.0
Transports
stdio
Author
microsoft
Submitted by
Community
Quality
70
Stars
34.8K

About Playwright Browser Automation MCP Server

Enhance software testing with Playwright MCP: Fast, reliable browser automation, an innovative alternative to Selenium software testing tools.

Playwright Browser Automation is a MCP server in the Browser Automation category listed in the AddMCP.net directory, published by microsoft. It exposes 22 tools, including browser_close, browser_resize, browser_console_messages, browser_handle_dialog and more. Supported transport: stdio. Runtime: TypeScript. License: Apache-2.0. The repository has 34,796 GitHub stars. Source code is hosted on github.com. Related topics: browser-automation, mcp, official, playwright, webscraping.

Setup

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

Playwright Browser Automation MCP Server config

Add this server to your MCP-compatible client using the configuration below.

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

Playwright Browser Automation MCP Server tools

  • browser_close — Close the page
  • browser_resize — Resize the browser window
  • browser_console_messages — Returns all console messages
  • browser_handle_dialog — Handle a dialog
  • browser_evaluate — Evaluate JavaScript expression on page or element
  • browser_file_upload — Upload one or multiple files
  • browser_fill_form — Fill multiple form fields
  • browser_install — Install the browser specified in the config. Call this if you get an error about the browser not being installed.
  • browser_press_key — Press a key on the keyboard
  • browser_type — Type text into editable element
  • browser_navigate — Navigate to a URL
  • browser_navigate_back — Go back to the previous page
  • browser_network_requests — Returns all network requests since loading the page
  • browser_take_screenshot — Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
  • browser_snapshot — Capture accessibility snapshot of the current page, this is better than screenshot
  • browser_click — Perform click on a web page
  • browser_drag — Perform drag and drop between two elements
  • browser_hover — Hover over element on page
  • browser_select_option — Select an option in a dropdown
  • browser_tabs — List, create, close, or select a browser tab.
  • browser_wait_for — Wait for text to appear or disappear or a specified time to pass
  • browser_run_code — Run Playwright code snippet

Overview

What is Playwright Browser Automation?

Playwright MCP Server is Microsoft's official playwright mcp package (@playwright/mcp) that gives AI agents browser automation through Playwright. It lets an LLM read and act on web pages through structured accessibility snapshots instead of screenshots, so no vision model is needed.

The project is open source under the Apache-2.0 license and maintained in the microsoft/playwright-mcp repository. It runs locally over stdio by default, and it can also be started as a standalone HTTP server that MCP clients connect to by URL.

How to use Playwright Browser Automation?

Prerequisites: Node.js 18 or newer and an MCP client such as Claude Code, Claude Desktop, Cursor, VS Code, Windsurf, Codex or Goose. No API key or account is required.

The standard config works in most clients:

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

Extra options are added to the args list, for example "--headless", "--browser=firefox" or "--isolated".

Claude Code

claude mcp add playwright npx @playwright/mcp@latest

Claude Desktop

Follow the MCP install guide and paste the standard config above into your Claude Desktop config file.

Cursor

Go to Cursor Settings -> MCP -> Add new MCP Server, choose the command type and enter npx @playwright/mcp@latest. The README also provides a one-click install button.

VS Code

Use the standard config with the VS Code MCP setup, or install from the command line:

code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'

The server then becomes available to the GitHub Copilot agent in VS Code.

Codex

codex mcp add playwright npx "@playwright/mcp@latest"

Or add it to ~/.codex/config.toml:

[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]

Windsurf

Follow the Windsurf MCP documentation and use the standard config above.

Standalone HTTP server and Docker

To run the playwright mcp server as a long-lived process (for example on a machine where the IDE cannot open a headed browser), start it with a port:

npx @playwright/mcp@latest --port 8931

Then point the client at the endpoint:

{
  "mcpServers": {
    "playwright": {
      "url": "http://localhost:8931/mcp"
    }
  }
}

A Docker image is also published (mcr.microsoft.com/playwright/mcp); it currently supports headless Chromium only.

Key features of Playwright Browser Automation

  • Accessibility-tree based: agents work from structured page snapshots, not pixels, which makes actions fast and deterministic.
  • No vision model needed: any text LLM can drive the browser; screenshots are available but optional.
  • Multiple browsers: --browser accepts chrome, firefox, webkit or msedge, and --device or --mobile emulates mobile devices.
  • Flexible profiles: a persistent profile by default (logins survive between sessions), --isolated in-memory sessions with optional --storage-state, or the Playwright browser extension to reuse tabs in your running Chrome or Edge.
  • Opt-in capabilities: extra tool groups such as PDF export, coordinate-based mouse control, DevTools tracing and video, storage, network routing and test assertions are enabled with --caps.
  • Fine-grained configuration: every CLI flag has a PLAYWRIGHT_MCP_* environment variable, and a JSON file can be loaded with --config.
  • Network controls: proxy settings, --allowed-origins and --blocked-origins lists, and --allowed-hosts for the HTTP server.

Playwright Browser Automation tools

The default toolset covers core automation:

  • Navigation and pages: browser_navigate, browser_navigate_back, browser_resize, browser_close and browser_tabs for listing, opening, closing and switching tabs.
  • Reading the page: browser_snapshot captures the accessibility snapshot that agents use to target elements; browser_find searches that snapshot for text or a regex, which is cheaper than a full snapshot. browser_take_screenshot saves an image but cannot be used to pick targets.
  • Interaction: browser_click, browser_type, browser_fill_form, browser_select_option, browser_hover, browser_drag, browser_press_key, browser_file_upload, browser_drop and browser_handle_dialog.
  • Debugging: browser_console_messages, browser_network_requests and browser_network_request for headers and bodies, plus browser_evaluate for JavaScript and browser_wait_for for text or timeouts.
  • Code execution: browser_run_code_unsafe runs a Playwright snippet in the server process; the README labels it RCE-equivalent.

Opt-in groups add tools such as browser_pdf_save (--caps=pdf), browser_mouse_click_xy (--caps=vision), browser_start_tracing (--caps=devtools), browser_cookie_list (--caps=storage), browser_route (--caps=network) and browser_verify_text_visible (--caps=testing).

Use cases of Playwright Browser Automation

  • Exploratory testing: "Open localhost:3000, sign up with a test account and tell me which step fails."
  • Writing end-to-end tests: let the agent walk through a flow, then generate Playwright code (the --codegen option sets TypeScript, Python, Java or C#).
  • Self-healing tests: have the agent inspect the current page structure and fix broken selectors in a failing test.
  • Debugging front-end issues: "Load the checkout page and list any console errors and failed network requests."
  • Form filling and data entry in web apps that have no API, using a persistent or extension-connected logged-in session.
  • Long-running agent workflows that need to keep browser state across many steps.

Frequently asked questions

1 Is Playwright MCP Server official?

Yes. It is published by Microsoft as @playwright/mcp in the microsoft/playwright-mcp repository on GitHub.

2 Is Playwright MCP free?

Yes. It is open source under Apache-2.0 and needs no API key or paid account; you only pay for the LLM client you use.

3 Does Playwright MCP work with Claude Code, Cursor and VS Code?

Yes. Claude Code uses claude mcp add playwright npx @playwright/mcp@latest, VS Code supports code --add-mcp, and Cursor accepts the npx @playwright/mcp@latest command in its MCP settings.

4 Does it need screenshots or a vision model?

No. The mcp playwright server works from accessibility snapshots by default. Coordinate-based tools are available only if you enable --caps=vision.

5 Can it use my logged-in browser session?

Yes. The default persistent profile keeps logins between sessions, and the Playwright browser extension (--extension) connects to your running Chrome or Edge tabs.

6 Can I run it remotely?

You can run it as an HTTP server with --port (and --host 0.0.0.0 to bind all interfaces) or in Docker, then connect clients by URL.

7 Is Playwright MCP safe to use?

The README states it is not a security boundary. Origin allow and block lists do not stop redirects, and browser_run_code_unsafe can run arbitrary code, so run it only where you trust the agent and the sites it visits.

8 Which browsers does it support?

Chrome, Firefox, WebKit and Microsoft Edge through the --browser option, plus device emulation through --device or --mobile.

Videos

Tutorials, guides, and showcases related to Playwright Browser Automation MCP Server. The player loads when you press play.

Videos belong to their creators. Relevance is approximate; check the channel and description before following setup steps.

Comments

No comments yet

Be the first to share feedback about this listing. Sign in to leave a comment.

Sign In

Feedback 💬