Get the FREE Ultimate OpenClaw Setup Guide →

playwright

MCP server from showfive/playwright-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio showfive-playwright-mcp-server node server.js \
  --env PORT="3000" \
  --env HEADLESS="true" \
  --env USER_AGENT="MCP-Playwright" \
  --env VIEWPORT_WIDTH="1280" \
  --env VIEWPORT_HEIGHT="800"

How to use

This MCP server exposes Playwright-based page content retrieval and interaction tools as MCP endpoints. It can navigate to URLs, fetch full or visible page content, detect interactive elements, and simulate mouse actions such as moving, clicking, scrolling, and drag-and-drop. The included echo tool can be used for basic round-tripping tests to verify the MCP pipeline. To use, start the server and invoke the available tools by name with the specified arguments. For example, navigate to a URL, then request get_all_content to retrieve the page text, or use get_interactive_elements to obtain coordinates of clickable regions on the page. The server is designed to run headless by default but supports viewport and user-agent customization, enabling you to tailor rendering to target sites.

How to install

Prerequisites:

  • Node.js (16.x or newer) and npm installed
  • Access to run npm commands on your environment
  1. Install dependencies locally

    • Navigate to the project directory and run:

    npm install

  2. Install via Smithery (optional)

    • If you use Smithery to deploy automatically, run:

    npx -y @smithery/cli install @showfive/playwright-mcp-server --client claude

  3. Start the server locally

    • Build (if applicable) and start:

    npm run build npm start

  4. Verify the server is running

    • Ensure the configured port (default 3000) is accessible and health checks (if any) pass.

Additional notes

  • Environment variables can customize rendering and interactions: HEADLESS (true/false), VIEWPORT_WIDTH, VIEWPORT_HEIGHT, USER_AGENT. Adjust as needed for target websites.
  • Always respect target site terms of service and robots.txt where applicable.
  • For reliability, consider adding small delays between consecutive requests to mimic natural user behavior.
  • If navigation or element detection fails, check Playwright installation and ensure a compatible browser binary is available in the environment.
  • The echo tool is useful for verifying MCP wiring during integration tests.

Related MCP Servers

Sponsor this space

Reach thousands of developers