XcodeBuildMCP is a Model Context Protocol (MCP) server that provides a suite of tools for integrating Xcode operations with AI assistants. It enables programmatic interaction with Xcode projects, simulators, devices, and Swift packages through a standardized interface, making it easier for AI assistants to help with iOS and macOS development tasks.
Most MCP clients (Cursor, VS Code, Windsurf, Claude Desktop, etc.) use the following JSON configuration format. Add this to your client's JSON configuration in the mcpServers
object:
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
]
}
Add this to your Codex CLI config file:
[mcp_servers.XcodeBuildMCP]
command = "npx"
args = ["-y", "xcodebuildmcp@latest"]
env = { "INCREMENTAL_BUILDS_ENABLED" = "false", "XCODEBUILDMCP_SENTRY_DISABLED" = "false" }
Install via command line:
# Add XcodeBuildMCP server to Claude Code
claude mcp add XcodeBuildMCP npx xcodebuildmcp@latest
# Or with environment variables
claude mcp add XcodeBuildMCP npx xcodebuildmcp@latest -e INCREMENTAL_BUILDS_ENABLED=false -e XCODEBUILDMCP_SENTRY_DISABLED=false
Install automatically using Smithery:
npx -y @smithery/cli install @cameroncooke/XcodeBuildMCP --client claude
XcodeBuildMCP provides tools for:
For faster builds, you can enable experimental incremental build support by setting an environment variable:
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest"],
"env": {
"INCREMENTAL_BUILDS_ENABLED": "true"
}
}
To optimize context window usage in AI assistants, you can enable dynamic tool loading:
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest"],
"env": {
"XCODEBUILDMCP_DYNAMIC_TOOLS": "true"
}
}
This mode starts with minimal tools and loads additional tools as needed, based on the context of your development tasks.
If you want to reduce context usage but your client doesn't support MCP sampling, you can selectively load specific workflows:
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest"],
"env": {
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "simulator,device,project-discovery"
}
}
Available workflows include: device
, simulator
, simulator-management
, swift-package
, project-discovery
, macos
, ui-testing
, logging
, project-scaffolding
, utilities
, doctor
, and discovery
.
For device deployment to work, you must configure code signing in Xcode before using XcodeBuildMCP:
If you encounter issues, use the built-in doctor tool to diagnose problems:
npx --package xcodebuildmcp@latest xcodebuildmcp-doctor
This tool will check your system configuration and report on all dependencies required by XcodeBuildMCP.
XcodeBuildMCP uses Sentry for error monitoring. If you prefer not to send error logs, opt out by setting:
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest"],
"env": {
"XCODEBUILDMCP_SENTRY_DISABLED": "true"
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "XcodeBuildMCP" '{"command":"npx","args":["-y","xcodebuildmcp@latest"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect