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.
Related MCP server: Tasker MCP
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
Available Tools
20 toolszen_checkB
Check/uncheck a checkbox or select a radio button
Inputs: selector (required), checked.
zen_clickB
Click an element by CSS selector
Inputs: selector (required).
zen_close_tabA
Close a tab by index. Cannot close the last remaining tab.
Inputs: index (required).
zen_evaluateB
Execute JavaScript in the page and return the result
Inputs: script (required).
zen_fillA
Fill a text input or textarea with a value. Clears existing content first. Dispatches input/change events for framework compatibility.
Inputs: selector (required), value (required).
zen_fill_formA
Fill multiple form fields at once. Each field specifies selector, value, and action (fill/select/check/uncheck/click).
Inputs: fields (required).
zen_get_form_fieldsA
List all form fields on the page with names, types, labels, current values, and CSS selectors
Inputs: no named parameters.
zen_get_page_textA
Get the page title, URL, and visible text content. Useful for quickly understanding what is on the page.
Inputs: maxLength.
zen_list_pagesA
List all open pages/tabs in Zen browser with URLs and titles
Inputs: no named parameters.
zen_new_tabB
Open a new tab, optionally navigating to a URL
Inputs: url.
zen_press_keyA
Send keyboard input to the active page using BiDi input.performActions. Supports special keys like Enter, Tab, Escape, Backspace, and key combinations with modifiers.
Inputs: key (required), modifiers.
zen_reconnectA
Force disconnect and reconnect to Zen Browser. Use when the connection is in a bad state or after restarting Zen.
Inputs: no named parameters.
zen_screenshotB
Take a screenshot of the current page
Inputs: no named parameters.
zen_scrollB
Scroll the page or scroll an element into view
Inputs: direction, amount, selector.
zen_select_optionA
Select an option in a dropdown by value or text
Inputs: selector (required), value (required).
zen_select_pageA
Select a page/tab by index (from zen_list_pages) as the active target
Inputs: index (required).
zen_snapshotA
Get a structured snapshot of visible page elements with CSS selectors. Filter: "all", "interactive", or "form".
Inputs: filter, selector.
zen_waitB
Wait for a specified number of milliseconds
Inputs: ms.
zen_wait_forA
Wait for text to appear on the page, or for a CSS selector to match an element. Returns when found or after timeout.
Inputs: text, selector, timeout.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 20 tools
Each tool serves a distinct browser automation purpose: clicking, filling forms, navigating, taking screenshots, etc. Even similar actions like zen_check and zen_click are clearly differentiated by element type, and zen_fill vs zen_fill_form by scope.
All tools follow the 'zen_verb_noun' pattern with snake_case, e.g., zen_close_tab, zen_get_form_fields, zen_select_option. No mixed conventions or irregular names.
20 tools cover the essential operations for browser automation (navigation, interaction, forms, tabs, debugging) without being overwhelming. Each tool seems necessary and well-scoped.
The tool set covers common browser automation workflows: navigation, click, fill, select, wait, screenshots, and tab management. Minor gaps exist (e.g., file upload, alert handling, iframe support), but core functionality is largely complete.
Maintenance
Related MCP Connectors
A simple MCP server built with FastMCP and python
MCP server to assist with JxBrowser development.
Related MCP Servers
- AlicenseBqualityDmaintenanceA beginner-friendly Model Context Protocol (MCP) server that helps users understand MCP concepts, provides interactive examples, and lists available MCP servers. This server is designed to be a helpful companion for developers working with MCP. Also comes with a huge list of servers you can install.321 npm66Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server for Android's Tasker automation app53MIT
- FlicenseAqualityCmaintenanceUnofficial MCP server for Zen Browser DevTools, enabling AI assistants to inspect and control Zen via Gecko/WebDriver BiDi23213 npm3-
- MIT