$git clone https://github.com/getsentry/XcodeBuildMCPA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
| 1 | <img src="assets/banner.png" alt="XcodeBuild MCP" width="600"/> |
| 2 | |
| 3 | A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects. |
| 4 | |
| 5 | [](https://github.com/getsentry/XcodeBuildMCP/actions/workflows/ci.yml) |
| 6 | [](https://badge.fury.io/js/xcodebuildmcp) [](https://opensource.org/licenses/MIT) [](https://nodejs.org/) [](https://developer.apple.com/xcode/) [](https://www.apple.com/macos/) [](https://modelcontextprotocol.io/) [](https://deepwiki.com/getsentry/XcodeBuildMCP) [](https://www.agentaudit.dev/skills/xcodebuildmcp) |
| 7 | |
| 8 | ## Installation |
| 9 | |
| 10 | XcodeBuildMCP ships as a single package with two modes: a **CLI** for direct terminal use and an **MCP server** for AI coding agents. Either install method gives you both. |
| 11 | |
| 12 | ### Option A — Homebrew |
| 13 | |
| 14 | ```bash |
| 15 | brew tap getsentry/xcodebuildmcp |
| 16 | brew install xcodebuildmcp |
| 17 | ``` |
| 18 | |
| 19 | ### Option B — npm (Node.js 18+) |
| 20 | |
| 21 | ```bash |
| 22 | npm install -g xcodebuildmcp@latest |
| 23 | ``` |
| 24 | |
| 25 | Verify either install: |
| 26 | ```bash |
| 27 | xcodebuildmcp --help |
| 28 | ``` |
| 29 | |
| 30 | ### Connect your MCP client |
| 31 | |
| 32 | Drop-in config snippets for Cursor, Claude Code, Codex, can be found in the official docs page [MCP Clients](https://xcodebuildmcp.com/docs/clients). Most clients can also run the MCP server on demand via `npx -y xcodebuildmcp@latest mcp` without a global install. |
| 33 | |
| 34 | ## Requirements |
| 35 | |
| 36 | - macOS 14.5 or later |
| 37 | - Xcode 16.x or later |
| 38 | - Node.js 18.x or later (not required for Homebrew installation) |
| 39 | |
| 40 | ## Skills |
| 41 | |
| 42 | XcodeBuildMCP now includes two optional agent skills: |
| 43 | |
| 44 | - **MCP Skill**: Primes the agent with instructions on how to use the MCP server's tools (optional when using the MCP server). |
| 45 | |
| 46 | - **CLI Skill**: Primes the agent with instructions on how to navigate the CLI (recommended when using the CLI). |
| 47 | |
| 48 | |
| 49 | To install with a global binary: |
| 50 | |
| 51 | ```bash |
| 52 | xcodebuildmcp init |
| 53 | ``` |
| 54 | |
| 55 | Or install directly via npx without a global install: |
| 56 | |
| 57 | ```bash |
| 58 | npx -y xcodebuildmcp@latest init |
| 59 | ``` |
| 60 | |
| 61 | For further information on installing skills, see [Agent Skills](https://xcodebuildmcp.com/docs/skills). |
| 62 | |
| 63 | ## Notes |
| 64 | |
| 65 | - XcodeBuildMCP requests xcodebuild to skip macro validation to avoid errors when building projects that use Swift Macros. |
| 66 | - Device tools require code signing to be configured in Xcode. See [Device Code Signing](https://xcodebuildmcp.com/docs/device-signing). |
| 67 | |
| 68 | ## Privacy |
| 69 | |
| 70 | XcodeBuildMCP uses Sentry for internal runtime error telemetry only. For details and opt-out instructions, see [Privacy & Telemetry](https://xcodebuildmcp.com/docs/privacy). |
| 71 | |
| 72 | ## CLI |
| 73 | |
| 74 | XcodeBuildMCP provides a unified command-line interface. The `mcp` subcommand starts the MCP server, while all other commands provide direct terminal access to tools: |
| 75 | |
| 76 | ```bash |
| 77 | # Install globally |
| 78 | npm install -g xcodebuildmcp@latest |
| 79 | |
| 80 | # Start the MCP server (for MCP clients) |
| 81 | xcodebuildmcp mcp |
| 82 | |
| 83 | # List available tools |
| 84 | xcodebuildmcp tools |
| 85 | |
| 86 | # Build for simulator |
| 87 | xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj |
| 88 | |
| 89 | # Prepare portable test products without running tests |
| 90 | xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj --simulator-name "iPhone 17" --build-for-testing --test-products-path ./MyApp.xctestproducts |
| 91 | |
| 92 | # Run previously prepared te |