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 分

    請在儲存庫或註冊中心條目中宣告授權條款。