Playwright

v0.0.75Browser Automationstable

A production-ready browser automation server that enables AI assistants to interact with web pages using tools for navigation, element interaction, and data extraction. It features a built-in Inspector UI and robust crash recovery for reliable automa

mcpplaywright
Share:
32,847
Stars
0
Downloads
0
Weekly
0/5

What is Playwright?

Playwright is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to production-ready browser automation server that enables ai assistants to interact with web pages using tools for navigation, element interaction, and data extraction. it features a built-in inspector ...

A production-ready browser automation server that enables AI assistants to interact with web pages using tools for navigation, element interaction, and data extraction. It features a built-in Inspector UI and robust crash recovery for reliable automa

This server falls under the Browser Automation category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • A production-ready browser automation server that enables AI

Use Cases

Navigate web pages, interact with elements, and extract data.
Automate web testing and data collection with built-in crash recovery.
microsoft

Maintainer

LicenseApache-2.0
Languagetypescript
Versionv0.0.75
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @playwright/mcp

Manual Installation

npx -y @playwright/mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Playwright

The Playwright MCP Server (@playwright/mcp) gives AI assistants deterministic browser automation by using Playwright's accessibility tree snapshots rather than screenshots, removing the need for vision models to interpret pages. It exposes tools for navigation, clicking, typing, tab management, network mocking, cookie/storage management, PDF generation, JavaScript evaluation, and video/trace recording. Built by Microsoft, it includes a built-in Inspector UI and robust crash recovery, making it suitable for production-grade web automation, testing, and data extraction workflows driven by LLMs.

Prerequisites

  • Node.js 18 or later with npx available
  • Playwright browsers installed (the server can install them automatically on first run)
  • An MCP-compatible client such as Claude Desktop, Cursor, or VS Code with MCP support
  • Optional: environment variables for headless mode, browser selection, or custom timeouts
1

Install Playwright browsers

Before running the MCP server, ensure Playwright's browser binaries are available. This only needs to be done once.

npx playwright install chromium
2

Run the Playwright MCP server

Start the server with npx. By default it runs in headless mode using Chromium.

npx @playwright/mcp@latest
3

Add the server to your MCP client configuration

Edit your claude_desktop_config.json (or equivalent config) to register the Playwright MCP server.

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

Configure optional environment variables

Customize the server behavior using PLAYWRIGHT_MCP_ prefixed environment variables: headless mode, browser choice (chromium/firefox/webkit), port, timeouts, and user data directory.

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"],
      "env": {
        "PLAYWRIGHT_MCP_HEADLESS": "false",
        "PLAYWRIGHT_MCP_BROWSER": "chromium",
        "PLAYWRIGHT_MCP_TIMEOUT_ACTION": "10000",
        "PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION": "30000"
      }
    }
  }
}
5

Restart your MCP client and verify

Restart Claude Desktop or your MCP client. The Playwright tools (browser_navigate, browser_click, browser_type, etc.) should appear in the tools panel. Test by asking your AI to navigate to a URL.

Playwright Examples

Client configuration

Full claude_desktop_config.json entry for the Playwright MCP server with visible browser mode enabled.

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["@playwright/mcp@latest"],
      "env": {
        "PLAYWRIGHT_MCP_HEADLESS": "false",
        "PLAYWRIGHT_MCP_BROWSER": "chromium",
        "PLAYWRIGHT_MCP_USER_DATA_DIR": "/tmp/playwright-profile"
      }
    }
  }
}

Prompts to try

Example prompts that exercise Playwright MCP server's navigation, extraction, and interaction tools.

- "Navigate to https://github.com/microsoft/playwright-mcp and take a snapshot of the page"
- "Go to https://news.ycombinator.com and list all the post titles on the front page"
- "Navigate to https://example.com, fill in the search box with 'playwright', and click the submit button"
- "Open a new browser tab, navigate to https://docs.anthropic.com, and return the table of contents"
- "Navigate to a login page, enter my credentials, and take a screenshot after logging in"
- "Mock all requests to /api/data to return an empty array, then reload the page"

Troubleshooting Playwright

Error: browserType.launch: Executable doesn't exist at /path/to/chromium

Run 'npx playwright install chromium' (or 'firefox'/'webkit') to download the required browser binaries. This must be done on the machine running the MCP server, not just the client machine.

Page snapshots return empty or minimal content

Some sites block headless browsers. Set PLAYWRIGHT_MCP_HEADLESS=false to run in headed mode and add PLAYWRIGHT_MCP_USER_DATA_DIR to persist cookies/sessions. Some pages also require JavaScript rendering time — increase PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION.

The server crashes mid-session with no error message

The built-in crash recovery should auto-restart the browser context. If crashes persist, check system memory (Playwright's Chromium can use 200–500 MB) and ensure no other process is using the configured port (PLAYWRIGHT_MCP_PORT, default 3000).

Frequently Asked Questions about Playwright

What is Playwright?

Playwright is a Model Context Protocol (MCP) server that production-ready browser automation server that enables ai assistants to interact with web pages using tools for navigation, element interaction, and data extraction. it features a built-in inspector ui and robust crash recovery for reliable automa It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Playwright?

Install via npm with the command: npx -y @playwright/mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Playwright?

Playwright works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Playwright free to use?

Yes, Playwright is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Browser Automation MCP Servers

Explore all browser automation servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Playwright?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides