A Docker Compose setup that runs the Microsoft Playwright MCP server with a virtual X11 display accessible via noVNC in your web browser.
- Playwright MCP Server: Browser automation via Model Context Protocol (MCP)
- Headed Browser Mode: See the browser running in real-time
- noVNC Web Interface: View the browser display from any web browser
- Reusable Architecture: Persistent Playwright service that can be accessed via SSE or stdio
- stdio-to-SSE Proxy: Bridge between stdio-based MCP clients and the SSE endpoint
- Start the persistent Playwright + noVNC service:
docker compose up -d playwright-display- Access the services:
- noVNC Web UI: http://localhost:6080/vnc.html
- MCP SSE Endpoint: http://localhost:3080/sse
stdio transport (recommended):
{
"mcpServers": {
"playwright": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--network=playwright-network",
"mcp-playwright-novnc:latest",
"mcp-proxy",
"http://playwright-display:3080/sse"
]
}
}
}SSE transport (direct connection):
{
"mcpServers": {
"playwright": {
"url": "http://localhost:3080/sse"
}
}
}| Variable | Default | Description |
|---|---|---|
SCREEN_WIDTH |
1920 | Virtual screen width in pixels |
SCREEN_HEIGHT |
1080 | Virtual screen height in pixels |
SCREEN_DEPTH |
24 | Color depth |
MCP_PORT |
3080 | MCP server port |
MCP_BROWSER |
chromium | Browser (chromium, firefox, webkit) |
The project includes a docker-compose.yml file with the persistent Playwright + noVNC service.
The Docker image also includes a mcp-proxy script that bridges stdio to SSE, allowing MCP clients using stdio transport to connect to the running Playwright service.
Proxy Usage: The mcp-proxy command accepts the SSE URL as a command-line argument:
mcp-proxy <SSE_URL>You can also use the PLAYWRIGHT_SSE_URL environment variable as a fallback.
You can customize the environment variables in the compose file or via a .env file:
SCREEN_WIDTH=1920
SCREEN_HEIGHT=1080
SCREEN_DEPTH=24
MCP_BROWSER=chromium# Build the Docker image
docker compose build
# Start the service
docker compose up -d
# View logs
docker compose logs -f playwright-display# Test the proxy connection
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | \
docker run --rm -i --network=playwright-network \
mcp-playwright-novnc:latest mcp-proxy http://playwright-display:3080/sseThe setup consists of a single Docker container running:
- Playwright MCP Server (port 3080): Accepts browser automation commands via SSE or stdio
- Chromium Browser: Runs on a virtual display (Xvfb)
- noVNC Web Interface (port 6080): View the browser in real-time via your web browser
- mcp-proxy: Bridges stdio-based MCP clients to the SSE endpoint
The Playwright MCP server provides browser automation tools including:
browser_navigate- Navigate to a URLbrowser_click- Click on elementsbrowser_type- Type text into inputsbrowser_fill_form- Fill form fieldsbrowser_take_screenshot- Capture screenshotsbrowser_snapshot- Capture accessibility snapshotbrowser_tabs- Manage browser tabsbrowser_close- Close the browserbrowser_evaluate- Evaluate JavaScriptbrowser_console_messages- Get console messages- And many more...
Pre-built images are available from GitHub Container Registry:
# Pull the latest image
docker pull ghcr.io/xtr-dev/mcp-playwright-novnc:latest1. Create a docker-compose.yml file:
services:
playwright-display:
image: ghcr.io/xtr-dev/mcp-playwright-novnc:latest
container_name: playwright-display
ports:
- "6080:6080" # noVNC web interface
- "3080:3080" # MCP SSE endpoint
environment:
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1080
- MCP_BROWSER=chromium
networks:
- playwright-network
networks:
playwright-network:
name: playwright-network2. Start the service:
docker compose up -d3. Configure your MCP client:
{
"mcpServers": {
"playwright": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"--network=playwright-network",
"ghcr.io/xtr-dev/mcp-playwright-novnc:latest",
"mcp-proxy",
"http://playwright-display:3080/sse"
]
}
}
}4. Access the browser display:
Open http://localhost:6080 in your web browser to see the Playwright browser in action.
MIT License - see LICENSE file for details