MCP Browser

io.github.brainfuel由 GitHub 账号 brainfuel 发布v1.0.1更新于 Oct 24, 2026

Native macOS browser exposing an MCP server so AI agents can drive a real WKWebView.

概览

AI 生成的概览

一款原生 macOS 浏览器,将自身作为本地 MCP 服务器暴露,让 AI 助手驱动真实的 WKWebView 窗口进行导航、点击、填表和读取页面。

可以做什么
导航与标签页:打开网址、前进后退、刷新、新建、切换和关闭标签页,读取当前网址和标题。操作 DOM:点击、填写、提交、悬停、按键、输入文本、滚动、页内查找、获取元素和无障碍树。读取页面内容:提取文本、页面数据和元数据、截图、导出 PDF、渲染 HTML、执行 JavaScript、列出链接和表单。管理 Cookie 与存储:读取和设置 Cookie、查看存储、清除会话。检查活动:控制台日志、网络日志、对话框,以及书签、下载和需用户许可的上传。
适用场景
适合需要助手在 Mac 上的真实浏览器窗口中操作、共享你已登录的会话并看到与你相同页面的场景,而非无头或云端浏览器。适用于本地填表、阅读页面、截图和调试网页。
运行要求
macOS 14 或更高版本;以已签名 DMG 形式提供 Apple Silicon 版本。服务器通过本地 HTTP 在 8833 端口(可配置)运行,需要从设置中获取每次启动生成的 bearer 令牌,并以 Authorization 请求头发送。从源码构建需要 Xcode 16 或更高版本。
安装前请注意
应用以非沙盒方式运行,可修改 MCP 客户端配置文件并打开外部协议链接。工具可点击、填写、提交、设置 Cookie、清除会话、执行 JavaScript、下载和上传文件;下载、上传和对话框需用户确认。bearer 令牌存储在 UserDefaults 中,重新生成后需重新写入客户端配置。声称无遥测、无云同步。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Browser

A native macOS web browser that exposes itself as a Model Context Protocol server, so AI agents can drive a real WKWebView the same way a person would — navigate, click, fill forms, read the DOM, take screenshots, run JavaScript, and capture network and console activity.

Built with SwiftUI + WKWebView. The MCP server runs in-process over local HTTP with bearer-token authentication and DNS-rebinding defense.

Download

⬇ Download the latest macOS build — signed, notarised .dmg for Apple Silicon.

After downloading, open the DMG and drag MCP Browser to your Applications folder.

Screenshots

[MCP Browser window]

[MCP Browser tools and settings]

Why

Most "browser-as-a-tool" stories for agents fall into two camps:

  1. Headless automation (Playwright, Puppeteer) — fast and scriptable, but the agent never sees what you see, can't share your logged-in sessions, and runs in a different browser engine than the one you trust.
  2. Remote-controlled cloud browsers — your data leaves your machine, and you pay per session.

MCP Browser is the third option: a real browser window on your Mac that you log into, navigate, and use yourself — and that an LLM can drive through MCP when you ask it to. Cookies, history, bookmarks, and downloads stay local. The agent sees the same page you do.

Features

Browser

  • WKWebView-backed tabs with a Safari-style tab strip (favicons, hover close, equal-width pills)
  • URL bar with history + bookmark autocomplete
  • Bookmarks bar, full bookmarks manager, history view, downloads popover
  • Find on page, zoom-per-host persistence, picture-in-picture controller
  • Bookmark importer (HTML / Safari / Chrome formats)
  • Per-tab cookie and network capture

MCP server

  • Local HTTP transport on port 8833 (configurable) — POST /mcp for JSON-RPC, GET /mcp for SSE-style status
  • Bearer-token authentication with a per-launch token, regeneratable from Settings
  • DNS-rebinding defense — Host header validated against 127.0.0.1 / localhost
  • Auto-registration with common MCP clients (Claude Desktop, Codex, etc.) via MCPRegistrar
  • Tool action log — every tool call is recorded with arguments, result summary, and timing

Tools (current catalog)

  • Navigation — navigate, back, forward, reload, current_url, current_title
  • Tabs — list_tabs, new_tab, switch_tab, close_tab
  • DOM — click, fill, submit, hover, press_key, type_text, scroll, find_in_page, get_element, accessibility_tree
  • Page content — read_text, read_page, page_metadata, screenshot, pdf_export, render_html, eval_js, find, list_links, list_forms
  • Cookies / storage — get_cookies, set_cookie, storage, clear_session
  • Bookmarks — list_bookmarks, open_bookmark_folder
  • Inspection — console_logs, network_log, dialog
  • Files — download, upload_file (gated by user permission)
  • Misc — wait_for, emulate, resize

See MCP Browser/MCP/MCPToolCatalog.swift for the authoritative list.

