Home / MCP / Playwright SSE MCP Server

Playwright SSE MCP Server

Provides an SSE-based MCP server to drive Playwright from MCP clients across containers or the host.

other
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "playwright_sse_http_local": {
            "url": "http://localhost:3002/sse"
        }
    }
}

This MCP server exposes Playwright as a model context protocol endpoint over Server-Sent Events, letting MCP clients drive Playwright browser actions from your containerized or local environment. It supports connecting from other containers on the same network, from the host, or from development tools that integrate with MCP, giving you a flexible way to automate browser interactions at scale.

How to use

Connect to the Playwright MCP Server from other containers on the same mcp-network using the SSE endpoint. You supply the server URL with the /sse path and, if needed, the port you started the server on.

From a host machine, connect to the server using the host’s address and the server port, followed by /sse. This lets you drive Playwright from tooling running outside the container network.

If you are using Roo Code or a similar client, configure the MCP server URL to point to the server’s SSE endpoint. The examples below show typical local and container-based URL configurations.

Container-to-container example (within the same Docker network): use the container name as the host and the port you started on. This enables name resolution inside the network.

Host-to-container example (development workflow): use host.docker.internal on Docker Desktop or the gateway IP on Linux to reach the MCP server through the host machine.

The server is headless and communicates with MCP clients via SSE, enabling automated browser actions without a visible UI.

How to install

Prerequisites you need on your machine before starting the server.

# Ensure Docker is installed

# Ensure docker-compose is installed

# Create the external Docker network if it does not exist
docker network create mcp-network 2>/dev/null || true

Start the server in the default configuration (port 3002) by building and running the containers in the project root. This will start the MCP server and expose the SSE endpoint on port 3002.

# Change to the project root
cd /path/to/installation

docker compose up --build

If you want to use a custom port, set PORT before starting the containers. The server will log the port it is running on.

PORT=4000 docker compose up --build

Additional notes

You can configure client applications to connect via several MCP endpoints depending on your environment. The following HTTP configurations illustrate typical setups.

{
  "mcpServers": {
    "playwright-sse-mcp-server-local": {
      "url": "http://localhost:3002/sse"
    }
  }
}

If you run the server in a container and access it from another container in the same Docker network, you can use the container name as the host and keep the port the same (default 3002). For example, from another container on the same DNS-based network: http://playwright-sse-mcp-server:3002/sse.

From the host, you can also use host.docker.internal on Docker Desktop or the bridge gateway IP on Linux to reach the server, for example: http://host.docker.internal:3002/sse or http://172.17.0.1:3002/sse depending on your environment.

Available tools

startServer

Start the MCP server with the provided script or command to bring up the SSE endpoint.

stopServer

Stop the running MCP server and clean up resources.

showLogs

Display the server logs to monitor activity and errors.