经 AI Skill Hub 精选评估,开源Safari自动化 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
快速、并行的iOS Safari自动化MCP服务器
开源Safari自动化 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
快速、并行的iOS Safari自动化MCP服务器
开源Safari自动化 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/shaun0927/opensafari
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"--safari---": {
"command": "npx",
"args": ["-y", "opensafari"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 开源Safari自动化 执行以下任务... Claude: [自动调用 开源Safari自动化 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"__safari___": {
"command": "npx",
"args": ["-y", "opensafari"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<p align="center"> <b>Smart. Fast. Parallel.</b><br> iOS Safari automation MCP server via Xcode Simulator. </p>
<p align="center"> <b>Headless mobile QA automation</b> — drive real Safari, Flutter, and native iOS apps on Xcode Simulator without stealing your mouse or requiring Simulator.app focus. </p>
<p align="center"> <a href="https://www.npmjs.com/package/opensafari-mcp"><img src="https://img.shields.io/npm/v/opensafari-mcp.svg" alt="npm"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="MIT"></a> <a href="https://github.com/shaun0927/openchrome"><img src="https://img.shields.io/badge/sibling-OpenChrome-blue" alt="OpenChrome"></a> </p>
---
OpenSafari runs fully headless on CI — no display server, no mouse focus, no Simulator.app window required. See docs/headless-architecture.md for the full technical design. For Universal Link channel recipes (Notes paste-and-tap, captureLogs, channel matrix), see docs/recipes/universal-link-channels.md.
| Scenario | Query (AX Tree) | Input (Tap/Type) | Headless | Backend |
|---|---|---|---|---|
| Safari (Web) | ✅ | ✅ | ✅ | WebKit Remote Debug |
| Flutter App | ✅ | ✅ | ✅ | FlutterVMInputBackend |
| Native iOS App (Xcode ≤ 16) | ✅ | ✅ | ✅ | SimulatorKitHID (Tier 1) / simctl |
Native iOS App (Xcode 26+, element-targeted app_tap_element / app_type_element) | ✅ | ✅ | ✅ | AX-press (Tier 1.5) when the element advertises AXPress — see [docs/headless-architecture.md](docs/headless-architecture.md) |
Native iOS App (Xcode 26+, coordinate app_tap({x,y}) / app_swipe_native) | ✅ | ⚠️ Experimental (opt-in) | ⚠️ | PointerService opt-in via OPENSAFARI_ENABLE_POINTERSERVICE=1 — see [#590](https://github.com/shaun0927/opensafari/issues/590); AppleScript fallback otherwise ([#491](https://github.com/shaun0927/opensafari/issues/491)) |
| WebView in Native | ✅ | ⚠️ Partial | ⚠️ | Bundle metadata (appId|bundleId) requires a newer ios-webkit-debug-proxy build — older proxies fall back to URL-scheme heuristics. HTTPS WebViews (e.g. payment-return pages) must pass bundleId to app_webview_connect for bundle_match classification; without it they default to safari via url_scheme — see [#592](https://github.com/shaun0927/opensafari/issues/592) |
✅ Supported and stable. ⚠️ Partially supported — see linked docs for current status and limitations.
Stability commitments (stable vs opt-in vs experimental) are catalogued in docs/simhid-ios26-investigation.md#stability-commitments.
OPENSAFARI_HTTP_TOKEN="replace-with-a-random-token" opensafari serve --http 3100
brew install ios-webkit-debug-proxy---
Approach A (simctl defaults write) works for both debug and release builds. If a release app still reports an empty tree, add the explicit opt-in to main.dart:
void main() {
WidgetsFlutterBinding.ensureInitialized();
SemanticsBinding.instance.ensureSemantics(); // enable for OpenSafari QA
runApp(const MyApp());
}
For debug/profile builds, flutter_connect + flutter_widget_tree additionally expose the Dart VM Service, which returns the full Flutter widget hierarchy (including render-tree nodes that never reach the native AX bridge).
See docs/troubleshooting.md for common failure modes (empty trees, missing labels, Safari shadowing).
---
npm install -g opensafari-mcp
```bash
Multiple Claude Code sessions can share the same proxy. When a session detects a healthy proxy already running on its target port, it reuses it instead of starting a new one. When the owning session exits, only its own proxy is terminated — other sessions' proxies remain unaffected.
---
// Claude Code: .mcp.json
{
"mcpServers": {
"opensafari": {
"command": "npx",
"args": ["-y", "opensafari-mcp", "serve"]
}
}
}
// Claude Desktop: claude_desktop_config.json
{
"mcpServers": {
"opensafari": {
"command": "npx",
"args": ["-y", "opensafari-mcp", "serve", "--all-tools"]
}
}
}
OpenSafari uses ios_webkit_debug_proxy to bridge WebKit Remote Debugging from Xcode Simulator. The proxy is auto-started by the device_boot tool — no manual setup is needed in most cases.
import { createServer } from 'opensafari-mcp';
// Create and start the MCP server
const server = createServer({
tier: 3, // expose all tool tiers
auditLog: true, // enable tool call logging
});
// Start with stdio transport (default)
await server.start();
// Or start with HTTP transport
await server.start({ transport: 'http', port: 3100, authToken: process.env.OPENSAFARI_HTTP_TOKEN });
// 1. Boot simulator and launch the Flutter app
await device_boot('iPhone 16');
await app_launch({ bundleId: 'com.example.flutterApp' });
// 2. Terminate Safari if it's running — its background elements can
// dominate the macOS AX tree and hide Flutter widgets.
await app_terminate({ bundleId: 'com.apple.mobilesafari' });
await app_switch_app({ bundleId: 'com.example.flutterApp' });
// 3. Read the tree — Flutter Semantics nodes appear automatically.
const tree = await app_tree({ max_depth: 5 });
// 4. Query widgets by label, identifier, or role.
const button = await app_query({ label: 'Login' });
const email = await app_query({ identifier: 'email-field' });
| OpenSafari | Playwright WebKit | BrowserStack | Manual Testing | |
|---|---|---|---|---|
| **Engine** | **Real Safari** (Xcode Sim) | Bundled WebKit (approximation) | Real devices (cloud) | Real devices |
| **Protocol** | **WebKit Remote Debugging** (direct) | Playwright API (wrapper) | Proprietary | N/A |
| **iOS Fidelity** | **exact** | close but diverges | exact | exact |
| **Parallel sessions** | **N simulators** | N browsers | limited by plan | 1 device |
| **Login persistence** | **built-in** (real Safari cookies) | manual | manual | manual |
| **LLM integration** | **MCP native** | none | none | none |
| **Cost** | **free** (Xcode) | free | $29+/mo | device cost |
| **iOS-specific QA** | **auto-detect** (zoom, safe area, keyboard) | none | manual | manual |
tl;dr — OpenSafari controls the real Safari inside Xcode Simulator via WebKit Remote Debugging Protocol — the same way OpenChrome controls real Chrome via CDP. No middleware, no bundled browsers. Just direct protocol access to the actual Safari.app.
---
| OpenSafari | Appium | idb | XCUITest | |
|---|---|---|---|---|
**Headless native input** (no mouse focus, no Simulator.app activation) | **✅ AX-press + SimulatorKit HID** (element-targeted tap & keys/buttons headless on Xcode 26+; coordinate-only tap/swipe pending [#491](https://github.com/shaun0927/opensafari/issues/491)) | ❌ ([XCUI focus](https://appium.io/docs/en/2.0/ecosystem/drivers/)) | ✅ FBSimulatorHID | ❌ |
**Works on Xcode 26+** (after simctl io input removal) | ✅ Safari, Flutter, and element-targeted native taps; ⚠️ coordinate-only native tap/swipe pending | ⚠️ driver-dependent | ✅ | ✅ |
| **Flutter native taps** (no OS-level input) | ✅ Dart VM PointerDataPacket | ⚠️ 3rd-party plugin | ❌ | ❌ |
| **MCP / LLM integration** | ✅ native | ❌ | ❌ | ❌ |
| **Private API dependency** | SimulatorKit (documented, sentinel-guarded) | UIAutomation / XCUI | SimulatorKit | none |
See docs/private-apis.md for the SimulatorKit contract, the daily sentinel CI that detects BC breaks, and the rollback plan if Apple changes symbols.
For CI setup recipes (GitHub Actions, Buildkite, GitLab CI), see docs/ci-recipes.md.
Long-running MCP sessions are soak-tested nightly — see memory-soak workflow.
---
| Tool | Description |
|---|---|
qa_auto_zoom | Detect inputs triggering iOS auto-zoom |
qa_touch_targets | Find elements below 44×44px minimum |
qa_safe_area | Check content behind notch/home indicator |
qa_keyboard_overlap | Detect fixed elements hidden by real keyboard |
qa_dark_mode | Compare light vs dark mode rendering |
qa_full_audit | Run all QA checks and generate report |
---
OpenSafari drives Flutter apps running in the iOS Simulator using the same native-app tools used for UIKit/SwiftUI. The only wrinkle is that Flutter's accessibility tree is lazy — it only populates when an assistive technology (VoiceOver, XCTest) connects. OpenSafari auto-activates it so widget labels are queryable.
OpenSafari 是一个专为 iOS Safari 自动化设计的 MCP server,通过 Xcode Simulator 实现智能、快速且支持并行操作的自动化体验。它特别针对移动端 QA 自动化场景进行了优化,支持在无需占用鼠标或强制聚焦 Simulator.app 窗口的情况下,驱动真实的 Safari、Flutter 及原生 iOS 应用,实现高效的 Headless 自动化测试。
OpenSafari 支持完全的 Headless 运行模式,非常适合 CI/CD 集成环境,无需显示服务器、鼠标焦点或 `Simulator.app` 窗口。它具备强大的移动端 QA 能力,能够处理 Universal Link 通道测试、日志捕获(`captureLogs`)以及复杂的通道矩阵测试,为开发者提供了一套完整的移动端自动化工具链。
运行本项目需要 macOS 环境(因为 Xcode Simulator 仅限 macOS),并确保已安装 Xcode 及对应的 iOS Simulator runtime。此外,系统需安装 Node.js(版本 >= 18)以及 `ios-webkit-debug-proxy`(可通过 `brew install ios-webkit-debug-proxy` 安装)。若使用 HTTP 模式,还需配置 `OPENSAFARI_HTTP_TOKEN` 以确保安全性。
您可以通过 npm 全局安装 OpenSafari MCP:执行 `npm install -g opensafari-mcp` 即可完成部署。对于 Flutter 应用的 Release 版本,如果遇到语义树(Semantics Tree)为空的问题,需要在 `main.dart` 中显式调用 `SemanticsBinding.instance.ensureSemantics()` 以启用 OpenSafari 的 QA 功能。
快速开始非常简单,通过命令行即可启动服务。OpenSafari 支持多会话(Multi-Session)并行使用:多个 Claude Code 会话可以共享同一个 Proxy。当新会话检测到目标端口已有健康的 Proxy 在运行,会自动复用而非重新启动,确保了资源��高效利用与会话间的独立性。
用户可以通过配置文件集成 MCP 客户端。在 Claude Code 中,请编辑 `.mcp.json`;在 Claude Desktop 中,请编辑 `claude_desktop_config.json`。OpenSafari 会自动通过 `device_boot` 工具启动 `ios_webkit_debug_proxy` 来桥接 Xcode Simulator 的 WebKit 远程调试功能,大部分情况下无需手动配置。
OpenSafari 提供了强大的 Programmatic API,允许开发者通过 TypeScript 直接构建自定义服务。您可以使用 `createServer` 函数创建并启动 MCP server,支持通过 `stdio`(默认)或 `HTTP` 传输协议进行通信,并能通过 `tier` 参数控制暴露的工具层级,以及通过 `auditLog` 开启工具调用日志。
推荐的工作流是:首先使用 `device_boot` 启动模拟器并使用 `app_launch` 启动指定的 Flutter App。在启动 Flutter 应用后,建议先调用 `app_terminate` 关闭 Safari,以防止 Safari 的后台元素占用 macOS AX 树从而遮蔽 Flutter 的 Widget。整个流程通过高度集成的模块化指令实现自动化闭环。
针对 iOS QA 引擎(Tier 3),OpenSafari 提供了一系列专业工具:`qa_auto_zoom` 用于检测触发 iOS 自动缩放的输入框;`qa_touch_targets` 用于查找小于 44×44px 的点击目标;`qa_safe_area` 用于检查刘海屏/底部指示器区域;`qa_keyboard_overlap` 则用于检测被键盘遮挡的固定元素。对于 Flutter 应用,OpenSafari 会自动激活其 Accessibility Tree 以确保 Widget 可见。
高效的iOS Safari自动化工具
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:开源Safari自动化 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | opensafari |
| 原始描述 | 开源MCP工具:Smart. Fast. Parallel. iOS Safari automation MCP server via Xcode Simulator.。⭐6 · TypeScript |
| Topics | mcptypescriptiossafari |
| GitHub | https://github.com/shaun0927/opensafari |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-29 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端