Playwright Web Browser MCP server

Enables web browsing capabilities through Playwright automation for navigating websites, extracting content, identifying interactive elements, and performing browser actions in a containerized Docker environment.
Back to servers
Setup instructions
Provider
Kotelberg
Release date
Mar 18, 2025
Language
TypeScript

The Playwright MCP Server provides web page content retrieval and interaction capabilities through the Model Context Protocol (MCP). This server allows you to navigate web pages, extract content, and simulate user interactions programmatically.

Installation Options

Via Smithery

For automatic installation with Claude Desktop via Smithery:

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

Manual Installation

If you prefer to install manually:

npm install

Getting Started

Starting the Server

Build and start the server with the following commands:

npm run build
npm start

Available MCP Tools

Navigation

navigate: Go to a specified URL

{
  "url": "https://example.com"
}

Content Retrieval

get_all_content: Extract all text content from the current page

{}

get_visible_content: Extract only the visible content from the current page

{
  "minVisiblePercentage": 50
}

Element Detection

get_interactive_elements: Identify clickable elements on the page

{}

Mouse Operations

move_mouse: Position the cursor at specific coordinates

{
  "x": 100,
  "y": 200
}

mouse_click: Perform a click action

{
  "x": 100,
  "y": 200,
  "button": "left",
  "clickCount": 1
}

mouse_wheel: Scroll the page

{
  "deltaY": 300,
  "deltaX": 0
}

drag_and_drop: Move elements with drag and drop

{
  "sourceX": 100,
  "sourceY": 200,
  "targetX": 300,
  "targetY": 400
}

Testing

echo: Simple test tool that returns the provided message

{
  "message": "Hello, MCP!"
}

Usage Notes

  • Be sure to respect the terms of service for websites you interact with
  • Allow appropriate intervals between requests, especially when simulating mouse actions
  • Mouse operations simulate real user interactions, so timing considerations may apply
  • Consider visible content retrieval for more accurate representation of what a user would see

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "playwright-mcp-server" '{"command":"npx","args":["-y","@showfive/playwright-mcp-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

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

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

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

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later