SuperAPI AI Directory

mcp-playwright

Playwright MCP Server is a Model Context Protocol (MCP)-based server that uses Playwright to provide browser automation capabilities for large language models (LLMs), enabling them to interact with web pages in a real browser environment, take screenshots, generate test code, perform web scraping, and execute JavaScript. This tool is suitable for MCP-supporting clients such as Claude Desktop, Cline, Cursor IDE, and VS Code GitHub Copilot. The latest version v1.0.10 introduces device emulation, supporting 143 real device presets (such as iPhone, iPad, Pixel, Galaxy, and desktop browsers), and supports natural language instructions such as "test on iPhone 13." Installation is flexible: it can be installed via npm, mcp-get, Smithery, or the VS Code CLI; it supports standard stdio mode and HTTP mode; browser binaries can be installed automatically. This server is mainly intended for developers, testers, and AI assistant users who need to integrate browser operations into AI workflows, helping to implement scenarios such as automated testing, web scraping, and remote debugging.

Open website

About this tool

Playwright MCP Server is a Model Context Protocol (MCP) server designed to provide browser automation capabilities for large language models (LLMs). Through this server, LLMs can interact with web pages using Playwright, including taking screenshots, generating test code, scraping page content, and executing JavaScript in a real browser environment. It is suitable for MCP-supporting clients such as Claude Desktop, Cline, Cursor IDE, and VS Code GitHub Copilot.

Main Capabilities

  • Browser automation: Control Chromium, Firefox, and WebKit browsers to perform navigation, clicks, typing, and other operations.
  • Screenshots and test code generation: Can take screenshots of web pages and generate test scripts based on operations.
  • Web scraping and JavaScript execution: Extract data or run custom scripts in the browser context.
  • Device emulation (new in v1.0.10): Supports 143 real device presets, covering iPhone, iPad, Pixel, Galaxy, and desktop browsers, and can accurately simulate viewports, user agents, touch events, and device pixel ratios. Supports natural language instructions such as "test on iPhone 13," "switch to iPad view," and "rotate to landscape."

Installation Methods Can be installed via npm, mcp-get, or Smithery. For Claude Desktop, Smithery can be used for automatic installation; the Playwright MCP server can also be installed in VS Code via a button or the CLI. After installation, the ExecuteAutomation Playwright MCP server will be available for the GitHub Copilot agent in VS Code.

Browser Installation

  • Automatic installation (recommended): On first use, the server automatically detects missing browsers and downloads and installs Chromium, Firefox, or WebKit, displays installation progress, and retries the request after completion. No manual setup is required.
  • Manual installation (optional): If automatic installation fails or you prefer to install manually, browsers will be stored in the following locations:
    • Windows: %USERPROFILE%\AppData\Local\ms-playwright
    • macOS: ~/Library/Caches/ms-playwright
    • Linux: ~/.cache/ms-playwright

Configuration Modes

  • Standard mode (stdio): Recommended for Claude Desktop. In this mode, logs are automatically written to a file (~/.playwright-mcp-server.log) to keep the JSON-RPC communication clean.
  • HTTP mode (standalone server): When running a headed browser on a system without a display, or when running from an IDE's worker process, you can run the MCP server as a standalone HTTP server. Note: Claude Desktop currently requires stdio mode; HTTP mode is recommended for VS Code, custom clients, and remote deployments. The configuration must include the "type": "http" field, otherwise the connection will fail.

Use Cases

  • Integrating browser automation capabilities in clients such as Claude Desktop, VS Code GitHub Copilot, Cline, and Cursor IDE.
  • Running a headed browser in displayless environments such as remote servers.
  • Running as a background service, or for access by multiple clients.
  • Debugging and custom MCP client integration via the /health endpoint.

Limitations and Notes

  • The server includes a monitoring system and uses a dynamically assigned port (to avoid conflicts); check the console output for the actual port.
  • By default, the server binds only to localhost and external access is prohibited (by security design). If remote access is needed, you can use an SSH tunnel: ssh -L 8931:localhost:8931 user@remote-server.
  • When adding new tools, pay attention to tool name length. Some clients (such as Cursor) have a 60-character limit on the combination of server name and tool name (server_name:tool_name). This server is named playwright-mcp, so make sure tool names are short enough.
  • If the "No transport found for sessionId" error occurs, check whether the configuration includes "type": "http", and confirm that the server logs show "Incoming request", "Transport registered", and "POST message received" in that order.
  • If the server fails to start, check whether port 8931 is available.