Repository navigation
Releases
v0.2.1 — tab persistence fixes + release gate
Tabs now survive crashes, and a release can no longer ship untested.
Fixed: tabs lost after a crash or restart
If the MCP server died (or was force-killed) shortly after opening tabs, the next start could come back with only one tab — or none. Three separate causes, all fixed:
- Tab structure changes were only coalesced for 600 ms before being written. Tab add/close now persist immediately; navigation URLs still coalesce.
- The persisted session was read too late — the startup blank page was adopted and saved first, overwriting the file the restore step was about to read.
- A new tab reported
about:blankat creation time. That blank URL was what survived a crash and got filtered out on restore; the real URL now triggers a save as soon as it arrives.
Also fixed: two concurrent saves could fight over the same .tmp file (single-flight guard added), and shutdown now forces a save while skipping per-tab title lookups, so quitting never lags.
Fixed: Linux process cleanup could kill the server itself
On macOS/Linux the orphan-browser cleanup matched the whole command line for chrome|msedge. The server's own --channels chrome,msedge argument matched, so the server killed its own process. It now matches the executable name only. Windows was unaffected (it filters by process name).
Changed: releases are gated on tests
New ci.yml runs build + version check + the full smoke suite headless on ubuntu-latest and windows-latest for every push and PR. publish.yml reuses it via workflow_call and now needs it — a v* tag can no longer publish an untested package.
The smoke suite grew from 40 to 42 checks, including a new case that opens 3 tabs, SIGKILLs the server 200 ms later, and asserts all 3 come back. That test was red before the persistence fix.
Also in this release
- Cross-platform orphan-process cleanup (
pson macOS/Linux, process query on Windows). - Cursor plugin manifest, plus listings on LobeHub, Glama, mcpservers.org and awesome-mcp-servers.
- CI badge on both READMEs.
Install
npx browser-ref-mcp@0.2.1
# or
npm i -g browser-ref-mcp@0.2.1Published with provenance — verify with npm audit signatures.
中文说明
标签再也不怕崩了,发布也不会再发出去没测过的包。
修复:崩溃或重启后丢失标签
MCP server 在开完标签后不久挂掉(或被强杀),下次启动可能只剩一个标签、甚至一个都没有。三个独立原因,都已修掉:
- 标签结构变化原本要等 600ms 合流才落盘。现在新增/关闭标签立即落盘,导航 URL 仍走合流避免狂写。
- 持久化会话读得太晚:启动时那个空白页先被 adopt 并落盘,把恢复步骤要读的文件覆盖成了「一个空白页」。
- 新标签创建时 URL 还是
about:blank。崩溃时留下的就是这个空白地址,恢复时又被当空标签过滤掉;现在真实 URL 一到就立即落盘。
另外还修了两处:并发保存会争抢同一个 .tmp 文件(已加单飞保护),退出时会强制落盘并跳过逐个取标题,不会拖慢关闭。
修复:Linux 上清理进程会把 server 自己杀掉
macOS/Linux 上清理孤儿浏览器的逻辑按整行命令行匹配 chrome|msedge,而 server 自己的 --channels chrome,msedge 参数正好命中,于是把自己 SIGKILL 了。现在只匹配可执行文件名。Windows 不受影响(按进程名过滤)。
变更:发布必须先过测试
新增 ci.yml,每次 push / PR 都在 ubuntu-latest 与 windows-latest 上跑 build + 版本校验 + 全量无头冒烟测试。publish.yml 通过 workflow_call 复用并 needs 它——推 v* tag 再也不可能发出没测过的包。
冒烟测试从 40 项增至 42 项,新增用例会开 3 个标签、200ms 后 SIGKILL server,断言 3 个全部恢复。修复之前这条是红的。
其他
- 跨平台的孤儿进程清理(macOS/Linux 用
ps,Windows 用进程查询)。 - Cursor 插件清单;上架 LobeHub、Glama、mcpservers.org、awesome-mcp-servers。
- 两个 README 都加了 CI 徽章。
安装
npx browser-ref-mcp@0.2.1
# 或
npm i -g browser-ref-mcp@0.2.1带 provenance 发布,可用 npm audit signatures 校验。
v0.2.0 — English tool descriptions, Claude Code plugin, registry listings
English tool descriptions, a Claude Code plugin, and listings on the official MCP Registry and LobeHub.
Tool descriptions are now English
All 14 browser_* descriptions and parameter docs were rewritten in English. Tool descriptions are what the model reads when deciding which tool to call — for non-Chinese agents this removes a real source of mis-selection. The server itself was never Chinese-only, but its self-description was.
Shipped as a Claude Code plugin
plugin/.claude-plugin/plugin.json+plugin/.mcp.json— install the server straight from the plugin marketplace.plugin/skills/browser-control/SKILL.md— a skill that tells the agent how to drive the browser well (snapshot first, act on refs, re-snapshot after navigation) rather than just exposing tools.plugin/logo.svg+ renderedlogo.png.
Listed in more places
- Official MCP Registry (
server.json,io.github.zy2755/browser-ref-mcp). - LobeHub marketplace (
lhm.plugin.json, generated byscripts/lhm-manifest.mjs). - Marketplace icons are served through jsDelivr —
raw.githubusercontent.comis unreliable from mainland China, and a broken icon is a bad first impression.
Version numbers stay in sync
The version now lives in six places (package.json, server.json ×2, two plugin manifests, lhm.plugin.json). npm version triggers scripts/sync-version.mjs, which rewrites them all and stages them for you; npm run check-version verifies consistency without modifying anything.
Install
npx browser-ref-mcp@0.2.0中文说明
英文工具描述、Claude Code 插件,以及官方 MCP Registry 与 LobeHub 上架。
工具描述改为英文
14 个 browser_* 工具的描述与参数说明全部重写为英文。工具描述是模型决定「该调哪个工具」时读的东西——对非中文的 agent 来说,这能消除一个真实的误选来源。server 本身从来不是只支持中文,但它的自我描述曾经是。
以 Claude Code 插件形式分发
plugin/.claude-plugin/plugin.json+plugin/.mcp.json—— 可从句插件市场直接安装。plugin/skills/browser-control/SKILL.md—— 一个教 agent 怎么用好这套工具的 skill(先快照、按 ref 操作、导航后重新快照),而不只是把工具挂出去。plugin/logo.svg与渲染出的logo.png。
更多上架渠道
- 官方 MCP Registry(
server.json,io.github.zy2755/browser-ref-mcp)。 - LobeHub 市场(
lhm.plugin.json,由scripts/lhm-manifest.mjs生成)。 - 市场图标走 jsDelivr —— 国内访问
raw.githubusercontent.com不稳定,图标裂开的第一印象太差。
版本号保持同步
版本号现在散落在 6 处(package.json、server.json ×2、两份插件清单、lhm.plugin.json)。npm version 会触发 scripts/sync-version.mjs 全部重写并自动暂存;npm run check-version 只校验、不改文件。
安装
npx browser-ref-mcp@0.2.0v0.1.1 — first npm release
First public release of browser-ref-mcp on npm.
A browser-control MCP server built around one idea: give the agent [ref] numbers instead of CSS selectors, and keep the browser session self-healing so it does not drop out mid-task.
What's inside
- 14
browser_*tools — navigate, snapshot, click, type, select, checkbox, scroll, hover, key press, evaluate, screenshot, wait, tabs, and a lightweightbrowser_get_infohealth probe. - Semantic snapshots with
[eN]refs — the agent gets a compact tree of what is actually on the page (including open shadow roots and cross-origin iframes, flattened into one tree) and acts on refs instead of fragile selectors. - Stale-ref recovery — if a ref no longer resolves, the tool re-locates the element by role + accessible name before failing.
- Self-healing sessions — the browser is launched lazily and restarted on crash; open tabs are persisted to disk and restored on the next start.
- Persistent, isolated profile —
~/.browser-mcp/profilekeeps logins across restarts, and stays completely separate from your everyday browser.
Distribution and packaging
- Published to npm with OIDC Trusted Publishing — no long-lived token in CI, provenance attached.
- Bilingual docs:
README.md(English) andREADME.zh-CN.md. - Apache-2.0 licensed.
- Listed on Glama.
Install
npx browser-ref-mcp@0.1.1中文说明
browser-ref-mcp 在 npm 上的首个公开版本。
一个围绕两个想法做的浏览器控制 MCP server:给 agent 发 [ref] 编号而不是 CSS 选择器;让浏览器会话自愈,不会干到一半掉线。
包含什么
- 14 个
browser_*工具 —— 导航、快照、点击、输入、下拉、复选框、滚动、悬停、按键、执行 JS、截图、等待、标签页管理,以及轻量的browser_get_info健康查询。 - 带
[eN]编号的语义快照 —— agent 拿到的是页面实际内容的紧凑树(开放的 shadow root 与跨源 iframe 都会拍平进同一棵树),按 ref 操作,不依赖脆弱的 CSS 选择器。 - 失效 ref 自动恢复 —— ref 解析不到时,先按 role + 可访问名重新定位,再决定是否报错。
- 会话自愈 —— 浏览器懒启动、崩溃后自动重启;打开的标签会落盘,下次启动恢复。
- 持久且隔离的 profile ——
~/.browser-mcp/profile让登录态跨重启保留,同时与你日常浏览器完全隔离。
分发与打包
- 通过 OIDC Trusted Publishing 发布到 npm —— CI 里没有长期 token,附带 provenance。
- 双语文档:
README.md(英文)与README.zh-CN.md。 - Apache-2.0 许可。
- 已在 Glama 上架。
安装
npx browser-ref-mcp@0.1.1