zen-mcp
zen-mcp
The first MCP server for Zen Browser. Automate Zen from Claude Code, Cursor, or any MCP client.
No Selenium. No Playwright. No browser drivers. Just WebSocket.
Setup (2 minutes)
1. Start Zen with remote debugging
/Applications/Zen.app/Contents/MacOS/zen --remote-debugging-port 9222Pro tip: Add
alias zen='open /Applications/Zen.app --args --remote-debugging-port 9222'to your shell config. Then just runzen.
2. Add to Claude Code
# Option A: npm (recommended)
npm install -g zen-mcp
# Option B: Clone
git clone https://github.com/sh6drack/zen-mcp.git && cd zen-mcp && npm installAdd to ~/.claude/mcp_servers.json:
{
"mcpServers": {
"zen-browser": {
"command": "zen-mcp"
}
}
}If you cloned instead of npm install, use
"command": "node", "args": ["/absolute/path/to/zen-mcp/server.mjs"]
Add to ~/.claude/settings.json:
{
"permissions": {
"allow": ["mcp__zen-browser__*"]
}
}That's it. Start a new Claude Code session and the zen_* tools are available.
20 Tools
Browse
Tool | What it does |
| Go to a URL |
| List all open tabs |
| Switch to a tab |
| Open a new tab |
| Close a tab |
See
Tool | What it does |
| Page structure with selectors (filter: all/interactive/form) |
| Capture a screenshot |
| Get page title, URL, and text |
| List all form fields with labels and values |
Interact
Tool | What it does |
| Click an element |
| Type into an input or textarea |
| Pick a dropdown option |
| Toggle a checkbox or radio |
| Keyboard input (Enter, Tab, Ctrl+A, etc.) |
| Fill multiple fields at once |
| Scroll the page or to an element |
Utility
Tool | What it does |
| Run JavaScript in the page |
| Wait N milliseconds |
| Wait for text or element to appear |
| Force reconnect to Zen |
How It Works
Claude Code ──stdio/MCP──> zen-mcp ──WebSocket/BiDi──> Zen Browserzen-mcp speaks WebDriver BiDi (W3C standard) directly over WebSocket. Form filling uses native value setters with input/change event dispatch so React, Vue, and Angular apps work correctly.
What Works Well
Navigation, clicking, form filling — rock solid, handles React/Vue/Angular
Screenshots and page reads — reliable content extraction
Tab management — open, close, switch between tabs
JavaScript evaluation — run any code in the page context
Keyboard input — shortcuts, Enter, Tab, modifier combos
Known Limitations
Zen inherits Firefox's WebDriver BiDi implementation, which is still maturing. Some advanced BiDi commands that work in Chrome may not be available yet.
Zombie sessions can only be cleared by restarting Zen (BiDi session.end is connection-scoped). zen-mcp detects this and tells you what to do.
No file upload or drag-and-drop support (BiDi spec limitation).
Built-in Reliability
Auto-reconnect with exponential backoff if WebSocket drops
Zombie session recovery when a previous client crashed
Connection retry (3 attempts with backoff)
Clean shutdown on SIGINT/SIGTERM to prevent orphaned sessions
Troubleshooting
Problem | Fix |
"Cannot connect to Zen Browser" | Start Zen with |
"Maximum number of active sessions" | Restart Zen: |
Connection keeps dropping | Use |
Config
Env Variable | Default | Description |
|
| Zen's remote debugging port |
Requirements
Node.js 20+
Test
node test-e2e.mjs # 21 tests, needs Zen runningLicense
MIT
Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sh6drack/zen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server