browser-buddy

io.github.hahahahahahahahah6由 GitHub 账号 hahahahahahahahah6 发布v0.1.1更新于 Oct 24, 2026

Let AI coding agents read pages through your real, logged-in Chrome browser.

概览

AI 生成的概览

一个本地 MCP 桥接工具,让编程助手通过你自己已登录的 Chrome 读取网页文本,仅提供两个只读工具。

可以做什么
读取当前标签页:从你已打开的 Chrome 标签页中提取网址、标题和清理后的正文,使用你真实的配置与登录状态。打开并读取网址:用你的 Cookie 和登录状态在后台标签页打开链接,提取文本后自动关闭该标签页。页面文本作为工具内容返回给助手,超长页面在 6 万字符处截断。
适用场景
当助手常规的网页抓取被 403、登录墙、单点登录或机器人检测挡住,而你需要它按你所见读取文档、论坛帖子或私有 issue 时适用。它只读,不能点击、输入或填写表单。
运行要求
仅限桌面版 Chrome 或 Chromium,需在开发者模式下以未打包方式加载扩展,并用安装脚本注册本地消息主机。MCP 服务器需要 Python 3.9 以上,从本地路径或 browser-buddy-mcp 包运行;无需 API 密钥或云账号。
安装前请注意
助手通过你真实的浏览器配置读取,因此能看到你所有已登录会话可见的内容,请仅在信任该助手会话时使用。open_and_read_url 可能被提示注入的页面引导,应在配置文件中设置 allowed_domains 列表;列表为空时允许任意网址。页面文本会进入助手的上下文。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Browser Buddy

[License: MIT] [Chrome MV3] [No dependencies]

Let your coding agent read pages through YOUR real, logged-in browser.

Claude Code's WebFetch gets 403'd on most sites. Ask it to pull up a doc, check a Reddit thread, or look at a GitHub issue, and it comes back with a 403 — because server-side fetchers don't have your cookies, your logins, or your sessions.

Browser Buddy is a small local MCP bridge: a Chrome extension (Manifest V3) talks to a Python native-messaging host, which exposes two MCP tools. Your agent reads pages exactly as you see them — logged in, past bot checks — and the page never leaves your machine except into the agent's context.

Stdlib only. No dependencies, no cloud, no API keys.

Tools

ToolWhat it does
read_active_tabExtract readable text (URL, title, cleaned body) from your active Chrome tab
open_and_read_urlOpen a URL in a background tab with your real profile (cookies/logins), extract its text, close the tab

Architecture

┌─────────────┐   MCP (JSON-RPC 2.0     ┌──────────────────┐  Unix socket   ┌───────────────────┐  Native Messaging  ┌────────────────┐│ Claude Code │ ── over stdio, NDJSON ──▶ │ browser_buddy_mcp  │ ── NDJSON ──▶ │ browser_buddy_host │ ── 4-byte LE ──▶ │ Chrome extension ││             │ ◀────────────────────── │      .py           │ ◀──────────── │       .py          │ ◀── JSON ─────── │ (your profile) │└─────────────┘                          └──────────────────┘                └───────────────────┘                  └────────────────┘         ▲                                        │                                                                     │         │                                        │  one request per socket connection;                                 │  chrome.tabs +         └──────── page text lands here ──────────┘  host routes replies by request id                                  │  chrome.scripting                                                                                                                        ▼                                                                                                              real logged-in page
  • Extension (extension/): MV3 service worker. Holds a persistent chrome.runtime.connectNative port to the host (auto-reconnects). Executes read_active_tab / open_and_read_url against your real tabs and posts extracted text back.
  • Host (host/browser_buddy_host.py): launched by Chrome. Bridges the extension (length-prefixed stdio) and the MCP server (Unix socket at $TMPDIR/browser-buddy/browser-buddy.sock). Correlates requests by id, with a 90 s timeout.
  • MCP server (pypi/browser_buddy_mcp.py): hand-rolled JSON-RPC 2.0 over stdio (no mcp package). Forwards tool calls to the host; returns page text as MCP content.

Installation

1. Load the extension

  1. Open chrome://extensions, enable Developer mode.
  2. Load unpacked → select the extension/ folder.
  3. Copy the extension ID shown under "Browser Buddy".

2. Register the native host

bash
cd host./install.sh <paste-extension-id-here>

This writes com.browserbuddy.host.json into Chrome's NativeMessagingHosts directory (Linux/macOS) pointing at browser_buddy_host.py. Restart Chrome, then open the extension's service worker console — you should see [browser-buddy] native host connected.

3. Add the MCP server to Claude Code

bash
claude mcp add browser-buddy -- python3 /absolute/path/to/pypi/browser_buddy_mcp.py

Or in ~/.claude.json / project .mcp.json:

json
{  "mcpServers": {    "browser-buddy": {      "command": "python3",      "args": ["/absolute/path/to/browser-buddy/pypi/browser_buddy_mcp.py"]    }  }}

Requires Python 3.9+. No pip install needed — or install the published package: pip install browser-buddy-mcp (built from pypi/; the browser-buddy-mcp command is the entry point).

Demo

  1. Log in to a site WebFetch can't reach in your normal Chrome (e.g. a private GitHub issue, a login-walled doc).
  2. In Claude Code: "Use browser-buddy to read my active tab."
  3. Or: "Use browser-buddy's open_and_read_url to read ." — a background tab opens, the text is extracted, the tab closes itself.

Why not just use a scraping API? (Firecrawl et al.)

Vendor scrapers (Firecrawl, etc.) fetch pages server-side: they never have your cookies, can't get past SSO/2FA/login walls, can't see what you see behind an account, and they charge per page. The official Claude in Chrome goes the other way — full autonomous browser control — but ships a permission dialog per tool call (dozens per session) and sits at 2.7 stars on the Chrome Web Store.

Browser Buddy picks the middle: read-only access through the browser you already logged into. No credentials leave your machine, nothing to pay per page, no dialog spam — just "let the agent see what I see."

Limitations (honest)

  • Chrome/Chromium only. The extension is the whole trick; no Chrome, no tool.
  • Read-only by design. It extracts text; it doesn't click, type, or fill forms. That's a feature for trust, but it means CAPTCHAs / interactive gates still stop it.
  • Text extraction is heuristic, not a full readability engine. Heavy SPAs usually work (we wait for load + a settle beat), but exotic layouts may extract noise.
  • Your real profile = real risk surface. The agent sees everything your browser can see. Only install this if you trust the agent session reading your tabs.
  • MV3 service workers are ephemeral. The extension auto-reconnects its native port, but a cold start can add ~1 s to the first call.
  • One request at a time per socket connection is fine for an agent; this is not built for concurrent scraping fleets.
  • Long pages are truncated at 60k characters (flagged with (truncated)).

Security: domain allowlist

open_and_read_url opens URLs in your real, logged-in browser. A prompt-injected page could otherwise steer the agent toward your email or other sensitive sites. Restrict which domains the agent may open:

jsonc
// ~/.config/browser-buddy/config.json{  "allowed_domains": ["github.com", "stackoverflow.com"]}

Entries match the domain and its subdomains (docs.github.com is covered by github.com). When the list is empty (default), any URL is allowed but the server logs a warning recommending you set it. URLs outside the list are refused before anything is opened. read_active_tab is unaffected — it only reads the tab you already opened.

Development

bash
python3 tests/test_smoke.py   # 25 tests: framing, bridge routing, MCP handlers,                              # socket dir, domain allowlistnode --check extension/background.js

License

MIT — see LICENSE.

来源:README.md,提交 01f6142

工具

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

版本历史

1
  1. v0.1.1最新Sep 30, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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