XcodeBuildMCP
Popular MCP server that enables AI agents to scaffold, build, run and test iOS, macOS, visionOS and watchOS apps or simulators and wired and wireless devices. It has powerful UI-automation capabilities like controlling the simulator, capturing run-time logs, as well as taking screenshots and viewing the accessibility hierarchy.
A Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Installation
CLI Installation
npm install -g xcodebuildmcp@latest
xcodebuildmcp --help
MCP Server Installation
Add XcodeBuildMCP to your MCP client configuration. Most clients use JSON configuration with the following server entry:
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
Recommended (project-scoped): add .cursor/mcp.json in your workspace root:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
}
}
For global Cursor config (~/.cursor/mcp.json), use this variant so startup is aligned with the active workspace:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "/bin/zsh",
"args": [
"-lc",
"cd \"${workspaceFolder}\" && exec npx -y xcodebuildmcp@latest mcp"
]
}
}
}
Or use the quick install link:
Run:
claude mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp
Run:
codex mcp add XcodeBuildMCP -- npx -y xcodebuildmcp@latest mcp
Or add to ~/.codex/config.toml:
[mcp_servers.XcodeBuildMCP]
command = "npx"
args = ["-y", "xcodebuildmcp@latest", "mcp"]
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
}
}
Add to your VS Code settings JSON:
"mcp": {
"servers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
}
}
Or use the quick install links:
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
}
}
Add to ~/Library/Application Support/Trae/User/mcp.json:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest", "mcp"]
}
}
}
Requires Xcode 26.3 or later. Codex agent must be installed and configured in Xcode Settings -> Intelligence -> Open AI.
The only way at the time of writing to add an MCP server is to use a project scoped .codex/config.toml file in the root of your project workspace:
/path/to/your/project/.codex/config.toml
[mcp_servers.XcodeBuildMCP]
args = [
"-lc",
"PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; export NVM_DIR=\"$HOME/.nvm\"; [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"; nvm use --silent >/dev/null 2>&1 || true; npx -y xcodebuildmcp@latest mcp"
]
command = "/bin/zsh"
enabled = true
tool_timeout_sec = 10000
NOTE: Codex Agent when running in Xcode has a limited PATH by default. The above example should work for most users but if you find the server doesn't start or is not available, it's likely because npx is not found so you might have to adjust the above configuration accordingly.
Requires Xcode 26.3 or later. Claude Code agent must be installed and configured in Xcode Settings -> Intelligence -> Anthropic.
Add to the end or replace the existing mcpServers object in Xcode's Claude Code agent config at:
~/Library/Developer/Xcode/CodingAssistant/ClaudeAgentConfig/.claude.json
// ... rest of file ...
"mcpServers": {
"XcodeBuildMCP": {
"command": "/bin/zsh",
"args": [
"-lc",
"PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin; export NVM_DIR=\"$HOME/.nvm\"; [ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"; nvm use --silent >/dev/null 2>&1 || true; npx -y xcodebuildmcp@latest mcp"
]
}
}
}
NOTE: Claude Code Agent when running in Xcode has a limited PATH by default. The above example should work for most users but if you find the server doesn't start or is not available, it's likely because npx is not found so you might have to adjust the above configuration accordingly.
For other installation options see Getting Started
When configuring a client manually, ensure the command includes the mcp subcommand (for example, npx -y xcodebuildmcp@latest mcp).
Requirements
- macOS 14.5 or later
- Xcode 16.x or later
- Node.js 18.x or later
Skills
XcodeBuildMCP now includes two optional agent skills:
-
MCP Skill: Primes the agent with instructions on how to use the MCP server's tools (optional when using the MCP server).
-
CLI Skill: Primes the agent with instructions on how to navigate the CLI (recommended when using the CLI).
To install, copy and paste the command below into a terminal and follow the on-screen instructions.
curl -fsSL https://raw.githubusercontent.com/cameroncooke/XcodeBuildMCP/v2.0.0/scripts/install-skill.sh -o install-skill.sh && bash install-skill.sh
For further information on how to install the skill, see: docs/SKILLS.md
Notes
- XcodeBuildMCP requests xcodebuild to skip macro validation to avoid errors when building projects that use Swift Macros.
- Device tools require code signing to be configured in Xcode. See docs/DEVICE_CODE_SIGNING.md.
Privacy
XcodeBuildMCP uses Sentry for error telemetry. For more information or to opt out of error telemetry see docs/PRIVACY.md.
CLI
XcodeBuildMCP provides a unified command-line interface. The mcp subcommand starts the MCP server, while all other commands provide direct terminal access to tools:
# Install globally
npm install -g xcodebuildmcp@latest
# Start the MCP server (for MCP clients)
xcodebuildmcp mcp
# List available tools
xcodebuildmcp tools
# Build for simulator
xcodebuildmcp simulator build --scheme MyApp --project-path ./MyApp.xcodeproj
The CLI uses a per-workspace daemon for stateful operations (log capture, debugging, etc.) that auto-starts when needed. See docs/CLI.md for full documentation.
Documentation
- Getting started: docs/GETTING_STARTED.md
- CLI usage: docs/CLI.md
- Configuration and options: docs/CONFIGURATION.md
- Tools reference: docs/TOOLS.md
- Troubleshooting: docs/TROUBLESHOOTING.md
- Privacy: docs/PRIVACY.md
- Skills: docs/SKILLS.md
- Contributing: docs/dev/CONTRIBUTING.md
Licence
This project is licensed under the MIT License - see the LICENSE file for details.
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Remote MCP Server Authless Test
An example of deploying a remote MCP server on Cloudflare Workers without authentication.
Gemini Image Generator
Generate high-quality images from text prompts using Google's Gemini model.
API Tester
This MCP Server accepts swagger/postman documents as input. It then generates API & Load test scenarios, executes the tests and generates the execution report.
Sequential Thinking Multi-Agent System (MAS)
An MCP agent that utilizes a Multi-Agent System (MAS) for sequential thinking and problem-solving.
Hippycampus
Turns any Swagger/OpenAPI REST endpoint with a yaml/json definition into an MCP Server with Langchain/Langflow integration automatically.
Game Asset Generator
Generate 2D and 3D game assets using AI models hosted on Hugging Face Spaces.
NMAP
Perform network scanning and security auditing using the NMAP utility.
Fast MCP
A Ruby implementation of the Model Context Protocol (MCP) server for integrating AI models into Ruby applications.
Enkrypt AI
Integrate red-teaming, prompt auditing, and AI safety analysis into any MCP-compatible client.
Remote MCP Server (Authless)
A remote MCP server deployable on Cloudflare Workers without authentication.