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
Provider
Cameron Cooke
Release date
May 14, 2025
Language
TypeScript
Stats
1.6K stars

XcodeBuildMCP is a Model Context Protocol (MCP) server that provides Xcode-related tools for seamless integration with AI assistants and other MCP clients. It enables AI assistants to interact with Xcode projects programmatically, handling everything from building and testing to simulator control and device management.

Installation

Prerequisites

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

Installation Methods

Quick Install Links

Use one of these one-click installation links for your preferred MCP client:

Manual Installation

Configure your MCP client (Windsurf, Cursor, Claude Desktop, etc.) by adding XcodeBuildMCP to your client's MCP configuration:

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

Using mise

If you prefer not to use a specific Node.js installation, you can use mise:

# Install mise (macOS with Homebrew)
brew install mise

Then configure your MCP client with mise:

{
  "mcpServers": {
    "XcodeBuildMCP": {
      "command": "mise",
      "args": [
        "x",
        "npm:[email protected]",
        "--",
        "xcodebuildmcp"
      ]
    }
  }
}

Using Smithery (Claude Desktop)

To install with Smithery for Claude Desktop:

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

Usage

Xcode Project Management

XcodeBuildMCP offers tools for:

  • Discovering Xcode projects and workspaces
  • Building for various platforms (macOS, iOS simulator, iOS devices)
  • Getting project information (schemes, build settings)
  • Cleaning build products
  • Creating new iOS and macOS projects from templates

Swift Package Manager Support

  • Build Swift packages with configuration options
  • Run test suites with filtering capabilities
  • Execute package binaries
  • Manage package processes
  • Clean build artifacts

Simulator Management

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

Device Management

  • Discover connected physical Apple devices
  • Build, install, launch, and stop apps on physical devices
  • Run tests on physical devices
  • Capture console output from device apps
  • Support for devices connected over USB or Wi-Fi

Advanced Features

Incremental Build Support

Enable experimental incremental builds for faster build times:

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

Code Signing for Device Deployment

For device deployment to work:

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

Selective Tool Registration

You can enable only specific tools to reduce context sent to the client:

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

Troubleshooting

Diagnostic Tool

Use the diagnostic tool to check your environment configuration:

npx --package xcodebuildmcp@latest xcodebuildmcp-diagnostic

Accessing MCP Server Logs

For Cursor, find logs at:

find ~/Library/Application\ Support/Cursor/logs -name "Cursor MCP.log" -exec zip -r matching_logs.zip {} +

Privacy Settings

XcodeBuildMCP uses Sentry for error monitoring. To opt out:

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

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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