Playwright Universal MCP
About
A universal Playwright MCP server for browser automation in containerized environments
Details
- License
- MIT
Explore
- π Multi-browser support: Choose between Chromium, Chrome, Microsoft Edge, Firefox, or WebKit
- π³ Container-friendly: Works in environments with limited privileges (like Docker containers)
- ποΈ Headless/Headful modes: Run in headless mode for server environments or headful mode for debugging
- π οΈ Extensive browser control: Navigate, click, type, take screenshots, and more
- π Multiple page support: Create and manage multiple browser pages/tabs
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Playwright Universal MCPCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
pip install git+https://github.com/microsoft/mcp-python-sdk.git
pipx install playwright-universal-mcp
playwright install chromium
playwright install firefox webkit msedge chrome
python -m venv playwright-mcp-venv
source playwright-mcp-venv/bin/activate
pip install playwright-universal-mcp
playwright install chromium
To use this MCP server with Claude Desktop or other MCP-enabled applications, add the following configuration:
Add the following to your ~/.config/Claude/claude_desktop_config.json file:
json{
"mcpServers": {
"browser": {
"command": "playwright-universal-mcp",
"args": ["--browser", "msedge", "--headless"]
}
}
}
To run the MCP server as a persistent service with PM2:
1. Create a PM2 configuration file:
bashcat > ~/playwright-universal-mcp.config.js << 'EOF'
module.exports = {
apps: [{
name: "playwright-universal-mcp",
script: "playwright-universal-mcp",
args: "--browser msedge --headless",
watch: false,
autorestart: true,
restart_delay: 3000
}]
}
EOF
2. Start the service:
bashpm2 start ~/playwright-universal-mcp.config.js
3. Save the PM2 process list:
bashpm2 save
This MCP server works well in containerized environments. Here's a simple Dockerfile example:
dockerfileFROM python:3.10-slim
RUN apt-get update && apt-get install -y \
wget \
gnupg \
&& rm -rf /var/lib/apt/lists/*
RUN playwright install chromium
navigate
Navigate to a URL
click
Click on an element by selector or text
type
Type text into an input element
get_text
Get text content from an element
get_page_content
Get the current page HTML content
take_screenshot
Take a screenshot of the current page
new_page
Create a new browser page
switch_page
Switch to a different browser page
get_pages
List all available browser pages
wait_for_selector
Wait for an element to be visible on the page
get_browser_info
Get information about the current browser session
The MCP server provides the following tools:
- navigate: Navigate to a URL
- click: Click on an element by selector or text
- type: Type text into an input element
- get_text: Get text content from an element
- get_page_content: Get the current page HTML content
- take_screenshot: Take a screenshot of the current page
- new_page: Create a new browser page
- switch_page: Switch to a different browser page
- get_pages: List all available browser pages
- wait_for_selector: Wait for an element to be visible on the page
- get_browser_info: Get information about the current browser session
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"playwright universal mcp": {
"playwright-universal-mcp": {
"command": "python",
"args": [
"-m",
"venv",
"playwright-mcp-venv"
]
}
}
}
}
McpServers
{
"playwright-universal-mcp": {
"command": "python",
"args": [
"-m",
"venv",
"playwright-mcp-venv"
]
}
}
A universal Model Context Protocol (MCP) server for browser automation that works reliably in containerized environments with limited privileges. It provides browser control capabilities to AI assistants like Claude, GPT-4, etc.
Features
- π Multi-browser support: Choose between Chromium, Chrome, Microsoft Edge, Firefox, or WebKit
- π³ Container-friendly: Works in environments with limited privileges (like Docker containers)
- ποΈ Headless/Headful modes: Run in headless mode for server environments or headful mode for debugging
- π οΈ Extensive browser control: Navigate, click, type, take screenshots, and more
- π Multiple page support: Create and manage multiple browser pages/tabs
Installation
Option 1: Install with pipx (recommended)
```bash
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



