Playwright Mcp Wrapper
FreeNot checkedA wrapper for PlayWright MCP server, to manage it easily for devcontainers
About
A wrapper for PlayWright MCP server, to manage it easily for devcontainers
README
Reliable Playwright MCP servers for Docker/DevContainer development
The Problem This Solves
When developing inside Docker containers, you can't run browsers directly in the container. To use Playwright via MCP, you need to:
- Run Playwright MCP servers on your host machine
- Connect from your container to the host ports
- Deal with frequent crashes of the MCP servers during development
This wrapper solves the crashing problem by using PM2 to automatically restart Playwright MCP servers when they crash, making container-based development reliable.
What It Does and How
What it does: This tool creates a reliable bridge between containerized development environments and browser automation by running persistent Playwright MCP servers on your host machine.
How it works:
- Process Management: Uses PM2 to spawn and monitor 6 separate Playwright MCP server processes
- Auto-Recovery: Monitors each server process and automatically restarts them when they crash or become unresponsive
- Port Allocation: Assigns dedicated ports (8931-8936) to each browser type for consistent access
- Container Bridge: Exposes servers on host network interfaces so containers can connect via
host.docker.internalor host IP - Zero Configuration: Pre-configured browser settings, profiles, and output directories eliminate manual setup
Result: Developers get reliable, always-available browser automation from any container without dealing with crashes or complex networking setup.
Quick Start
npm install -g pm2 playwright # Install dependencies
npm install # Install project
npm start # Start all browsers
npm stop # Stop all servers
npm test # Test all endpoints
🧪 MCP Client Configuration
Configure your project to use these Playwright MCP servers based on your environment:
📋 Local Development
Simple MCP server configuration, change the port and names as per your need.
{
"mcpServers": {
"playwright-chrome": {
"transport": {
"type": "sse",
"url": "http://localhost:8932/sse"
}
},
"playwright-brave": {
"transport": {
"type": "sse",
"url": "http://localhost:8933/sse"
}
},
}
}
🐳 DevContainer/Docker
For containers, replace localhost with:
- Docker:
host.docker.internal:[PORT]/sse - Alternative: Your host IP like
192.168.1.100:[PORT]/sse
🌐 All Available Browsers
| Browser | Port | Profile Type |
|---|---|---|
| Chrome | 8932 | Default |
| Brave | 8933 | Default |
| Firefox | 8934 | Default |
| Chromium | 8931 | Default |
| WebKit | 8935 | Default |
| Comet | 8936 | Default |
| Brave Persistent | 8941 | Persistent |
| Comet Persistent | 8942 | Persistent |
🔍 Testing Your Configuration
npm test # Verify all servers are responding
This tests both MCP and SSE endpoints for all browsers and reports their status.
Customization
Browser Configuration Options
Each browser config file (configs/[browser].json) supports these key settings:
Isolated Mode (important for multiple instances):
"isolated": true- Each server gets a separate browser profile (recommended for running multiple servers)"isolated": false- Servers share the same browser profile (may cause conflicts)
User Data Directory:
"userDataDir": "./profiles/[browser]"- Where browser profile data is stored (cookies, sessions, etc.)
Launch Options:
"headless": false- Show browser window (useful for debugging)"channel"- Browser channel (chrome, firefox, chromium)"executablePath"- Custom browser binary path (required for Brave, Comet)
Context Options:
"viewport": { "width": 1920, "height": 1080 }- Default window size
Other Settings:
"capabilities"- Features enabled (tabs, install, pdf, vision)"outputDir"- Where screenshots and downloads are saved
Example Configuration
{
"browser": {
"browserName": "chromium",
"isolated": true,
"userDataDir": "./profiles/chrome",
"launchOptions": {
"channel": "chrome",
"headless": false,
"args": ["--disable-blink-features=AutomationControlled"]
}
},
"server": {
"port": 8932,
"host": "0.0.0.0"
}
}
PM2 Settings
Edit ecosystem.config.js to adjust:
- Memory limits (default: 1GB per process)
- Restart policies (default: max 10 restarts)
- Logging configuration
- Environment variables
All servers auto-restart on crash with memory limits and structured logging.
Installing Playwright Mcp Wrapper
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/ssv445/playwright-mcp-wrapperFAQ
Is Playwright Mcp Wrapper MCP free?
Yes, Playwright Mcp Wrapper MCP is free — one-click install via Unyly at no cost.
Does Playwright Mcp Wrapper need an API key?
No, Playwright Mcp Wrapper runs without API keys or environment variables.
Is Playwright Mcp Wrapper hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Playwright Mcp Wrapper in Claude Desktop, Claude Code or Cursor?
Open Playwright Mcp Wrapper on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Playwright
Browser automation, scraping, screenshots
by MicrosoftPuppeteer
Browser automation and web scraping.
by modelcontextprotocolGarmin Connect
An MCP server for Garmin Connect that provides access to fitness activities, health statistics, and sleep data by routing requests through a headless browser to
by etweisbergHiggsfield Unlimited
MCP server for Higgsfield AI that enables unlimited-mode image, video, audio generation, uploads, and job management via multiple parallel accounts, using brows
by nukIeeropentabs-dev/opentabs
Plugin-based server and Chrome extension that gives AI agents access to web apps through your authenticated browser session, with a plugin SDK.
by opentabs-devhlydecker/ucsc-genome-mcp
Interact with the UCSC Genome Browser API to find genomes, chromosomes and more.
by hlydecker34892002/bilibili-mcp-js
Search Bilibili content, with LangChain integration examples.
by 34892002achiya-automation/safari-mcp
Native Safari browser automation without a Chrome dependency.
by achiya-automationagent-infra/mcp-server-browser
Browser automation using Puppeteer, supporting local and remote browser connections.
by bytedanceaparajithn/agent-scraper-mcp
Web scraping: clean content extraction, CSS-selector scraping, Playwright screenshots, link and metadata extraction, and Google search.
by aparajithn