Get the FREE Ultimate OpenClaw Setup Guide →

mcp-playwright

Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio executeautomation-mcp-playwright npx -y @executeautomation/playwright-mcp-server

How to use

The Playwright MCP Server provides browser automation capabilities to LLMs via the MCP (Model Context Protocol). It leverages Playwright to interact with real browsers, enabling actions such as taking screenshots, injecting and executing JavaScript, scraping page content, and generating test code. The server supports rich device emulation (including 143 real device presets like iPhone 13, iPad Pro in various orientations, and desktop layouts), and can operate in both stdio (for Claude Desktop) and HTTP/standalone modes for broader integration. Typical workflows include driving a web page to fetch data, render pages for visual verification, or producing test scaffolding from natural language prompts. Tools and features highlighted in the project include device emulation prompts, device quick reference, a prompt guide, and comprehensive API references for supported Playwright-based actions.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Internet access to fetch the MCP server package

Installation options:

  1. Install via npm (global):
npm install -g @executeautomation/playwright-mcp-server
  1. Install via MCP-get (to fetch the server package in a controlled way):
npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server
  1. Install via Smithery (for automated deployment):
npx @smithery/cli install @executeautomation/playwright-mcp-server --client claude
  1. Claude Code workflow (adding to Claude using code-like configuration):
claude mcp add --transport stdio playwright npx @executeautomation/playwright-mcp-server

VS Code installation (optional):

  • Use the provided install buttons to add the server into VS Code (either standard or Insiders builds). The server name is playwight and uses the same command and arguments as above.

Browser installation and setup are handled automatically by the server on first use, or can be installed manually with the standard Playwright commands if desired.

Additional notes

Tips and considerations:

  • Standard mode (stdio) is the recommended setup for Claude Desktop and ensures clean JSON-RPC messaging. Logs are written to ~/playwright-mcp-server.log for debugging.
  • HTTP/Standalone mode is suitable when running headed browsers or in environments without a display (e.g., CI, remote workers). Claude Desktop users should use stdio mode.
  • The server automatically installs required browsers (Chromium, Firefox, WebKit) on first use if missing. If you prefer manual control, you can run: npx playwright install (or npx playwright install chromium|firefox|webkit).
  • When running in HTTP mode, endpoints are exposed as SSE and REST-like MCP endpoints (GET/POST). Example: /mcp for unified access, /health for health checks.
  • In VS Code Copilot configurations, point the MCP server to http://localhost:8931/mcp and ensure the transport type is http when using HTTP mode.
  • Environment variables can be added to customize behavior (e.g., logging level, browser download paths). The README does not specify required env vars, but typical usage allows overriding Playwright and server paths as needed.

Related MCP Servers

Sponsor this space

Reach thousands of developers