Substrate Browser

io.github.manuelinuxkr由 GitHub 账号 manuelinuxkr 发布v2.0.2更新于 Oct 24, 2026

Token-first headless browser for AIs. Extracts a tiny semantic graph, cutting HTML bloat by 95%.

概览

AI 生成的概览

本地 MCP 服务器,驱动无头 Chromium 浏览器并返回精简的页面语义图,让助手以较低 token 成本浏览和操作网页。

可以做什么
  • 打开网址并返回带像素坐标的压缩页面元素图,最多 400 个元素
  • 按数字 ID 点击元素、在输入框中输入文字、选择下拉选项、按键
  • 滚动页面、截图并同时返回元素图、前进或后退浏览历史
  • 查询当前网址
适用场景
适合需要让助手真实浏览网站、填写表单或点击操作的场景,同时避免读取原始 HTML 或解读截图带来的高 token 消耗。
运行要求
以 stdio 方式在本机运行,通常通过 npx substrate-browser 启动。需要 Node.js 20 或更高版本,首次运行会由 Playwright 下载 Chromium。可选环境变量 SUBSTRATE_PROXY、SUBSTRATE_VIEWPORT_WIDTH、SUBSTRATE_VIEWPORT_HEIGHT 用于设置出口代理和视口尺寸。未声明身份验证。
安装前请注意
浏览器会在真实网站上执行操作:点击、输入、提交表单和跳转都可能修改或发送数据。访问的页面和输入的内容会经浏览器离开本机,可能经由 SUBSTRATE_PROXY 指定的代理。元素密集的页面会在 400 个元素处截断,部分内容可能缺失。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Substrate Browser,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Substrate

Stop wasting 48K tokens to read a webpage. Substrate compresses a typical content page into roughly 1–4K tokens your LLM can actually use — vs. ~48K of raw HTML.

Substrate is an MCP server that gives your AI agent eyes and hands on the web. It extracts a compressed semantic graph of any webpage — buttons, inputs, links, dropdowns, checkboxes — with precise pixel coordinates, and handles clicking, typing, and selection via spatial coordinates. No CSS selectors. No xpaths. No hallucination.

Why It Matters

Every other browser automation approach burns tokens on noise:

ApproachTokensExtractionWhat Your LLM Gets
Raw HTML (page.content())~48,0005msFull DOM tree — scripts, styles, hidden elements, ad markup. LLM drowns in noise and hallucinates clicks on invisible elements.
Vision (screenshot + OCR)~8,000~800msA pixel blob. LLM can "see" the page but can't target anything precisely. Clicks land 20px off. Forms fail.
Substrate~1,000–4,000~10–30msStructured JSON: what each element is, where it is, what state it's in. LLM clicks the right thing on the first try.

The math: a ~110-element content page (say, Wikipedia) compresses to roughly ~2,300 tokens — about 1.8% of a typical 128K context window. You can fit roughly ~55 page extractions before the LLM runs out of room. With raw HTML, you get 2.

Token figures are order-of-magnitude, measured live on representative pages (example.com ~84 tok, Wikipedia ~3.5K, Hacker News front page ~4.4K, extraction 8–58ms). They scale with page density; the extractor caps output at MAX_ELEMENTS=400, so very dense pages are truncated rather than emitted in full. The math is arithmetic: on a ~2.3K-token page, ⌊128K/2.3K⌋ ≈ 55 extractions.

The real win — shorter action loops:

Without Substrate:                          With Substrate:navigate → screenshot                       navigate→ "I see a button" → click (wrong)          → {btn id=3 "Submit" [640,400]}→ screenshot → "ah, more right"             → click(3) → done.→ click → "not that either"                 → screenshot → ...                          2 tool calls. Task complete.8-12 tool calls. Task complete.

That's not a marginal improvement. That's 5-6x fewer API calls, 5-6x less latency, and 5-6x lower cost per web task.

How It Works

Substrate runs as a headless Chromium browser via the Model Context Protocol (MCP). Your LLM agent talks to it through 10 simple tools:

ToolWhat It Does
navigateLoad a URL, get back the page graph (capped at 400 elements)
clickClick any element by its numeric ID
type_textType into an input field (auto-clears first)
select_optionPick a dropdown option by value
press_keyPress a keyboard key (Escape, Enter, Tab, arrows, modifiers)
scrollScroll up/down by 80% of viewport
screenshotGet a visual snapshot + the graph together
go_back / go_forwardBrowser history navigation
get_current_urlCheck where you are

Every navigation and interaction tool returns the same compressed graph (get_current_url returns just the URL; screenshot returns the image plus the graph). Your LLM reads the graph, picks an element ID, and calls the next tool. No image interpretation. No HTML parsing. Just IDs and coordinates.

Installation & Setup

Substrate is a standalone Model Context Protocol (MCP) server. You do not need to write code to use it — you just plug it into your AI assistant.

Option 1: Claude Desktop (Recommended)

  1. Open your Claude Desktop configuration file:
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the substrate-browser server to the mcpServers block:
json
{  "mcpServers": {    "substrate-browser": {      "command": "npx",      "args": ["-y", "substrate-browser"]    }  }}
  1. Restart Claude Desktop. You will now see the 10 browser tools available (a small hammer icon) and you can ask Claude to "Go to example.com and tell me what you see".

(Note: Playwright will automatically download the Chromium binary on the very first run. This requires Node.js 20+ installed on your system).

Option 2: Running from Source (For Developers)

If you want to modify the extraction logic or add your own tools:

bash
git clone https://github.com/manuelinuxkr/substrate-b.gitcd substrate-bnpm installnpx playwright install chromiumnpm run buildnpm start

License

MIT

来源:README.md,提交 803c64b

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v2.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分