Privacy & safety

  • Per-launch bearer token — clients without it get 401 Unauthorized
  • Origin / Host validation — blocks DNS-rebinding attacks from a malicious local web page
  • User confirmation for downloads, uploads, and any dialog interactions
  • Local-only by default — server binds to 127.0.0.1, never the public network
  • Action log in Settings → you can see exactly what an agent has done in your browser

Requirements

  • macOS 14+ (Sonoma or later)
  • Xcode 16+ to build from source

Getting Started (users)

  1. Download the latest DMG from the Releases page.
  2. Drag MCP Browser to /Applications and launch it.
  3. Open Settings → Connection to copy the bearer token and MCP endpoint URL.
  4. In your MCP client (Claude Desktop, Codex, etc.) add the server. The app's Settings → MCP Clients tab can patch the config for the most common clients automatically.
  5. Browse normally. When the LLM needs to do something on the web, it calls the tools through MCP and you'll see the action in the log.

Getting Started (developers)

  1. Clone this repository.
  2. Open MCP Browser.xcodeproj in Xcode.
  3. Select the MCP Browser scheme.
  4. Build and run on My Mac.

CLI build:

bash
xcodebuild -project "MCP Browser.xcodeproj" -scheme "MCP Browser" -configuration Debug build

Building your own fork

The project ships with the original author's signing settings. If you're forking to build and ship your own copy:

  1. Development team — open the MCP Browser target in Xcode → Signing & Capabilities → pick your own team. This rewrites DEVELOPMENT_TEAM in MCP Browser.xcodeproj/project.pbxproj.
  2. Bundle identifier — change PRODUCT_BUNDLE_IDENTIFIER from com.moosia.mcp-browser to something you own.
  3. No API keys are bundled. MCP Browser doesn't call any LLM provider itself — it only serves tools to whatever client connects.

Configuring an MCP client

Most MCP clients accept an HTTP transport block. Example for claude_desktop_config.json:

json
{  "mcpServers": {    "mcp-browser": {      "transport": "http",      "url": "http://127.0.0.1:8833/mcp",      "headers": {        "Authorization": "Bearer <token-from-settings>"      }    }  }}

The bundled MCP Clients settings tab can write this for you for the clients it knows about (Claude Desktop, Codex, etc.) — pick the client, hit Add MCP Browser, and it'll patch the file in place.

The token rotates each time you click Regenerate token in Settings → Connection. Re-patch your clients after rotating.

Data Storage

  • Bookmarks, history, zoom-per-host, downloads, and the action log are stored locally with PersistentStore (file-backed) and SwiftData where appropriate.
  • The bearer token is stored in UserDefaults. It's regenerated from Settings → Connection whenever you want to revoke existing clients.
  • Favicons are cached on disk under Application Support.
  • No telemetry. No cloud sync. Nothing leaves the machine unless an MCP tool you invoke causes it to.

Project Structure

MCP Browser/├── Browser/         WKWebView wrapper, tab model, presenter, scripts, PiP├── MCP/             MCP server, JSON-RPC, host protocol, tool catalog│   ├── Registrar/   Auto-config patcher for Claude Desktop / Codex / etc.│   └── Tools/       Tool implementations (navigation, DOM, content, etc.)├── Settings/        Settings tabs (general, privacy, connection, recorder, etc.)├── Storage/         Bookmarks, history, downloads, favicons, action log├── Views/           Bookmarks bar, bookmarks manager, history, downloads popover├── ContentView.swift     Top-level window layout, tab strip, URL bar├── AppCommands.swift     Menu bar commands and keyboard shortcuts└── MCP_BrowserApp.swift  App entry point and environment wiring

Key files

Security model

MCP Browser deliberately runs un-sandboxed so it can:

  • Patch MCP-client config files in ~/Library/Application Support / ~/.config
  • Drive other apps (e.g. open external schemes) when explicitly asked

It does not:

  • Bind any network interface other than loopback (127.0.0.1)
  • Accept connections without the per-launch bearer token
  • Honor requests whose Host header doesn't match 127.0.0.1 or localhost (DNS-rebinding defense)
  • Send anything off the machine on its own

If you're audit-minded, the entire HTTP surface is in MCP Browser/MCP/MCPServer.swift and is roughly 400 lines.

Known Limitations

  • The action log isn't yet retroactively searchable from the UI.
  • Multi-window support exists but the MCP coordinator only routes to the most-recently-focused window.
  • The OAuth and basic-auth flows for sites are handled by WebKit; MCP Browser itself does not store passwords. Use the system keychain through Safari/Chrome import for now.
  • No mobile/iOS build — this is a Mac-only tool.

Contributing

See CONTRIBUTING.md for how to file bugs, request features, and submit pull requests.

License

MIT

来源:README.md,提交 90d9a05

工具

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

版本历史

1
  1. v1.0.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

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

  • 近 30 天内可连通25 分

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

  • 已声明认证方式10 分

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

  • 已列出工具15 分

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

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