# MobileBuildMCP MCP server

> Enables AI agents to manage Xcode projects, control simulators, and execute iOS and macOS app builds and tests.

- Repository: https://github.com/cameroncooke/XcodeBuildMCP
- Page: https://hostedmcp.org/servers/cameroncooke/xcodebuildmcp
- Transport: stdio
- Stars: 6576
- License: MIT
- Latest version: 1.12.8

## Install

### Claude Code

```sh
claude mcp add xcodebuildmcp -- npx -y xcodebuildmcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "xcodebuildmcp": {
      "command": "npx",
      "args": [
        "-y",
        "xcodebuildmcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "xcodebuildmcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "xcodebuildmcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"xcodebuildmcp","type":"stdio","command":"npx","args":["-y","xcodebuildmcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "xcodebuildmcp": {
      "command": "npx",
      "args": [
        "-y",
        "xcodebuildmcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add xcodebuildmcp -- npx -y xcodebuildmcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.xcodebuildmcp]
command = "npx"
args = ["-y", "xcodebuildmcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user xcodebuildmcp npx -- -y xcodebuildmcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "xcodebuildmcp": {
      "command": "npx",
      "args": [
        "-y",
        "xcodebuildmcp"
      ]
    }
  }
}
```

## Tools (58)

- `build_device`: Builds an app from a project or workspace for a physical Apple device. Provide exactly one of projectPath or workspacePath. Example: build_device({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })
- `clean`: Cleans build products for either a project or a workspace using xcodebuild. Provide exactly one of projectPath or workspacePath. Platform defaults to iOS if not specified. Example: clean({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', platform: 'iOS' })
- `discover_projs`: Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files.
- `get_app_bundle_id`: Extracts the bundle identifier from an app bundle (.app) for any Apple platform (iOS, iPadOS, watchOS, tvOS, visionOS). IMPORTANT: You MUST provide the appPath parameter. Example: get_app_bundle_id({ appPath: '/path/to/your/app.app' })
- `get_device_app_path`: Gets the app bundle path for a physical device application (iOS, watchOS, tvOS, visionOS) using either a project or workspace. Provide exactly one of projectPath or workspacePath. Example: get_device_app_path({ projectPath: '/path/to/project.xcodeproj', scheme: 'MyScheme' })
- `install_app_device`: Installs an app on a physical Apple device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). Requires deviceId and appPath.
- `launch_app_device`: Launches an app on a physical Apple device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). Requires deviceId and bundleId.
- `list_devices`: Lists connected physical Apple devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro) with their UUIDs, names, and connection status. Use this to discover physical devices for testing.
- `list_schemes`: Lists available schemes for either a project or a workspace. Provide exactly one of projectPath or workspacePath. Example: list_schemes({ projectPath: '/path/to/MyProject.xcodeproj' })
- `show_build_settings`: Shows build settings from either a project or workspace using xcodebuild. Provide exactly one of projectPath or workspacePath, plus scheme. Example: show_build_settings({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })
- `start_device_log_cap`: Starts capturing logs from a specified Apple device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro) by launching the app with console output. Returns a session ID.
- `stop_app_device`: Stops an app running on a physical Apple device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). Requires deviceId and processId.
- `stop_device_log_cap`: Stops an active Apple device log capture session and returns the captured logs.
- `test_device`: Runs tests for an Apple project or workspace on a physical device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro) using xcodebuild test and parses xcresult output. Provide exactly one of projectPath or workspacePath. IMPORTANT: Requires scheme and deviceId. Example: test_device({ projectPath: "/path/to/MyProject.xcodeproj", scheme: "MyScheme", deviceId: "device-uuid" })
- `doctor`: Provides comprehensive information about the MCP server environment, available dependencies, and configuration status.
- `start_sim_log_cap`: Starts capturing logs from a specified simulator. Returns a session ID. By default, captures only structured logs.
- `stop_sim_log_cap`: Stops an active simulator log capture session and returns the captured logs.
- `build_macos`: Builds a macOS app using xcodebuild from a project or workspace. Provide exactly one of projectPath or workspacePath. Example: build_macos({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })
- `build_run_macos`: Builds and runs a macOS app from a project or workspace in one step. Provide exactly one of projectPath or workspacePath. Example: build_run_macos({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })
- `get_mac_app_path`: Gets the app bundle path for a macOS application using either a project or workspace. Provide exactly one of projectPath or workspacePath. Example: get_mac_app_path({ projectPath: '/path/to/project.xcodeproj', scheme: 'MyScheme' })
- `get_mac_bundle_id`: Extracts the bundle identifier from a macOS app bundle (.app). IMPORTANT: You MUST provide the appPath parameter. Example: get_mac_bundle_id({ appPath: '/path/to/your/app.app' }) Note: In some environments, this tool may be prefixed as mcp0_get_macos_bundle_id.
- `launch_mac_app`: Launches a macOS application. IMPORTANT: You MUST provide the appPath parameter. Example: launch_mac_app({ appPath: '/path/to/your/app.app' }) Note: In some environments, this tool may be prefixed as mcp0_launch_macos_app.
- `stop_mac_app`: Stops a running macOS application. Can stop by app name or process ID.
- `test_macos`: Runs tests for a macOS project or workspace using xcodebuild test and parses xcresult output. Provide exactly one of projectPath or workspacePath. IMPORTANT: Requires scheme. Example: test_macos({ projectPath: "/path/to/MyProject.xcodeproj", scheme: "MyScheme" })
- `scaffold_ios_project`: Scaffold a new iOS project from templates. Creates a modern Xcode project with workspace structure, SPM package for features, and proper iOS configuration.
- `scaffold_macos_project`: Scaffold a new macOS project from templates. Creates a modern Xcode project with workspace structure, SPM package for features, and proper macOS configuration.
- `boot_sim`: Boots an iOS simulator. After booting, use open_sim() to make the simulator visible. IMPORTANT: You MUST provide the simulatorUuid parameter. Example: boot_sim({ simulatorUuid: 'YOUR_UUID_HERE' })
- `build_run_sim`: Builds and runs an app from a project or workspace on a specific simulator by UUID or name. Provide exactly one of projectPath or workspacePath, and exactly one of simulatorId or simulatorName. IMPORTANT: Requires either projectPath or workspacePath, plus scheme and either simulatorId or simulatorName. Example: build_run_sim({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorName: 'iPhone 16' })
- `build_sim`: Builds an app from a project or workspace for a specific simulator by UUID or name. Provide exactly one of projectPath or workspacePath, and exactly one of simulatorId or simulatorName. IMPORTANT: Requires either projectPath or workspacePath, plus scheme and either simulatorId or simulatorName. Example: build_sim({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorName: 'iPhone 16' })
- `describe_ui`: Gets entire view hierarchy with precise frame coordinates (x, y, width, height) for all visible elements. Use this before UI interactions or after layout changes - do NOT guess coordinates from screenshots. Returns JSON tree with frame data for accurate automation.
- `get_sim_app_path`: Gets the app bundle path for a simulator by UUID or name using either a project or workspace file. IMPORTANT: Requires either projectPath OR workspacePath (not both), plus scheme, platform, and either simulatorId OR simulatorName (not both). Example: get_sim_app_path({ projectPath: '/path/to/project.xcodeproj', scheme: 'MyScheme', platform: 'iOS Simulator', simulatorName: 'iPhone 16' })
- `install_app_sim`: Installs an app in an iOS simulator. IMPORTANT: You MUST provide both the simulatorUuid and appPath parameters. Example: install_app_sim({ simulatorUuid: 'YOUR_UUID_HERE', appPath: '/path/to/your/app.app' })
- `launch_app_logs_sim`: Launches an app in an iOS simulator and captures its logs.
- `launch_app_sim`: Launches an app in an iOS simulator by UUID or name. If simulator window isn't visible, use open_sim() first. IMPORTANT: Provide either simulatorUuid OR simulatorName, plus bundleId. Note: You must install the app in the simulator before launching. The typical workflow is: build → install → launch. Example: launch_app_sim({ simulatorUuid: 'YOUR_UUID_HERE', bundleId: 'com.example.MyApp' }) or launch_app_sim({ simulatorName: 'iPhone 16', bundleId: 'com.example.MyApp' })
- `list_sims`: Lists available iOS simulators with their UUIDs.
- `open_sim`: Opens the iOS Simulator app.
- `screenshot`: Captures screenshot for visual verification. For UI coordinates, use describe_ui instead (don't determine coordinates from screenshots).
- `stop_app_sim`: Stops an app running in an iOS simulator by UUID or name. IMPORTANT: Provide either simulatorUuid OR simulatorName, plus bundleId. Example: stop_app_sim({ simulatorUuid: "UUID", bundleId: "com.example.MyApp" }) or stop_app_sim({ simulatorName: "iPhone 16", bundleId: "com.example.MyApp" })
- `test_sim`: Runs tests on a simulator by UUID or name using xcodebuild test and parses xcresult output. Works with both Xcode projects (.xcodeproj) and workspaces (.xcworkspace). IMPORTANT: Requires either projectPath or workspacePath, plus scheme and either simulatorId or simulatorName. Example: test_sim({ projectPath: "/path/to/MyProject.xcodeproj", scheme: "MyScheme", simulatorName: "iPhone 16" })
- `reset_sim_location`: Resets the simulator's location to default.
- `set_sim_appearance`: Sets the appearance mode (dark/light) of an iOS simulator.
- `set_sim_location`: Sets a custom GPS location for the simulator.
- `sim_statusbar`: Sets the data network indicator in the iOS simulator status bar. Use "clear" to reset all overrides, or specify a network type (hide, wifi, 3g, 4g, lte, lte-a, lte+, 5g, 5g+, 5g-uwb, 5g-uc).
- `swift_package_build`: Builds a Swift Package with swift build
- `swift_package_clean`: Cleans Swift Package build artifacts and derived data
- `swift_package_list`: Lists currently running Swift Package processes
- `swift_package_run`: Runs an executable target from a Swift Package with swift run
- `swift_package_stop`: Stops a running Swift Package executable started with swift_package_run
- `swift_package_test`: Runs tests for a Swift Package with swift test
- `button`: Press hardware button on iOS simulator. Supported buttons: apple-pay, home, lock, side-button, siri
- `gesture`: Perform gesture on iOS simulator using preset gestures: scroll-up, scroll-down, scroll-left, scroll-right, swipe-from-left-edge, swipe-from-right-edge, swipe-from-top-edge, swipe-from-bottom-edge
- `key_press`: Press a single key by keycode on the simulator. Common keycodes: 40=Return, 42=Backspace, 43=Tab, 44=Space, 58-67=F1-F10.
- `key_sequence`: Press key sequence using HID keycodes on iOS simulator with configurable delay
- `long_press`: Long press at specific coordinates for given duration (ms). Use describe_ui for precise coordinates (don't guess from screenshots).
- `swipe`: Swipe from one point to another. Use describe_ui for precise coordinates (don't guess from screenshots). Supports configurable timing.
- `tap`: Tap at specific coordinates. Use describe_ui to get precise element coordinates (don't guess from screenshots). Supports optional timing delays.
- `touch`: Perform touch down/up events at specific coordinates. Use describe_ui for precise coordinates (don't guess from screenshots).
- `type_text`: Type text (supports US keyboard characters). Use describe_ui to find text field, tap to focus, then type.

## FAQ

### What are the system requirements for MobileBuildMCP?

You need macOS 14.5 or later, Xcode 16.x or later, and Node.js 18.x or later (though Node.js is not required if using the Homebrew installation).

### How can I install MobileBuildMCP?

You can install it via Homebrew using 'brew install mobilebuildmcp' or via npm using 'npm install -g mobilebuildmcp@latest'.

### Does MobileBuildMCP use any telemetry?

Yes, it uses Sentry for internal runtime error telemetry only.

### Do I need to configure anything special for device tools?

Yes, device tools require that code signing is properly configured in Xcode.
