Zen Mcp

io.github.sh6drack由 GitHub 账号 sh6drack 发布v1.2.1更新于 Nov 3, 2026

MCP server for Zen Browser automation via WebDriver BiDi

概览

AI 生成的概览

通过 WebDriver BiDi 让助手操控 Zen 浏览器的 MCP 服务器:导航、读取页面、点击、填写表单和截图。

可以做什么
  • 导航与标签页管理:打开网址,列出、切换、新建和关闭标签页
  • 页面查看:带选择器的页面结构快照、截图、页面标题/网址/正文、表单字段列表
  • 元素交互:点击、输入文本、选择下拉项、勾选复选框或单选框、按键、批量填写表单、滚动页面
  • 实用工具:在页面中执行 JavaScript、等待指定时间或等待文本/元素出现、强制重新连接
适用场景
适合需要助手操作用户桌面上真实 Zen 浏览器会话的场景,例如浏览网站、读取页面内容、填写并提交网页表单或检查界面行为,且不想引入 Selenium、Playwright 或额外浏览器驱动。
运行要求
需安装 Zen 浏览器并以远程调试模式启动(默认端口 9222,可通过 ZEN_DEBUG_PORT 修改)。需要 Node.js 20+ 及 zen-mcp npm 包(或本地克隆)。仅限桌面端,MCP 客户端通过 stdio 连接。
安装前请注意
助手可在用户已登录的浏览器中操作:点击、输入、提交表单并在页面上下文执行任意 JavaScript,可能改动或发送浏览器已登录网站上的数据。远程调试会开放本地端口,本机其他进程也可能使用。部分 BiDi 功能受限,会话卡死时可能需要重启 Zen。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Zen Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

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

bash
/Applications/Zen.app/Contents/MacOS/zen --remote-debugging-port 9222

Pro tip: Add alias zen='open /Applications/Zen.app --args --remote-debugging-port 9222' to your shell config. Then just run zen.

2. Add to Claude Code

bash
# Option A: npm (recommended)npm install -g zen-mcp
# Option B: Clonegit clone https://github.com/sh6drack/zen-mcp.git && cd zen-mcp && npm install

Add to ~/.claude/mcp_servers.json:

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:

json
{  "permissions": {    "allow": ["mcp__zen-browser__*"]  }}

That's it. Start a new Claude Code session and the zen_* tools are available.

20 Tools

Browse

ToolWhat it does
zen_navigateGo to a URL
zen_list_pagesList all open tabs
zen_select_pageSwitch to a tab
zen_new_tabOpen a new tab
zen_close_tabClose a tab

See

ToolWhat it does
zen_snapshotPage structure with selectors (filter: all/interactive/form)
zen_screenshotCapture a screenshot
zen_get_page_textGet page title, URL, and text
zen_get_form_fieldsList all form fields with labels and values

Interact

ToolWhat it does
zen_clickClick an element
zen_fillType into an input or textarea
zen_select_optionPick a dropdown option
zen_checkToggle a checkbox or radio
zen_press_keyKeyboard input (Enter, Tab, Ctrl+A, etc.)
zen_fill_formFill multiple fields at once
zen_scrollScroll the page or to an element

Utility

ToolWhat it does
zen_evaluateRun JavaScript in the page
zen_waitWait N milliseconds
zen_wait_forWait for text or element to appear
zen_reconnectForce reconnect to Zen

How It Works

Claude Code  ──stdio/MCP──>  zen-mcp  ──WebSocket/BiDi──>  Zen Browser

zen-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

ProblemFix
"Cannot connect to Zen Browser"Start Zen with --remote-debugging-port 9222
"Maximum number of active sessions"Restart Zen: killall zen && zen
Connection keeps droppingUse zen_reconnect to force a fresh connection

Config

Env VariableDefaultDescription
ZEN_DEBUG_PORT9222Zen's remote debugging port

Requirements

Test

bash
node test-e2e.mjs   # 21 tests, needs Zen running

License

MIT

来源:README.md,提交 76aa1e7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.2.1最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。