# XcodeBuildMCP

A Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants and other MCP clients.

## Quick Start

```bash
# Connect this server (installs CLI if needed)
npx -y @smithery/cli@latest mcp add cameroncooke/xcodebuildmcp

# Browse available tools
npx -y @smithery/cli@latest tool list cameroncooke/xcodebuildmcp

# Get full schema for a tool
npx -y @smithery/cli@latest tool get cameroncooke/xcodebuildmcp debug_attach_sim

# Call a tool
npx -y @smithery/cli@latest tool call cameroncooke/xcodebuildmcp debug_attach_sim '{}'
```

## Tools (71)

- `debug_attach_sim` — Attach LLDB to a running iOS simulator app. Provide bundleId or pid, plus simulator defaults.
- `debug_breakpoint_add` — Add a breakpoint by file/line or function name for the active debug session.
- `debug_breakpoint_remove` — Remove a breakpoint by id for the active debug session.
- `debug_continue` — Resume execution in the active debug session or a specific debugSessionId.
- `debug_detach` — Detach the current debugger session or a specific debugSessionId.
- `debug_lldb_command` — Run an arbitrary LLDB command within the active debug session.
- `debug_stack` — Return a thread backtrace from the active debug session.
- `debug_variables` — Return variables for a selected frame in the active debug session.
- `build_device` — Builds an app for a connected device.
- `clean` — Cleans build products with xcodebuild.
- `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).…
- `get_device_app_path` — Retrieves the built app path for a connected device.
- `install_app_device` — Installs an app on a connected device.
- `launch_app_device` — Launches an app on a connected device.
- `list_devices` — Lists connected physical Apple devices (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro) with their UUIDs, names,…
- `list_schemes` — Lists schemes for a project or workspace.
- `show_build_settings` — Shows xcodebuild build settings.
- `start_device_log_cap` — Starts log capture on a connected device.
- `stop_app_device` — Stops a running app on a connected device.
- `stop_device_log_cap` — Stops an active Apple device log capture session and returns the captured logs.
- `test_device` — Runs tests on a physical Apple device.
- `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.
- `build_run_macos` — Builds and runs a macOS app.
- `get_mac_app_path` — Retrieves the built macOS app bundle path.
- `get_mac_bundle_id` — Extracts the bundle identifier from a macOS app bundle (.app). IMPORTANT: You MUST provide the appPath parameter. Examp…
- `launch_mac_app` — Launches a macOS application. IMPORTANT: You MUST provide the appPath parameter. Example: launch_mac_app({ appPath: '/p…
- `stop_mac_app` — Stops a running macOS application. Can stop by app name or process ID.
- `test_macos` — Runs tests for a macOS target.
- `scaffold_ios_project` — Scaffold a new iOS project from templates. Creates a modern Xcode project with workspace structure, SPM package for fea…
- `scaffold_macos_project` — Scaffold a new macOS project from templates. Creates a modern Xcode project with workspace structure, SPM package for f…
- `session-clear-defaults` — Clear selected or all session defaults.
- `session-set-defaults` — Set the session defaults needed by many tools. Most tools require one or more session defaults to be set before they ca…
- `session-show-defaults` — Show current session defaults.
- `boot_sim` — Boots an iOS simulator.
- `build_run_sim` — Builds and runs an app on an iOS simulator.
- `build_sim` — Builds an app for an iOS simulator.
- `describe_ui` — Gets entire view hierarchy with precise frame coordinates (x, y, width, height) for all visible elements. Use this befo…
- `get_sim_app_path` — Retrieves the built app path for an iOS simulator.
- `install_app_sim` — Installs an app in an iOS simulator.
- `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.
- `list_sims` — Lists available iOS simulators with their UUIDs.
- `open_sim` — Opens the iOS Simulator app.
- `record_sim_video` — Starts or stops video capture for an iOS simulator.
- `screenshot` — Captures screenshot for visual verification. For UI coordinates, use describe_ui instead (don't determine coordinates f…
- `stop_app_sim` — Stops an app running in an iOS simulator.
- `test_sim` — Runs tests on an iOS simulator.
- `erase_sims` — Erases a simulator by UDID.
- `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 netwo…
- `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-l…
- `key_press` — Press a single key by keycode on the simulator. Common keycodes: 40=Return, 42=Backspace, 43=Tab, 44=Space, 58-67=F1-F1…
- `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 s…
- `swipe` — Swipe from one point to another. Use describe_ui for precise coordinates (don't guess from screenshots). Supports confi…
- `tap` — Tap at specific coordinates or target elements by accessibility id or label. Use describe_ui to get precise element coo…
- `touch` — Perform touch down/up events at specific coordinates. Use describe_ui for precise coordinates (don't guess from screens…
- `type_text` — Type text (supports US keyboard characters). Use describe_ui to find text field, tap to focus, then type.

```bash
# Get full input/output schema for a tool
npx -y @smithery/cli@latest tool get cameroncooke/xcodebuildmcp <tool-name>
```

## Resources

- `xcodebuildmcp://devices`
- `xcodebuildmcp://doctor`
- `xcodebuildmcp://session-status`
- `xcodebuildmcp://simulators`

---

Source: https://github.com/cameroncooke/XcodeBuildMCP
