mcp-browser

mcp-browser

Native macOS browser (SwiftUI + WKWebView) that exposes an MCP server in-process so AI agents can drive a real local browser with the user's existing logged-in sessions. ~40 tools (navigate, click, fill, screenshot, eval_js, network log, accessibility tree). Local-only with bearer-token auth.

Category
访问服务器

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 defenseHost 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)

  • Navigationnavigate, back, forward, reload, current_url, current_title
  • Tabslist_tabs, new_tab, switch_tab, close_tab
  • DOMclick, fill, submit, hover, press_key, type_text, scroll, find_in_page, get_element, accessibility_tree
  • Page contentread_text, read_page, page_metadata, screenshot, pdf_export, render_html, eval_js, find, list_links, list_forms
  • Cookies / storageget_cookies, set_cookie, storage, clear_session
  • Bookmarkslist_bookmarks, open_bookmark_folder
  • Inspectionconsole_logs, network_log, dialog
  • Filesdownload, upload_file (gated by user permission)
  • Miscwait_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:

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:

{
  "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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选