Remote OpenClaw Blog
Xcode MCP: Build and Test iOS Apps From Claude Code
6 min read ·
An Xcode MCP server is a Model Context Protocol server that lets AI agents like Claude Code and Cursor build, run, test, and debug iOS and macOS apps by driving Xcode's toolchain for them. The leading option is XcodeBuildMCP, originally built by Cameron Cooke and now maintained by Sentry, installed with claude mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp.
What Does an Xcode MCP Server Do?
An Xcode MCP server exposes Xcode's build system, simulators, and devices as tools an AI agent can call over the Model Context Protocol. Instead of you copy-pasting compiler errors into a chat, the agent runs the build itself, parses the structured error output, edits the code, and rebuilds until the app compiles.
XcodeBuildMCP is the reference implementation of this idea. It began as a personal project by iOS developer Cameron Cooke, and the repository now lives at getsentry/XcodeBuildMCP, maintained by Sentry under an MIT license, with 6,000+ stars as of July 2026. It describes itself as "a Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects."
The practical loop it unlocks: you say "build and run my app on an iPhone 17 simulator and show me any runtime errors," and the agent discovers your .xcworkspace, picks the scheme, boots the simulator, installs the app, and streams back logs and screenshots. If MCP itself is new to you, start with our Claude Code MCP guide.
How to Install XcodeBuildMCP in Claude Code
The official Claude Code install is a single command, taken verbatim from the XcodeBuildMCP client docs:
# Add XcodeBuildMCP to Claude Code
claude mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp
# Optional: install globally instead of using npx
npm install -g xcodebuildmcp@latest
# Optional: Homebrew install (no Node.js required)
brew install getsentry/xcodebuildmcp/xcodebuildmcp
For Cursor, the docs use the same server in .cursor/mcp.json with "command": "npx" and "args": ["-y", "xcodebuildmcp@latest", "mcp"]. VS Code, Windsurf, and GitHub Copilot configs follow the same pattern.
After connecting the server, the docs recommend running xcodebuildmcp setup in your project root. The wizard creates .xcodebuildmcp/config.yaml, where you select target platforms (iOS, macOS, tvOS, watchOS, visionOS), enable workflows, and set defaults like workspace path and scheme. xcodebuildmcp doctor diagnoses a broken setup, and xcodebuildmcp init optionally installs an agent skill that teaches your agent to use the tools well. Requirements are macOS 14.5+, Xcode 16.x+, and Node.js 18+ unless you used Homebrew.
Main XcodeBuildMCP Tools
XcodeBuildMCP provides 82 tools organized into 15 workflows as of July 2026, according to the official documentation. You enable only the workflows you need during setup, which keeps the tool list, and therefore the context cost, manageable. The main groups:
- Project discovery: automatic detection of
.xcodeproj,.xcworkspace, and Swift packages, plus scheme listing. - Build, test, clean: structured build and test operations for simulators, physical devices, and macOS targets, with compiler errors returned in a form the agent can act on.
- Simulator and device management: boot and manage simulators, deploy to real iPhones and iPads over USB or Wi-Fi, capture logs and video.
- UI automation: tap, swipe, type, and gesture tools plus screenshot capture, so the agent can drive the running app and verify what it built.
- LLDB debugging: attach a debugger, set breakpoints, and inspect frames and variables.
- Code coverage and Swift Package Manager: per-target coverage summaries from xcresult, and build/test/run for SPM packages.
Xcode MCP Alternatives Compared
XcodeBuildMCP is the most complete Xcode MCP server, but several narrower servers are worth knowing, especially if you only need simulator control or you also target Android. Star counts are from GitHub as of July 2026.
| Server | Stars | Focus | Best for |
|---|---|---|---|
| XcodeBuildMCP | 6,000+ | Full Xcode lifecycle: build, test, run, debug, UI automation | iOS and macOS development end to end |
| mobile-mcp | 5,300+ | Mobile automation on iOS and Android, emulators and real devices | Cross-platform app testing and scraping |
| ios-simulator-mcp | 2,000+ | Interacting with the iOS Simulator: UI, screenshots, logs | Lightweight simulator control without build tools |
| xcode-mcp-server | 380 | Xcode project management and file operations | Project-level integration experiments |
| mcp-server-simulator-ios-idb | 304 | Simulator control through Meta's idb | Teams already using idb tooling |
| xcodebuild | 84 | Building workspaces and feeding errors back to the LLM | Minimal build-only setups (last updated August 2025) |
A sensible default: XcodeBuildMCP alone covers building, running, and testing. Add mobile-mcp only if you ship Android from the same codebase. If you are unsure how to evaluate any MCP server before installing it, our guide on finding MCP servers from inside Claude Code walks through the process.
Limitations and Tradeoffs
Every Xcode MCP server requires a Mac with Xcode installed, because Apple's toolchain only runs on macOS. That rules out Linux and Windows machines, plain Docker containers, and most cheap CI runners; the agent must run on (or SSH into) real Apple hardware or a macOS cloud host. XcodeBuildMCP specifically needs macOS 14.5+ and Xcode 16.x+.
Other tradeoffs to plan around: deploying to physical devices still requires a valid Apple Developer account and code signing setup, which the server cannot conjure for you. Enabling all 15 workflows inflates your context window, so enable only what you use. And XcodeBuildMCP ships Sentry error telemetry by default, with a documented opt-out, which some teams will want to disable. If you only need Claude to read Swift code rather than build it, you do not need an Xcode MCP server at all; a plain checkout is enough.
Related Guides
- Claude Code MCP: How to Add and Manage MCP Servers
- How to Find MCP Servers From Inside Claude Code
- Claude Plugins: What They Are and How to Install Them
- Context7 MCP Server: Live Docs in Claude Code
Go deeper
The operator playbooks
Production-ready PDF guides for OpenClaw and Hermes Agent — $19.99 each.
Skills for this topic
Browse all skills →Frequently Asked Questions
What is an Xcode MCP server?
An Xcode MCP server is a Model Context Protocol server that exposes Xcode's build system, simulators, and devices as callable tools for AI agents. It lets Claude Code, Cursor, and similar agents compile iOS and macOS apps, run them, read errors, and automate the UI instead of only editing source files.
How do I connect Claude Code to Xcode?
Install XcodeBuildMCP with claude mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp , then run xcodebuildmcp setup in your project root to generate .xcodebuildmcp/config.yaml . You need macOS 14.5 or later, Xcode 16.x or later, and Node.js 18+ unless you installed via Homebrew.
Does XcodeBuildMCP work on Windows or Linux?
No. XcodeBuildMCP, like every Xcode MCP server, depends on Apple's xcodebuild toolchain and simulators, which only run on macOS. To use it from a non-Mac machine you would need to connect to a remote Mac, for example a macOS cloud host or a Mac mini on your network.
Can Claude run my app on a real iPhone?
Yes. XcodeBuildMCP includes device workflows that deploy and test on physical iPhones and iPads over USB or Wi-Fi. You still need a valid Apple Developer account and working code signing, since the MCP server drives Apple's tooling rather than bypassing it.

