面向iOS与macOS工程的MCP构建工具

MobileBuildMCP以单一包提供CLI与MCP服务器两种模式,供AI编码代理在iOS和macOS项目中使用。它要求macOS 14.5以上、Xcode 16.x以上,并可通过npx按需启动MCP服务器。

一个模型上下文协议(MCP)服务器和CLI,为在iOS和macOS项目上工作时提供代理使用的工具. [![CI](https://github.com/getsentry/MobileBuildMCP/actions/workflows/ci.yml/badge.svg)](https://github.com/getsentry/MobileBuildMCP/actions/workflows/ci.yml) [![npm 版本( Npm 版本)](https://badge.fury.io/js/mobilebuildmcp.svg)](https://badge.fury.io/js/mobilebuildmcp) [![许可证: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![节点.js](https://img.shields.io/badge/node->=18.x-brightgreen.svg)](https://nodejs.org/) [![Xcode 16 密码](https://img.shields.io/badge/Xcode-16-blue.svg)](https://developer.apple.com/xcode/) [![macOS](https://img.shields.io/badge/platform-macOS-lightgrey.svg)](https://www.apple.com/macos/) [![MCP](https://img.shields.io/badge/MCP-Compatible-green.svg)](https://modelcontextprotocol.io/) [![询问 DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/getsentry/MobileBuildMCP) [![AgentAudit 安全保卫](https://img.shields.io/badge/AgentAudit-Safe-brightgreen?logo=data:image/svg%2Bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0id2hpdGUiIGQ9Ik0xMiAxTDMgNXY2YzAgNS41NSAzLjg0IDEwLjc0IDkgMTIgNS4xNi0xLjI2IDktNi40NSA5LTEyVjVsLTktNHoiLz48L3N2Zz4=)](https://www.agentaudit.dev/skills/xcodebuildmcp) [![新的pkg.pr. new (英语).](https://pkg.pr.new/badge/getsentry/MobileBuildMCP)](https://pkg.pr.new/~/getsentry/MobileBuildMCP) ## 安装 MobileBuildMCP号舰艇作为单一包件,有两种模式:a **CLI** 用于直接终端和 **MCP 服务器** 用于 AI 编码代理 。 两种安装方法都可以给您两个 。 ### 备选案文A——本乡人 ```bash brew tap getsentry/xcodebuildmcp brew install mobilebuildmcp ``` ### 备选案文B-npm(节点Js 18 +) ```bash npm install -g mobilebuildmcp@latest ``` 验证任一安装 : ```bash mobilebuildmcp --help ``` ### 连接您的 MCP客户端 Cursor、Claude Code、Codex 的即插即用配置片段可在官方文档页面找到 [MCP 客户端](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/clients.mdx)。大多数客户端也可以通过用户运行 MCP 服务器。 `npx -y mobilebuildmcp@latest mcp` 没有全局安装。 ## 所需经费 - macOS 14.5 或后来 - Xcode 16.x 或更晚时间 - 节点.js 18.x或较晚(Homebrew安装不需要). ## 技能 MobileBuildMCP现在包括两种可选的代理技能: - **MCP 技能**: Primes 代理,并附有如何使用MCP服务器工具的指令(在使用MCP服务器时可选择). - **CLI 技能**: Primes 代理,并附有如何导航CLI的指令(在使用CLI时推荐). 要安装全局二进制 : ```bash mobilebuildmcp init ``` 或者在没有全局安装的情况下通过npx直接安装: ```bash npx -y mobilebuildmcp@latest init ``` 有关安装技能的更多信息,见: [代理技能](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/skills.mdx). ## 页:1 - MobileBuildMCP 请求xcodebuilding跳过宏验证以避免在构建使用Swift Macros的项目时出错. - 设备工具需要在 Xcode 中配置代码签名。见 [设备代码签名](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/device-signing.mdx). ## 隐私 MobileBuildMCP 只使用哨兵进行内部运行时错误遥测。关于细节和选择退出指令,请参见 [隐私和遥测](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/privacy.mdx). ## CLI MobileBuildMCP提供了一个统一的指令行界面. `mcp` 子命令启动 MCP 服务器, 而所有其他命令都提供直接终端访问工具: ```bash # Install globally npm install -g mobilebuildmcp@latest # Start the MCP server (for MCP clients) mobilebuildmcp mcp # List available tools mobilebuildmcp tools # Build for simulator mobilebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj # Prepare portable test products without running tests mobilebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17" --build-for-testing --test-products-path ./MyApp.xctestproducts # Run previously prepared test products mobilebuildmcp simulator test --test-products-path ./MyApp.xctestproducts --simulator-name "iPhone 17" ``` 检查更新和升级到位 : ```bash mobilebuildmcp upgrade --check mobilebuildmcp upgrade --yes ``` CLI 使用每个工作空间守护进程进行状态操作(log抓取,调试等),在需要时可以自动启动。请参见 [CLI 指南](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/cli.mdx) 用于完整文档。 ## 文档 - 安装 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/installation.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/installation.mdx) - 设置 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/setup.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/setup.mdx) - MCP客户端: [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/clients.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/clients.mdx) - CLI 用法 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/cli.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/cli.mdx) - 配置和选项 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/configuration.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/configuration.mdx) - 工具参考 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/tools.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/tools.mdx) - 解决问题: [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/troubleshooting.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/troubleshooting.mdx) - 隐私 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/privacy.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/privacy.mdx) - 技能: [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/skills.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/skills.mdx) - 贡献 : [https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/contributing.mdx](https://github.com/getsentry/xcodebuildmcp.com/blob/main/app/docs/_content/contributing.mdx) ## 许可证 该项目根据MIT许可证获得许可——见: [LICENSE](<https://github.com/getsentry/MobileBuildMCP/blob/HEAD/LICENSE>) 详细文件。 第三方许可通知见: [THIRD_PARTY_LICENSES](<https://github.com/getsentry/MobileBuildMCP/blob/HEAD/THIRD_PARTY_LICENSES>) 详细文件。 npm 软件包属性参见 [THIRD_PARTY_PACKAGE_LICENSES](<https://github.com/getsentry/MobileBuildMCP/blob/HEAD/THIRD_PARTY_PACKAGE_LICENSES.md>) 详细文件。

查看原始来源