# XcodeBuildMCP

Compiles Xcode projects, handles simulator runs, and executes test suites directly through AI coding agents.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed · ★ 6505
- Author: getsentry
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/getsentry/MobileBuildMCP
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/xcodebuildmcp

## What it does

This package delivers both a CLI tool and an MCP server for agents targeting iOS and macOS applications. It allows the model to run scheme builds, output portable `.xctestproducts` files, and execute test bundles on target simulators. The server tells `xcodebuild` to bypass macro validation so builds using Swift Macros run cleanly.

A per-workspace background daemon manages persistent tasks like log capturing and debugging sessions. It auto-starts when needed. Working with physical hardware requires valid code signing profiles already set up in Xcode.

The server requires macOS 14.5 or later alongside Xcode 16.x. Internal error telemetry sends reports to Sentry by default, though you can turn it off by setting `XCODEBUILDMCP_SENTRY_DISABLED`.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `INCREMENTAL_BUILDS_ENABLED`, `XCODEBUILDMCP_ENABLED_WORKFLOWS`, `XCODEBUILDMCP_SENTRY_DISABLED`, `XCODEBUILDMCP_DEBUG` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> --env XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> --env XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> --env XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> --transport stdio xcodebuildmcp -- npx -y xcodebuildmcp
```
Replace <…> with your own values

### Codex

**Platform CLI**
```bash
codex mcp add xcodebuildmcp --env INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> --env XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> --env XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> --env XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> -- npx -y xcodebuildmcp
```
Replace <…> with your own values

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "xcodebuildmcp": {
            "command": "npx",
            "args": [
                "-y",
                "xcodebuildmcp"
            ],
            "env": {
                "INCREMENTAL_BUILDS_ENABLED": "<INCREMENTAL_BUILDS_ENABLED>",
                "XCODEBUILDMCP_ENABLED_WORKFLOWS": "<XCODEBUILDMCP_ENABLED_WORKFLOWS>",
                "XCODEBUILDMCP_SENTRY_DISABLED": "<XCODEBUILDMCP_SENTRY_DISABLED>",
                "XCODEBUILDMCP_DEBUG": "<XCODEBUILDMCP_DEBUG>"
            }
        }
    }
}
```
Replace <…> with your own values

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "xcodebuildmcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "xcodebuildmcp"
            ],
            "env": {
                "INCREMENTAL_BUILDS_ENABLED": "<INCREMENTAL_BUILDS_ENABLED>",
                "XCODEBUILDMCP_ENABLED_WORKFLOWS": "<XCODEBUILDMCP_ENABLED_WORKFLOWS>",
                "XCODEBUILDMCP_SENTRY_DISABLED": "<XCODEBUILDMCP_SENTRY_DISABLED>",
                "XCODEBUILDMCP_DEBUG": "<XCODEBUILDMCP_DEBUG>"
            }
        }
    }
}
```
Replace <…> with your own values

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e INCREMENTAL_BUILDS_ENABLED=<INCREMENTAL_BUILDS_ENABLED> -e XCODEBUILDMCP_ENABLED_WORKFLOWS=<XCODEBUILDMCP_ENABLED_WORKFLOWS> -e XCODEBUILDMCP_SENTRY_DISABLED=<XCODEBUILDMCP_SENTRY_DISABLED> -e XCODEBUILDMCP_DEBUG=<XCODEBUILDMCP_DEBUG> xcodebuildmcp npx -y xcodebuildmcp
```
Replace <…> with your own values

## When to use it
- build iOS or macOS projects for a designated simulator
- prepare portable test products without executing tests immediately
- run test suites from artifacts on simulated Apple hardware
- capture stateful logs and debug info via a local workspace daemon

## Example prompts
- Build the MyApp scheme for iPhone 17 using xcodebuildmcp
- Generate test products for MyApp.xcodeproj with build-for-testing
- Execute test runs using the MyApp.xctestproducts bundle

## Similar
- [e2e](https://affpapa.org/en/nevibecode/mcp/e2e.md) — MCP server · ★ 11912
- [Measure](https://affpapa.org/en/nevibecode/mcp/measure.md) — MCP server · ★ 1418
- [mcp](https://affpapa.org/en/nevibecode/mcp/sceneview-mcp.md) — MCP server · ★ 1348
- [Argent](https://affpapa.org/en/nevibecode/mcp/argent.md) — MCP server · ★ 3084
- [mcp](https://affpapa.org/en/nevibecode/mcp/buoy-gg-mcp.md) — MCP server · ★ 691
- [Ghost in the Droid](https://affpapa.org/en/nevibecode/mcp/ghost-in-the-droid.md) — MCP server · ★ 397

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
