Skip to main content

RootBrowse MCP

MCP Server for RootBrowse browser automation framework. 为 AI Agent 提供结构化的浏览器操控能力。

安装

pip install rootbrowse-mcp

Claude Code 配置

在 settings.json 中添加:

{
  "mcpServers": {
    "rootbrowse": {
      "command": "rootbrowse-mcp"
    }
  }
}

或指定路径:

{
  "mcpServers": {
    "rootbrowse": {
      "command": "D:\\path\\to\\.venv\\Scripts\\python.exe",
      "args": ["-m", "rootbrowse-mcp.server"]
    }
  }
}

Tools

页面扫描

  • get_page_regions() — 获取页面所有语义区域
  • get_region_summary(region_xpath) — 获取区域统计摘要
  • match_element(region_xpath, tag, role, text_contains, query, limit) — 按条件筛选元素

浏览器

  • init_browser(headless) — 初始化浏览器(必选,headless 默认 True)
  • get_page(url, timeout) — 打开 URL
  • take_screenshot(path) — 页面截图
  • close_browser() — 关闭浏览器
  • run_js(code, args) — 在浏览器端执行 JavaScript

注意: 使用其他工具前必须先调用 init_browser() 初始化浏览器。

标签页

  • new_tab(url) — 打开新标签页
  • close_tab() — 关闭当前标签页
  • switch_tab(index) — 切换标签页
  • get_tabs_count() — 获取标签页数量

状态

  • save_state(path) — 保存浏览器状态
  • load_state(path) — 恢复浏览器状态

run_js 万能接口

所有元素操作(点击、输入、获取元素信息)都通过 run_js 完成,不单独封装。

数据类型

Region(区域)

{xpath, label}

Element(元素)

{tag, role, text, xpath, attrs}

ElementPreview(元素摘要)

{xpath, text, attrs_preview}

run_js 特殊用法

绕过 DOM 传输限制获取长文本:

run_js("return document.body.innerText.substring(0, 2000)")
run_js("return document.body.innerText.substring(2000, 5000)")

依赖

  • Python >= 3.10
  • rootbrowse >= 0.5.0
  • mcp >= 1.0.0

Metadata

Release files for rootbrowse-mcp 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rootbrowse-mcp 0.4.0
File Size Uploaded Provenance Actions
rootbrowse_mcp-0.4.0.tar.gz 5.4 kB Without provenance Details for rootbrowse_mcp-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rootbrowse-mcp 0.4.0
File Interpreter ABI Platform Actions
rootbrowse_mcp-0.4.0-py3-none-any.whl Python 3 none any Details for rootbrowse_mcp-0.4.0-py3-none-any.whl

Total release size: 11.8 kB

Release files / rootbrowse_mcp-0.4.0.tar.gz

Download URL rootbrowse_mcp-0.4.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7a29d3043f823d3deee9ee5a3314ee6c9e87e94a049b17de6ac1604921cba880
BLAKE2b-256 checksum
How to use checksums
37e235e4e3e3dedb55f1f9f801b8b19209ff0b1e4ef4244134fb333de22f06ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / rootbrowse_mcp-0.4.0-py3-none-any.whl

Download URL rootbrowse_mcp-0.4.0-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7587453aa2a71db93147974288f54b042973e90be01d82fe91bdbd55cb103081
BLAKE2b-256 checksum
How to use checksums
220e6ec12424512850304b1aed8fedb5881d0d91cecfb62f8454afdbfa5e0f56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Security for rootbrowse-mcp 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page