
XcodeBuildMCP
Gives a coding agent the Xcode build, simulator and log commands it otherwise has to guess at
What is XcodeBuildMCP?
A coding agent working on an iOS project can write Swift all day and never find out whether it compiles, because the commands that would tell it are long, particular and easy to get subtly wrong. This exposes them properly: build a scheme, boot a simulator, install and launch the app, read the logs, run the tests. Because the agent gets a result it can act on, the loop closes — it fixes the error it just caused instead of handing you a diff to try. It ships as both an MCP server and a plain command-line tool, with optional skills that tell the agent how to use whichever one you installed. It is macOS-only and tracks a current Xcode.
What can you do with XcodeBuildMCP?
- Let the agent find out whether it compiled — Building a scheme returns real errors and warnings, so the agent corrects its own mistake in the same turn instead of handing you an untested diff.
- Run the app, not just build it — A simulator can be booted and the app installed and launched, which is the difference between "it compiles" and "it starts".
- Read the logs it just produced — Runtime logs come back to the agent, so a crash after launch is something it can investigate rather than something you have to relay.
- Use it as a command or as a server — The same package is an MCP server for agents that speak MCP and a plain CLI for agents that are better at running commands.
- Tell the agent how to drive it — Optional skills prime the agent with usage guidance, which matters for a tool surface this large — the tools exist, but knowing which to reach for is the hard part.
Before you choose XcodeBuildMCP
- macOS only, and it tracks a current Xcode and a recent macOS — an older machine kept on a pinned toolchain for a legacy project is exactly the case it does not cover.
- It gives an agent the ability to build and run code on your machine, so the usual command-approval settings in your client are the boundary — there is no sandbox in this layer.
Frequently asked questions
Is XcodeBuildMCP free for commercial use?
XcodeBuildMCP is released under the MIT licence — OSI-approved open source, which permits commercial use.
How can XcodeBuildMCP be deployed?
XcodeBuildMCP is available as Runs locally.
Documentation
Reproduced from the getsentry/XcodeBuildMCP README, published under MIT. Read the original ↗
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Installation
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.
Option A — Homebrew
brew tap getsentry/xcodebuildmcp
brew install xcodebuildmcp
Option B — npm (Node.js 18+)
npm install -g xcodebuildmcp@latest
Verify either install:
xcodebuildmcp --help
Connect your MCP client
Drop-in config snippets for Cursor, Claude Code, Codex, can be found in the official docs page MCP Clients. Most clients can also run the MCP server on demand via npx -y xcodebuildmcp@latest mcp without a global install.
Requirements
- macOS 14.5 or later
- Xcode 16.x or later
- Node.js 18.x or later (not required for Homebrew installation)
Skills
XcodeBuildMCP now includes two optional agent skills:
-
MCP Skill: Primes the agent with instructions on how to use the MCP server’s tools (optional when using the MCP server).
-
CLI Skill: Primes the agent with instructions on how to navigate the CLI (recommended when using the CLI).
To install with a global binary:
xcodebuildmcp init
Or install directly via npx without a global install:
npx -y xcodebuildmcp@latest init
For further information on installing skills, see Agent Skills.
Notes
- XcodeBuildMCP requests xcodebuild to skip macro validation to avoid errors when building projects that use Swift Macros.
- Device tools require code signing to be configured in Xcode. See Device Code Signing.
Privacy
XcodeBuildMCP uses Sentry for internal runtime error telemetry only. For details and opt-out instructions, see Privacy & Telemetry.
CLI
XcodeBuildMCP provides a unified command-line interface. The mcp subcommand starts the MCP server, while all other commands provide direct terminal access to tools:
# Install globally
npm install -g xcodebuildmcp@latest
# Start the MCP server (for MCP clients)
xcodebuildmcp mcp
# List available tools
xcodebuildmcp tools
# Build for simulator
xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj
# Prepare portable test products without running tests
xcodebuildmcp 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
xcodebuildmcp simulator test --test-products-path ./MyApp.xctestproducts --simulator-name "iPhone 17"
Check for updates and upgrade in place:
xcodebuildmcp upgrade --check
xcodebuildmcp upgrade --yes
The CLI uses a per-workspace daemon for stateful operations (log capture, debugging, etc.) that auto-starts when needed. See the CLI guide for full documentation.
Documentation
- Installation: https://xcodebuildmcp.com/docs/installation
- Setup: https://xcodebuildmcp.com/docs/setup
- MCP clients: https://xcodebuildmcp.com/docs/clients
- CLI usage: https://xcodebuildmcp.com/docs/cli
- Configuration and options: https://xcodebuildmcp.com/docs/configuration
- Tools reference: https://xcodebuildmcp.com/docs/tools
- Troubleshooting: https://xcodebuildmcp.com/docs/troubleshooting
- Privacy: https://xcodebuildmcp.com/docs/privacy
- Skills: https://xcodebuildmcp.com/docs/skills
- Contributing: https://xcodebuildmcp.com/docs/contributing