XcodeBuildMCP — Claude Code MCP server: what it does, how to install
Compiles Xcode projects, handles simulator runs, and executes test suites directly through AI coding agents.
claude mcp add --env INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> --env XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> --env XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> --env XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> --transport stdio xcodebuildmcp -- npx -y xcodebuildmcpWhat XcodeBuildMCP does
This package delivers both a CLI tool and an MCP server for agents targeting iOS and macOS applications. It allows the model to run scheme builds, output portable .xctestproducts files, and execute test bundles on target simulators. The server tells xcodebuild to bypass macro validation so builds using Swift Macros run cleanly.
A per-workspace background daemon manages persistent tasks like log capturing and debugging sessions. It auto-starts when needed. Working with physical hardware requires valid code signing profiles already set up in Xcode.
The server requires macOS 14.5 or later alongside Xcode 16.x. Internal error telemetry sends reports to Sentry by default, though you can turn it off by setting XCODEBUILDMCP_SENTRY_DISABLED.
What it helps with
- build iOS or macOS projects for a designated simulator
- prepare portable test products without executing tests immediately
- run test suites from artifacts on simulated Apple hardware
- capture stateful logs and debug info via a local workspace daemon
Example prompts for the agent
- Build the MyApp scheme for iPhone 17 using xcodebuildmcp
- Generate test products for MyApp.xcodeproj with build-for-testing
- Execute test runs using the MyApp.xctestproducts bundle
How to install XcodeBuildMCP
Platform CLI
claude mcp add --env INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> --env XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> --env XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> --env XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> --transport stdio xcodebuildmcp -- npx -y xcodebuildmcpReplace <…> with your own values
Platform CLI
codex mcp add xcodebuildmcp --env INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> --env XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> --env XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> --env XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> -- npx -y xcodebuildmcpReplace <…> with your own values
Config file
{
"mcpServers": {
"xcodebuildmcp": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp"
],
"env": {
"INCREMENTAL_BUILDS_ENABLED": "<INCREMENTAL_BUILDS_ENABLED>",
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "<XCODEBUILDMCP_ENABLED_WORKFLOWS>",
"XCODEBUILDMCP_SENTRY_DISABLED": "<XCODEBUILDMCP_SENTRY_DISABLED>",
"XCODEBUILDMCP_DEBUG": "<XCODEBUILDMCP_DEBUG>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"xcodebuildmcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xcodebuildmcp"
],
"env": {
"INCREMENTAL_BUILDS_ENABLED": "<INCREMENTAL_BUILDS_ENABLED>",
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "<XCODEBUILDMCP_ENABLED_WORKFLOWS>",
"XCODEBUILDMCP_SENTRY_DISABLED": "<XCODEBUILDMCP_SENTRY_DISABLED>",
"XCODEBUILDMCP_DEBUG": "<XCODEBUILDMCP_DEBUG>"
}
}
}
}Replace <…> with your own values
Platform CLI
gemini mcp add -e INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> -e XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> -e XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> -e XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> xcodebuildmcp npx -y xcodebuildmcpReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about XcodeBuildMCP
How to install XcodeBuildMCP in Claude Code?
Run claude mcp add xcodebuildmcp -- npx -y xcodebuildmcp in your terminal. You can pass runtime flags and disable telemetry using the --env options.
What are the environment requirements?
You need macOS 14.5 or later and Xcode 16.x or newer. Installing via npm also requires Node.js 18.x or later.
Does running on physical devices require special setup?
Yes. Device-oriented tools fail without active code signing configured inside your Xcode project settings.