XcodeBuildMCP acts as a bridge that allows AI assistants to help build and manage apps for Apple platforms, including iOS, macOS, visionOS, and watchOS. In simple terms, it gives an AI "hands" to perform tasks that a human developer would usually do inside Xcode, such as creating new projects from templates, compiling code, and launching apps. By providing a standardized way for AI to interact with Apple’s development tools, it transforms complex coding tasks into a seamless, automated conversation. Moving into more technical territory, the server provides a robust suite of tools for managing the entire development lifecycle. It handles everything from Swift Package Manager (SPM) dependencies and test suites to sophisticated simulator and physical device management. AI agents can use this MCP to boot specific simulators, install builds, and capture real-time system logs. It even supports advanced UI automation features like taking screenshots, recording video of a running app, and inspecting the accessibility hierarchy, allowing the AI to "see" and interact with the user interface it is building. What makes this tool particularly powerful for developers using LLMs is its ability to enable autonomous debugging and iteration. Instead of the user having to copy-paste error messages, the AI can independently trigger builds, parse compiler errors, and inspect build settings to identify issues. It can then apply a fix and re-run the project to verify the solution. By removing the need for manual command-line invocations, XcodeBuildMCP ensures that AI agents operate with precision and reliability, significantly speeding up the cycle from initial prompt to a fully tested application.
1. Installation Prerequisites: * OS: macOS 14.5 or later * Software: Xcode 16.x or later * Runtime: Node.js 18.x or later General Installation: The server is designed to be run using npx, so no manual global installation is strictly required. However, for specific features like video capture, you must run the following command once locally: bash npm run bundle:axe
2. Configuration Most MCP clients (Claude Desktop, Cursor, VS Code, etc.) use a JSON configuration file. Add the following entry to your mcpServers object: json { "mcpServers": { "XcodeBuildMCP": { "command": "npx", "args": [ "-y", "xcodebuildmcp@latest" ], "env": { "INCREMENTAL_BUILDS_ENABLED": "false", "XCODEBUILDMCP_SENTRY_DISABLED": "false" } } } }OpenAI Codex CLI (TOML):toml [mcp_servers.XcodeBuildMCP] command = "npx" args = ["-y", "xcodebuildmcp@latest"] env = { "INCREMENTAL_BUILDS_ENABLED" = "false", "XCODEBUILDMCP_SENTRY_DISABLED" = "false" }
3. Available Tools The server provides a wide range of tools for iOS/macOS development: * Xcode Project Management:discover_projects, build_operations, list_schemes, show_build_settings, clean_build, scaffold_project. * Swift Package Manager:build_package, run_tests, run_executable, list_processes, stop_process, clean_artifacts. * Simulator Management:list_simulators, boot_simulator, open_simulator, install_app, launch_app, stop_app, capture_logs, interact_ui, capture_screenshot, record_sim_video. * Device Management:list_devices, build_and_run_on_device, run_device_tests, capture_device_logs. * App Utilities:extract_bundle_id. * Resources: * xcodebuildmcp://simulators * xcodebuildmcp://devices * xcodebuildmcp://doctor
4. Example Prompts Based on the capabilities provided, you can use the following types of commands with an AI assistant: * "Discover all Xcode projects in the current directory and build the main scheme for the iOS simulator." * "Boot the iPhone 15 simulator, install my app, and take a screenshot of the home screen." * "Find the build errors in my project and try to fix them autonomously." * "Run the Swift Package tests in parallel and show me the results." * "List all connected physical devices and deploy the current build to my iPhone over Wi-Fi."
What you can do with XcodeBuildMCP
Use Case 1: Autonomous "Build-Fix" Development Loop Problem: Developers often spend significant time in a repetitive cycle: writing code, switching to Xcode to build, identifying errors, switching back to the editor, and fixing them. This context switching breaks flow and is tedious for minor syntax or configuration errors. Solution: This MCP enables AI agents (like Cursor or Claude) to independently validate code changes. The agent can trigger a build, receive the exact error logs through the MCP, modify the code to fix the issue, and rebuild until the project is "green" without the developer ever leaving the chat interface. Example: An AI agent refactors a Swift function but misses an argument label. It runs the build_ios_simulator tool, sees the "missing argument label" error in the output, fixes the call site automatically, and runs the build again to confirm success.
Use Case 2: Visual UI Verification and Layout Inspection Problem: Verifying that a UI change looks correct or that an element is present in the accessibility hierarchy usually requires manual simulator interaction, which is difficult for an AI agent to "see" or verify. Solution: Using the Simulator Management and Screenshot features, an AI can boot a simulator, install the app, navigate to a specific screen, and capture a screenshot or the accessibility hierarchy. This allows the AI to "visually" verify its work or debug layout issues. Example: A developer asks, "Ensure the 'Submit' button is centered and visible on iPhone 15." The AI uses the MCP to boot the iPhone 15 simulator, launches the app, captures the accessibility hierarchy to find the button's coordinates, and takes a screenshot to show the developer the final result.
Use Case 3: Rapid Project Scaffolding and Architecture Setup Problem: Setting up a modern Xcode workspace with a specific folder structure, Swift Package Manager (SPM) integration, and correct bundle identifiers is a multi-step manual process prone to configuration errors. Solution: The MCP provides project scaffolding tools that allow an AI to generate a complete, standardized project architecture from a single prompt. It can create workspaces and link SPM packages automatically. Example: A user tells the AI, "Create a new iOS project called 'FitnessTracker' using a modular architecture with a separate SPM package for the API layer." The AI calls the scaffold_project tool to generate the workspace, app target, and library package instantly.
Use Case 4: Automated Testing and Log Analysis on Physical…