Skip to main content
Glama

browser-tools-mcp

持久的、有头 Chromium 浏览器控制,用于 OpenCode/Claude Code,风格仿照 Claude Code 的浏览器工具。构建于 2026-08-05,因为 OpenCode 没有原生浏览器工具,而 custom-scraper(纯 HTTP)无法读取重 JS 或需要登录的页面。

架构

MCP 服务器进程就是单例浏览器管理器。由于 OpenCode 在整个 CLI 会话期间保持 stdio 服务器存活,浏览器会在各 agent 轮次之间持续存在。如果浏览器崩溃或窗口被关闭,下一次工具调用会透明地重新启动它(server/browser.js)。

启动配置:headless: false, slowMo: 100,视口 1280x800,桌面版 Chrome UA,--disable-blink-features=AutomationControlled

Related MCP server: chrome-mcp

文件

  • server/server.js — MCP 入口点,注册五个工具 + 模式。

  • server/browser.js — 单例浏览器/上下文/页面管理器 + 重启逻辑。

  • server/tools.js — 操作实现(可交互元素树、目标定位、高亮、截图)。

  • server/_self_verify.js — 独立场景测试:npm run verify

  • shots/ — 来自 browser_inspect 的截图。

  • USAGE.md — 面向 agent 的规则(接入 OpenCode 的 instructions)。

工具

工具

用途

browser_navigate(url)

加载一个 URL;返回最终 URL 和标题。

browser_inspect()

截图 + 带数字目标的交互元素树。

browser_click(target)

按检查编号、CSS 选择器或可见文本进行点击。

browser_fill(target, value)

按编号/选择器/文本向字段中输入内容。

browser_request_human(message)

暂停流程并向人类呈现问题。

元素定位符合 Claude Code 约定:browser_inspect 为每个可交互元素分配一个数字 target,在 DOM 中标记为 data-bt-target,以便后续操作解析到完全相同的元素(在带有隐藏输入的页面上,可见性过滤后的索引会相对于不过滤的 .nth() 产生漂移)。点击前元素会被短暂高亮,以便用户看到操作过程。

验证

npm run verify        # navigate -> inspect -> click -> fill -> crash-recovery

已验证于 2026-08-05:example.com 的导航/检查/点击、按目标填充 Google 表单、以及在关闭后重新启动均通过;五个工具均已注册并通过真实的 MCP stdio 协议做出响应。

操作注意事项

  • 有头意味着需要桌面环境。 Chromium 窗口需要交互式会话才能启动;在无头的/断开连接的机器上启动会失败——请如实报告而不是假装成功。

  • 隔离的浏览器。 这不是 Luigi 的已登录 Chrome(那是 chrome-bridge)。没有已登录的会话,没有扩展,完整的写入权限。

  • 人工把关。 未经明确指示不得登录/下单/发送;browser_request_human 表示在人工回答之前停止。

  • 已在 ~/.config/opencode/opencode.jsonc 中注册为 browser-tools MCP 服务器;使用规则通过 USAGE.md 接入 instructions

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    B
    maintenance
    Enables Claude Code to control a real browser using AI for web scraping, competitive intelligence, and UX auditing through the MCP protocol.
  • A
    license
    B
    quality
    A
    maintenance
    Enables controlling a real Chrome browser from MCP hosts like Claude, with extension-based or CDP fallback, supporting tabs, navigation, interaction, and page reading tools.
    33
    265
    5
    MIT
  • A
    license
    -
    quality
    B
    maintenance
    Enables Codex to control a visible Chromium browser via MCP tools for navigation, page inspection, and interaction, while keeping sensitive steps like login and captcha under the user's control.
    3
    1
    MIT

View all related MCP servers

Related MCP Connectors

  • Hosted real Google Chrome MCP with per-user persistent state. Navigate, click, type, screenshot.

  • Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.

  • Live browser debugging for AI assistants — DOM, console, network via MCP.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luigimasango-dev/browser-tools-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server