XcodeBuild
by getsentry
An MCP server and CLI that lets an AI coding agent build, test, and run iOS/macOS Xcode projects and control simulators directly, without a human driving Xcode by hand.
Install via npm
npm install -g xcodebuildmcp@latest
About
XcodeBuildMCP ships as one package with two faces: a CLI (`xcodebuildmcp`) you can run yourself from a terminal, and an MCP server (`xcodebuildmcp mcp`) that exposes the same building blocks as callable tools for an agent. Either way it wraps the actual `xcodebuild` toolchain, resolving schemes and project paths, building for a chosen simulator or device, running the test suite without immediately executing it if you just want to prepare, and capturing build/runtime logs through a background workspace daemon so an agent can see what actually happened, not just whether the command exited zero.
On the device side it manages simulator and physical-device interaction directly: booting simulators, installing and launching an app, and inspecting Swift package targets, all addressable through the same tool surface used for the build itself. The project's own docs point to a full tools catalog and drop-in client config snippets for Cursor, Claude Code, and Codex, and it's under Sentry's org after originating as an independent project, a detail worth knowing if you're tracking provenance, since the git history and most contributors predate the getsentry move.
Key features
- Wraps xcodebuild for scheme-aware building and testing against simulators or devices
- Prepares tests without running them, useful for agents checking build health first
- Background workspace daemon that captures build and runtime logs for the agent to inspect
- Simulator lifecycle control: boot, install, and launch an app
- Swift package target inspection alongside standard Xcode project builds
- Runs as CLI or MCP server from the same installed package
Use cases
- Letting a coding agent iterate on an iOS app (edit, build, run on simulator, read the crash log) without a developer relaying each step
- CI-adjacent use where an agent verifies a PR builds and passes tests on multiple simulator targets
- Debugging a failing Xcode build by having the agent pull structured logs instead of parsing raw terminal output
- Automating repetitive simulator setup (boot, install, launch) before manual QA
Available tools
xcodebuildmcp mcp
Starts the MCP server, exposing Xcode build/test/simulator tools to a connected agent.
simulator build
Builds a scheme for a target simulator.
simulator test
Runs the test suite against a target simulator.
tools
Lists the full set of tools the running server exposes.
Frequently asked questions
Do I need Xcode installed separately?
Yes. The server wraps the real xcodebuild toolchain, so it requires macOS 14.5+ and Xcode 16.x+ already installed; it automates Xcode, it doesn't replace it.
Can I use it as a plain CLI without MCP?
Yes. The same installed package works as a standalone CLI (`xcodebuildmcp simulator build`, etc.) for terminal use, and as `xcodebuildmcp mcp` when you want it exposed to an agent.