XcodeBuild MCP server

Enables building, running, and debugging iOS and macOS applications through Xcode with tools for project discovery, simulator management, app deployment, and UI automation testing.
Back to servers
Setup instructions
Provider
Cameron Cooke
Release date
May 14, 2025
Language
TypeScript
Stats
2.5K stars

XcodeBuildMCP is a Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants. It enables programmatic interaction with Xcode projects, simulators, devices, and Swift packages through a standardized interface, making it easier for AI tools to help with iOS and macOS development tasks.

Installation

Prerequisites

  • macOS 14.5 or later
  • Xcode 16.x or later
  • Node 18.x or later

Setting Up the MCP Server

Quick Installation

For a quick install, you can use the following links:

Install in Cursor

Install in VS Code

Install in VS Code Insiders

Manual Configuration

Most MCP clients (Cursor, VS Code, Windsurf, Claude Desktop, etc.) support the following JSON configuration format:

"XcodeBuildMCP": {
  "command": "npx",
  "args": [
    "-y",
    "xcodebuildmcp@latest"
  ]
}

Client-Specific Installation

OpenAI Codex CLI

Add to your Codex CLI config file:

[mcp_servers.XcodeBuildMCP]
command = "npx"
args = ["-y", "xcodebuildmcp@latest"]
env = { "INCREMENTAL_BUILDS_ENABLED" = "false", "XCODEBUILDMCP_SENTRY_DISABLED" = "false" }

Claude Code CLI

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 -H INCREMENTAL_BUILDS_ENABLED=false -H XCODEBUILDMCP_SENTRY_DISABLED=false

Smithery

Install for Claude Desktop automatically:

npx -y @smithery/cli install @cameroncooke/XcodeBuildMCP --client claude

Usage

Available Tools and Features

XcodeBuildMCP provides tools for:

Xcode Project Management

  • Discover projects and workspaces
  • Build for macOS, iOS simulator, and iOS devices
  • List schemes and show build settings
  • Clean build products
  • Create new iOS and macOS projects from templates

Swift Package Manager

  • Build Swift packages
  • Run tests with filtering options
  • Execute package binaries
  • Manage processes
  • Clean artifacts

Simulator Management

  • List, boot, and open simulators
  • Install, launch, and stop apps
  • Capture logs from running apps
  • Interact with simulator UI elements
  • Take screenshots

Device Management

  • List connected physical Apple devices
  • Build, install, launch, and stop apps on devices
  • Run tests on physical devices
  • Capture console output
  • Support for wireless device connections

App Utilities

  • Extract bundle IDs from app bundles
  • Launch and stop apps across platforms
  • Monitor and control processes

Enabling Incremental Builds

To enable faster builds using incremental build support:

"XcodeBuildMCP": {
  "command": "npx",
  "args": ["-y", "xcodebuildmcp@latest"],
  "env": {
    "INCREMENTAL_BUILDS_ENABLED": "true"
  }
}

Using Dynamic Tools

Dynamic tool loading optimizes context window usage in AI assistants:

"XcodeBuildMCP": {
  "command": "npx",
  "args": ["-y", "xcodebuildmcp@latest"],
  "env": {
    "XCODEBUILDMCP_DYNAMIC_TOOLS": "true"
  }
}

Selective Workflow Loading

For reduced context window usage without dynamic tools:

"XcodeBuildMCP": {
  "command": "npx",
  "args": ["-y", "xcodebuildmcp@latest"],
  "env": {
    "XCODEBUILDMCP_ENABLED_WORKFLOWS": "simulator,device,project-discovery"
  }
}

Available workflows include:

  • device - iOS Device Development
  • simulator - iOS Simulator Development
  • simulator-management - Simulator Management
  • swift-package - Swift Package Manager
  • project-discovery - Project Discovery
  • macos - macOS Development
  • And more

Code Signing Setup

For device deployment features to work, code signing must be configured in Xcode:

  1. Open your project in Xcode
  2. Select your project target
  3. Go to "Signing & Capabilities" tab
  4. Configure "Automatically manage signing" and select your development team
  5. Ensure a valid provisioning profile is selected

Troubleshooting

If you encounter issues, use the doctor tool:

npx --package xcodebuildmcp@latest xcodebuildmcp-doctor

This tool provides information about:

  • System and Node.js environment
  • Xcode installation and configuration
  • Required dependencies
  • Environment variables
  • Feature availability status

Privacy Settings

XcodeBuildMCP uses Sentry for error monitoring. To opt out:

"XcodeBuildMCP": {
  "command": "npx",
  "args": ["-y", "xcodebuildmcp@latest"],
  "env": {
    "XCODEBUILDMCP_SENTRY_DISABLED": "true"
  }
}

How to install this MCP server

For Claude Code

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.

For Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.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

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later