
MCPSafari:AI代理的原生Safari MCP服务器
概览
一个原生的Safari MCP服务器,适用于你在macOS上真实登录的Safari。支持任何兼容MCP的客户端,包括Claude Code、Codex、Cursor、OpenCode和哦我的派。 你的客服会从你现有的登录信息、Cookie和历史记录开始。打开一个登录页面,开始工作。 - 在 Safari 中测试您的网站。让您的代理在浏览器中检查表单、菜单和拖放功能,方便 Safari 用户看到。- 通过 UID(快照)、CSS、文本或坐标来定位元素。用 React 表单填充能更新应用状态的设置器。- 检查发生了什么。读取控制台和网络活动,并将截图保存到磁盘以便查看,而无需用图像数据填充代理的上下文。- 在后台运行 DOM 任务。原生输入、按键、悬停和拖动都需要 Safari 在前方并获得无障碍权限。 真实网站的质量保证塑造了工具,包括修复忽略点击的菜单和遗漏文件的下放区。 用Swift和Manifest V3 Safari扩展构建。
概述(AI 翻译)
一个原生的Safari MCP服务器,适用于你在macOS上真实登录的Safari。支持任何兼容MCP的客户端,包括Claude Code、Codex、Cursor、OpenCode和哦我的派。
你的客服会从你现有的登录信息、Cookie和历史记录开始。打开一个登录页面,开始工作。
- 在Safari中测试你的网站。让你的代理在Safari用户看到的浏览器中查看表单、菜单和拖放功能。
- 通过UID(快照)、CSS、文本或坐标来定位元素。用更新应用状态的设置符填充React表单。
- 检查发生了什么。读取控制台和网络活动,并将截图保存到磁盘以供审核,但不使用图像数据填充代理上下文。
- 在后台运行DOM任务。原生输入、按键、悬停和拖动需要在前方设置Safari并获得无障碍权限。
真实网站的质量保证塑造了工具,包括修复忽略点击的菜单和遗漏文件的下放区。
用 Swift 和 Manifest V3 Safari 扩展构建。需要 macOS 14+ 和 Safari 17+。只需从 Source 构建 Xcode。
快速开始
1.安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCPSafari: Your favorite browser, ready for agents
A native Safari MCP server for your real, logged-in Safari on macOS. Works with any MCP-compatible client, including Claude Code, Codex, Cursor, OpenCode, and oh-my-pi.
Your agent starts with your existing logins, cookies, and history. Open a signed-in page and get to work.
- Test your site in Safari. Let your agent check forms, menus, and drag-and-drop in the browser your Safari users will see.
- Target elements by UID (from a snapshot), CSS, text, or coordinates. Fill React forms with setters that update application state.
- Check what happened. Read console and network activity, and save screenshots to disk for review without filling the agent’s context with image data.
- Run DOM tasks in the background. Native typing, key presses, hover, and drag need Safari in front and Accessibility permission.
QA on real sites has shaped the tools, including fixes for menus that ignored clicks and drop zones that missed files.
Built with Swift and a Manifest V3 Safari extension. Requires macOS 14+ and Safari 17+. Xcode is only needed to build from source.
Quick start
1. Install
brew trust epistates/tap
brew install --cask epistates/tap/mcp-safari
brew trust is needed once: installing a cask auto-trusts the cask, but not the mcp-safari-server formula it depends on, and without it the install stops at Refusing to load formula epistates/tap/mcp-safari-server from untrusted tap.
Open MCPSafari.app once so Safari picks up the extension, then enable MCPSafari Extension in Safari → Settings → Extensions. Grant access to the sites you want your agent to use.
Homebrew installs the published release. This README and the tool reference describe main, which may include unreleased features. Check Releases for your version.
2. Connect your client
For Claude Code:
claude mcp add --scope user mcp-safari mcp-safari
For Codex CLI:
codex mcp add mcp-safari -- mcp-safari
Start a new client session after adding the server. For Claude Desktop, Cursor, and other clients, see client configuration.
3. Try it
Ask your agent:
Open example.com in a new Safari tab, read the page heading, and take a screenshot.
The heading should be “Example Domain”. If the connection fails, see troubleshooting. On versions that include it, mcp-safari doctor checks the installation without changing it.
Before you use it
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →