safari-ios-webinspector-mcp
Safari iOS Web Inspector MCP
一个仅限 macOS 的 MCP 服务器,用于通过 Safari Web Inspector 检查和自动化 iPhone Safari 和 iPhone Chrome 会话。
状态
本仓库包含一个可工作的首个实现:
针对 macOS、Xcode、
idevice_id和ios_webkit_debug_proxy的环境检查通过
libimobiledevice使用物理 UDID 和 iOS 版本对受信任设备进行信息增强iOS WebKit 桥接生命周期管理
通过
ios_webkit_debug_proxy进行设备和页面发现通过 Apple
safaridriver管理 iPhone Safari 会话通过原始 WebKit
Automation域管理 iPhone Safari 会话基于协议支持的运行时求值、控制台捕获和网络事件缓冲
通过运行时注入 JavaScript 进行 DOM 快照和页面级自动化
Safari/Web Inspector UI 回退,用于崩溃检测、重新加载尝试和截图
调试包导出
当前限制:
该桥接以协议为先且务实。它规范化了多种 WebKit 事件形态,但 iOS/WebKit 协议差异仍可能降低每个页面可用的能力。
在当前连接的真实 iPhone 上,健康的 Safari 页面会降级为
transportMode: broker_only,因此运行时/页面自动化被有意禁用,服务器回退到证据/恢复工作流。新的受管
safaridriver路径在全新的 Safari 自动化窗口中提供安全的仅浏览器自动化,但它尚不能附加到现有的活动 Safari 标签页。新的
launch_automation_page路径同样在全新的隔离 Automation 上下文中提供安全的仅浏览器自动化,但与 Safari WebDriver 一样,它不会接管现有的普通 Safari 标签页。在
safaridriver受管后端上,控制台和网络流仍然不可用。在原始 Automation 受管后端上,控制台和网络流同样不可用。
安全边界:
此项目在设计上仅限浏览器操作
重置、恢复、配对修改、固件或一般 iPhone 系统自动化均不在范围内
Related MCP server: MCP Safari Server
安装
npm install
npm run build本地运行:
npm run dev构建后作为 MCP 服务器使用:
[mcp_servers.safari-ios-webinspector]
command = "node"
args = ["/absolute/path/to/dist/src/index.js"]文档
真机测试
对已连接的 iPhone 运行真机测试:
npm run shakeout针对健康页面捕获原始 broker 跟踪:
npm run trace:broker直接探测原始 iPhone Automation 垫片:
npm run probe:automation -- --udid <DEVICE_UDID>来源与隐私
此公共仓库包含一个独立编写的实现,基于已文档化的 WebKit 行为和其声明依赖项的公共接口构建。研究笔记链接到为协议调查提供依据的上游项目和文档。
设备标识符、本地路径、捕获的页面、调试包以及客户或应用特定材料均不包含在内。测试使用合成设备数据和 example.com URL。
许可证
MIT。参见 LICENSE。第三方包仍受其各自许可证的约束,这些许可证在 package-lock.json 及其发行版中声明。
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
remote debug iOS/Android/Unity/Godot/Flutter/RN/Web on real-device.ui-tree/screenshots/taps,tests.
Drive real devices from your AI Coding tool. Embed a client SDK (Unity, Godot, Flutter, iOS/macOS, Android, React Native, Web) in your app, then capture screenshots, traverse the UI tree, inject taps and key events, and run automated test tasks on the physical device over a secure relay.
Build, run, and inspect iOS apps in disposable hosted Simulators from cloud coding agents.
Programmatic headless browser sessions: create, interact, browse, and extract - rendered in a real
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables debugging and automation of native Electron applications on macOS through DOM inspection, UI automation, global hotkeys, and Chrome DevTools Protocol integration.23MIT
- AlicenseAqualityDmaintenanceEnables programmatic control of Safari browser on macOS for web automation, testing, and debugging via the Model Context Protocol.167 npm4MIT
- AlicenseAqualityDmaintenanceLets your coding agent control and inspect a live Safari browser on macOS. Provides access to Safari DevTools for debugging, automation, and testing.4992 npm3MIT
- AlicenseAqualityDmaintenanceMCP server that drives Safari on a physically attached iPhone via Apple's safaridriver, enabling navigation, screenshots, DOM snapshots, console logs, network timings, and tap/type/scroll actions on the real device. No Xcode, Appium, or WebDriverAgent required.161MIT