SZ

sh6drack/zen-mcp

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

28 stars 6 forks 质量 57 趋势 0

Zen浏览器的第一个MCP服务器。20个工具。没有Selenium,没有Playwright,只有WebSocket。

概览

第一台 MCP 服务器。从 Claude Code、Cursor 或任何 MCP 客户端自动化 Zen。 没有Selenium。没有Playwright。没有浏览器驱动。只有WebSocket。 : 在你的shell配置中添加别名zen='open /Applications/Zen.app --args --remote-debugging-port 9222'。然后直接运行zen。 如果你是克隆而不是npm安装,可以用“command”: “node”, “args”: [“/absolute/path/to/zen-mcp/server.mjs”] 启动新的 Claude Code 会话,zen_* 工具即可使用。 zen-mcp 直接通过 WebSocket 表达(W3C 标准)。表单填充使用原生值设置器,支持输入/变更事件调度,使 React、Vue 和 Angular 应用能正常工作。 - — 非常稳定,能处理 React/Vue/Angular - — 可靠的内容提取 - — 打开、关闭、切换标签页 - — 在页面上下文中运行任何代码 - — 快捷键、回车、制表键、修饰键组合 - Zen 继承了 Firefox 的 WebDriver BiDi 实现,该实现仍在成熟阶段。一些在 Chrome 上可用的高级 BiDi 命令可能尚未可用。

概述(AI 翻译)

Zen浏览器的首个MCP服务器。通过Claude Code、光标或任何MCP客户端自动化Zen。

没有Selenium。没有Playwright。没有浏览器驱动。只有WebSocket。

布置(2分钟)

1.用远程调试开始 Zen

专业提示:在你的shell配置中添加alias zen='open /Applications/Zen.app --args --remote-debugging-port 9222'。然后运行zen。

2.添加到Claude代码中

添加到~/.claude/mcp_servers.json:

如果你是克隆而不是 npm 安装,请使用 "command": "node", "args": ["/absolute/path/to/zen-mcp/server.mjs"]

添加到~/.claude/settings.json:

就是这样。 启动新的 Claude Code 会话,zen_* 工具即可使用。

20 工具

浏览

工具 它的作用
zen_navigate 访问网址
zen_list_pages 列出所有打开的标签页
zen_select_page 切换到标签页
zen_new_tab 打开新标签页
zen_close_tab 关闭标签页

看

工具 它的作用
zen_snapshot 带有选择器的页面结构(筛选:全部/交互/表单)
zen_screenshot 截图
zen_get_page_text 获取页面标题、网址和文本

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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

/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

# 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 install

Add 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
zen_navigate Go to a URL
zen_list_pages List all open tabs
zen_select_page Switch to a tab
zen_new_tab Open a new tab
zen_close_tab Close a tab

See

Tool What it does
zen_snapshot Page structure with selectors (filter: all/interactive/form)
zen_screenshot Capture a screenshot
zen_get_page_text Get page title, URL, and text
zen_get_form_fields List all form fields with labels and values

Interact

Tool What it does
zen_click Click an element
zen_fill Type into an input or textarea
zen_select_option Pick a dropdown option
zen_check Toggle a checkbox or radio
zen_press_key Keyboard input (Enter, Tab, Ctrl+A, etc.)
zen_fill_form Fill multiple fields at once
zen_scroll Scroll the page or to an element

Utility

Tool What it does
zen_evaluate Run JavaScript in the page
zen_wait Wait N milliseconds
zen_wait_for Wait for text or element to appear
zen_reconnect Force 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

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "zen-browser": { "command": "zen-mcp" } } }