XcodeBuildMCP setup: installing and configuring MobileBuildMCP
XcodeBuildMCP has been renamed MobileBuildMCP. Install it with brew tap getsentry/xcodebuildmcp and brew install mobilebuildmcp, or let your MCP client run npx -y mobilebuildmcp@latest mcp, then run mobilebuildmcp setup in the project root. It builds, tests and drives simulators without Xcode open; only the simulator workflow is on by default.
Last updated:
The repository is getsentry/MobileBuildMCP (the old XcodeBuildMCP GitHub URL redirects there), the npm package and CLI are mobilebuildmcp, and the docs live at mobilebuildmcp.com. The Homebrew tap still carries the old name: getsentry/xcodebuildmcp. Many tutorials that rank for "XcodeBuildMCP" still show xcodebuildmcp commands; this page uses the current ones. The latest GitHub release is v2.7.1, published 2026-09-23 (22:18 CEST).
What it does
MobileBuildMCP is one package with two modes: an MCP server for coding agents and a CLI for your terminal or CI. Tools are grouped into workflows (CLI docs):
| Workflow | What the agent can do |
|---|---|
simulator (on by default) | Build, install, launch, test, capture logs on simulators |
device | Install, launch, test on physical devices |
macos | Build, run, test macOS targets |
swift-package | Build, test, clean Swift packages |
debugging | Attach LLDB, breakpoints, stacks, variables |
ui-automation | Tap, swipe, type, gesture, screenshot |
Running UI tests with test_sim and reading the results: iOS UI testing with AI agents. test_sim and test_device set hideWhenXcodeAgentMode in their manifests, so they are hidden when MobileBuildMCP runs as Xcode's agent; use Xcode's own test tools there (test_sim.yaml).
Requirements
From the installation docs: macOS 14.5 or later, Xcode 16 or later (Xcode 26+ unlocks the Xcode IDE Bridge), Node.js 18+ for the npm path, or Homebrew.
Step 1: Install
Homebrew (recommended by the docs, no Node.js needed):
bash
brew tap getsentry/xcodebuildmcp
brew install mobilebuildmcpnpm:
bash
npm install -g mobilebuildmcp@latest
mobilebuildmcp --helpIf you only use it as an MCP server, you can skip the global install and let your client run npx -y mobilebuildmcp@latest mcp. Check your environment with:
bash
npx --package mobilebuildmcp@latest mobilebuildmcp-doctorStep 2: Connect your agent
All snippets come from the official MCP Clients page. If you installed with Homebrew, the docs say to use "command": "mobilebuildmcp" with "args": ["mcp"] instead of npx.
Claude Code
bash
claude mcp add MobileBuildMCP -- npx -y mobilebuildmcp@latest mcpCursor (project-scoped .cursor/mcp.json, recommended by the docs)
json
{
"mcpServers": {
"MobileBuildMCP": {
"command": "npx",
"args": ["-y", "mobilebuildmcp@latest", "mcp"]
}
}
}For the global ~/.cursor/mcp.json, the docs add "env": { "MOBILEBUILDMCP_CWD": "${workspaceFolder}" } so the server starts in the active workspace. Complete Cursor setup →
Codex CLI (~/.codex/config.toml)
toml
[mcp_servers.MobileBuildMCP]
command = "npx"
args = ["-y", "mobilebuildmcp@latest", "mcp"]
tool_timeout_sec = 600The docs add tool_timeout_sec when you hit "timed out awaiting tools/call after 60s"; Codex ignores a top-level tool_timeout_sec. The rest of a Codex iOS setup, including AGENTS.md, Xcode's MCP bridge and skills, is in Codex for iOS development.
Windsurf (~/.codeium/windsurf/mcp_config.json) and Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json) use the same mcpServers block as Cursor.
Xcode's own agents (Xcode 26.3+): the docs provide a /bin/zsh -lc wrapper because the in-Xcode agents start with a minimal PATH and often cannot find npx. For Claude Code inside Xcode the file is ~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.claude.json; for Codex inside Xcode it is a project-scoped .codex/config.toml. Copy the exact block from the clients page. All in-Xcode agent settings →
Step 3: Run the setup wizard
In your project root:
bash
mobilebuildmcp setupThe wizard (setup docs) creates .mobilebuildmcp/config.yaml and asks for target platforms, which workflows to enable, project/workspace path, scheme, configuration and a default simulator. It pre-selects only conservative defaults (simulator, plus macos if you build for macOS); device, debugging, ui-automation and swift-package are opt-in. If your client does not read the config file from the workspace, mobilebuildmcp setup --format mcp-json exports an env-based block to paste into the client config.
A minimal config from the configuration docs:
yaml
schemaVersion: 1
enabledWorkflows: ["simulator", "ui-automation", "debugging"]Settings are layered (highest wins): the agent's session_set_defaults call during a session, then .mobilebuildmcp/config.yaml, then environment variables. Commit the config file so your team shares it.
Step 4 (optional): Install the agent skill
bash
mobilebuildmcp initPer the docs, this detects your client and installs a skill (CLI or MCP variant) so the agent uses the tools without rediscovering conventions each session.
Step 5: First build
Ask your agent something like: "Build and run my app on an iPhone 17 simulator and show me any runtime errors." The setup docs show the expected sequence: discover_projs, list_schemes, session_set_defaults, then build_run_sim. After the first session_set_defaults, later calls reuse the project, scheme and simulator.
Troubleshooting
| Symptom | Fix (from the docs) |
|---|---|
| Codex times out after 60s/120s | Set tool_timeout_sec inside the [mcp_servers.MobileBuildMCP] block. Build fails? Troubleshooting → |
| Server will not start inside Xcode's agent | Use the zsh PATH wrapper from the clients page |
| Agent only sees simulator tools | Add workflows to enabledWorkflows |
| Global Cursor config builds the wrong folder | Set MOBILEBUILDMCP_CWD to ${workspaceFolder} |
| Anything else | Run mobilebuildmcp-doctor and include its output in issues |
| Out of date | mobilebuildmcp upgrade |
MobileBuildMCP vs Apple's xcrun mcpbridge
Xcode 26.3+ ships its own MCP server that talks to the running IDE (builds, tests, SwiftUI preview rendering, doc search). MobileBuildMCP drives the toolchain without Xcode open, adds devices, LLDB and UI automation, and its docs describe an opt-in xcode-ide workflow that bridges to Xcode's tools. Comparison: Best MCP servers for Xcode. Catalog entry: MobileBuildMCP. Compare all Xcode MCP servers →
MobileBuildMCP vs alternatives
| Tool | Type | Needs Xcode open? | Install | License | Stars (2026-10-18) |
|---|---|---|---|---|---|
| MobileBuildMCP | MCP + CLI | No | npx -y mobilebuildmcp@latest mcp | MIT | 6,488 |
xcrun mcpbridge | MCP in Xcode 26.3+ | Yes | claude mcp add --transport stdio xcode -- xcrun mcpbridge | ships with Xcode | n/a |
| iOS Simulator MCP | MCP (UI) | No | npx -y ios-simulator-mcp | MIT | 2,194 |
| XcodeMCPKit | proxy for Xcode's tools | No | brew install lynnswap/tap/xcode-mcpkit | MIT | 29 |
| XCAutokit | MCP + CLI | No for builds; IDE tools need Xcode 26.3+ | npm install -g xcautokit@latest | MIT | 1 |
| SilbercueSwift | MCP, Swift binary | brew tap silbercue/silbercue && brew install silbercueswift | MIT (49 tools free, Pro paid) | 9 |
Stars from the GitHub API, checked on 2026-10-18. License as declared on GitHub and in our catalog.
Add these next
iOS Simulator MCP for accessibility-tree UI checks. Compare all iOS simulator MCP servers →
Xcode Build Optimization skill to speed up the builds the agent triggers.
SwiftUI Pro so the code it builds follows current SwiftUI.
FAQ
- Is XcodeBuildMCP discontinued?
- No, it was renamed. The project continues as MobileBuildMCP under getsentry on GitHub; the old URL redirects. Use the mobilebuildmcp package and CLI.
- What is the XcodeBuildMCP install command now?
- brew tap getsentry/xcodebuildmcp && brew install mobilebuildmcp, or npm install -g mobilebuildmcp@latest. MCP clients can run npx -y mobilebuildmcp@latest mcp without a global install.
- How do I add XcodeBuildMCP to Claude Code?
- Run claude mcp add MobileBuildMCP -- npx -y mobilebuildmcp@latest mcp, then mobilebuildmcp setup in your project root.
- Does MobileBuildMCP need Xcode open?
- No. It drives xcodebuild and the simulator tooling directly. Xcode 16+ must be installed.
- Which workflows are enabled by default?
- Only simulator. Enable device, debugging, ui-automation, macos or swift-package in .mobilebuildmcp/config.yaml or via the setup wizard.
- Is there an alternative to XcodeBuildMCP without Node.js?
- Yes. MobileBuildMCP itself installs via Homebrew without Node.js. Native Swift alternatives in the catalog include XcodeMCPKit (a proxy for Xcode's own tools) and SilbercueSwift (49 tools free; a paid Pro tier adds 9 more).