home / mcp / playwright mcp server

Playwright MCP Server

playwright-mcp-server

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "b3nw-playwright-browserless-mcp": {
      "command": "npx",
      "args": [
        "playwright-browserless-mcp",
        "--url",
        "ws://your-browserless-host:3000/playwright/chromium"
      ],
      "env": {
        "PLAYWRIGHT_URL": "ws://your-browserless-host:3000/playwright/chromium"
      }
    }
  }
}

Available tools

browser_navigate

Navigate to a URL and wait for the page to load. Requires url and optional waitUntil to specify the load condition.

browser_click

Click on an element specified by a CSS selector. Requires selector.

browser_type

Type text into an input field. Requires selector and text to type.

browser_wait_for

Wait for an element to appear on the page. Requires selector and optional timeout.

browser_take_screenshot

Capture a screenshot of the current page or a specific element. Optional fullPage and selector.

browser_get_html

Extract HTML content from the page or a specific element. Optional selector.

browser_snapshot

Get an accessibility tree snapshot for semantically identifying elements. Optional selector and returns structured data.

browser_file_upload

Upload files to file input elements to test file forms. Requires selector and paths.

browser_refresh

Refresh the current page with configurable wait conditions. Optional waitUntil and timeout.

browser_evaluate

Execute JavaScript in the browser context with safety checks. Requires script.