XcodeBuild
Автоматизируйте проекты Xcode с помощью ИИ, используя XcodeBuild MCP. Собирайте, тестируйте и развёртывайте iOS/macOS-приложения через Model Context Protocol. Оптимизируйте разработку с помощью AI-агентов. Начните сегодня!
XcodeBuild упрощает взаимодействие между AI-агентами и проектами Xcode, предоставляя специальные инструменты для типовых операций Xcode через протокол MCP (Model Context Protocol). Это устраняет необходимость в ручном вводе команд в терминале, обеспечивая надёжный и эффективный процесс разработки. Инструмент позволяет агентам самостоятельно проверять изменения кода путём сборки проектов, анализа ошибок и автономных итераций, эффективно автоматизируя рабочие процессы разработки.
Ключевые особенности
A Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants and other MCP clients.
This project implements an MCP server that exposes Xcode operations as tools that can be invoked by AI agents via the MCP protocol. It enables programmatic interaction with Xcode projects through a standardised interface, optimised for agent-driven development workflows.
Demo2.mp4
The XcodeBuild MCP tool exists primarily to streamline and standardise interaction between AI agents and Xcode projects. By providing dedicated tools for common Xcode operations, it removes reliance on manual or potentially incorrect command-line invocations.
This ensures a reliable and efficient development process, allowing agents to seamlessly leverage Xcode's capabilities while reducing the risk of configuration errors.
Critically, this MCP enables AI agents to independently validate code changes by building projects, inspecting errors, and iterating autonomously. In contrast to user-driven tools like Sweetpad, XcodeBuild MCP empowers agents to automate these workflows effectively.
The XcodeBuildMCP server provides the following tool capabilities:
- Build Operations: Platform-specific build tools for macOS, iOS simulator, and iOS device targets
- Project Information: Tools to list schemes and show build settings for Xcode projects and workspaces
- Clean Operations: Clean build products using xcodebuild's native clean action
- Simulator Control: List, boot, and open iOS simulators
- App Deployment: Install and launch apps on iOS simulators
- Bundle ID Extraction: Extract bundle identifiers from iOS and macOS app bundles
- App Launching: Launch built applications on both simulators and macOS
- Node.js (v16 or later)
- npm
- Xcode command-line tools
- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build - Optionally start the server:
node build/index.js
Note
You don't need to run the server manually as MCP clients will do this for you.
Create a new custom server configuration and add the following; changing the path to the actual path you cloned the repo to.
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "node",
"args": [
"/path_to/XcodeBuildMCP/build/index.js"
]
}
}
}You can use MCP Inspector via:
npx @modelcontextprotocol/inspector node build/index.jsDemo1.mp4
Demo3.mp4
This project is licensed under the MIT License - see the LICENSE file for details.
XcodeBuild MCP Server
XcodeBuild — это MCP-сервер, который предоставляет набор инструментов для взаимодействия с Xcode через протокол MCP (Model Context Protocol). Он предназначен для интеграции с AI-ассистентами и позволяет автоматизировать сборку, запуск и управление Xcode-проектами.
Зачем это нужно?
Основная цель XcodeBuild — стандартизировать и упростить взаимодействие AI-агентов с Xcode. Вместо ручного ввода команд или использования сторонних инструментов, этот MCP-сервер предоставляет надёжные и предсказуемые инструменты для типовых операций. Это особенно полезно для автономной валидации кода: AI-агент может собрать проект, увидеть ошибки и исправить их без участия человека.
Возможности
Управление Xcode-проектом
- Сборка под macOS, iOS Simulator и iOS Device
- Информация о проекте: список схем (schemes) и настройки сборки (build settings)
- Очистка продуктов сборки (clean)
Управление симуляторами
- Список, запуск и открытие iOS-симуляторов
- Установка и запуск приложений на симуляторе
Утилиты для приложений
- Извлечение Bundle ID из .app-пакетов
- Запуск собранных приложений на симуляторе или macOS
Установка
Требования
- Node.js v16 или новее
- npm
- Xcode Command Line Tools
Шаги
-
Клонируйте репозиторий:
git clone <repository-url> cd XcodeBuildMCP -
Установите зависимости:
npm install -
Соберите проект:
npm run build
Запускать сервер вручную не нужно — MCP-клиент сделает это автоматически при обращении.
Настройка клиентов (Windsurf / Cursor / Claude Desktop)
Добавьте конфигурацию MCP-сервера, указав путь к собранному файлу build/index.js:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "node",
"args": [
"/полный/путь/к/XcodeBuildMCP/build/index.js"
]
}
}
}
Замените /полный/путь/к/ на реальный путь к репозиторию.
Отладка
Для проверки работы сервера используйте MCP Inspector:
npx @modelcontextprotocol/inspector node build/index.js
Демонстрация
В репозитории доступны видео-демо:
- Сборка и запуск iOS-приложения в Cursor (
Demo1.mp4) - Сборка и запуск macOS-приложения в Claude Code (
Demo2.mp4) - Сборка и запуск iOS-приложения в Claude Code (
Demo3.mp4)
Лицензия
Проект распространяется под лицензией MIT. Подробности — в файле LICENSE.
Какие операции в Xcode может автоматизировать XcodeBuild MCP?
XcodeBuild MCP может автоматизировать операции сборки, получения информации о проекте, очистки, управления симулятором (список, загрузка, запуск) и развёртывание приложений на симуляторах iOS и macOS.
Что такое XcodeBuild MCP?
XcodeBuild MCP — это сервер протокола Model Context Protocol (MCP), который позволяет ИИ-агентам взаимодействовать с проектами Xcode и автоматизировать их. Он предоставляет инструменты для сборки, очистки, развёртывания и управления проектами Xcode через стандартизированный интерфейс.
Как интегрировать XcodeBuild MCP с ИИ-инструментами, такими как Cursor или Claude?
Вы можете интегрировать XcodeBuild MCP, создав пользовательскую конфигурацию сервера в вашем ИИ-инструменте и указав путь к файлу `build/index.js` клонированного репозитория. Пример конфигурации см. в README.
Каковы преимущества использования XcodeBuild MCP?
XcodeBuild MCP упрощает взаимодействие между ИИ-агентами и Xcode, автоматизируя задачи, снижая количество ошибок и позволяя ИИ независимо проверять код. Это способствует надёжному и эффективному процессу разработки.
Каковы предварительные требования для использования XcodeBuild MCP?
Вам понадобятся Node.js (v16 или новее), npm и инструменты командной строки Xcode, установленные в вашей системе.
Build Device
Builds an app for a connected device.
Parameters
3Clean
Cleans build products with xcodebuild.
Parameters
4Discover Projs
Scans a directory (defaults to workspace root) to find Xcode project (.xcodeproj) and workspace (.xcworkspace) files.
Parameters
3Get 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({ ...
Parameters
1Get Device App Path
Retrieves the built app path for a connected device.
Parameters
1Install App Device
Installs an app on a connected device.
Parameters
1Launch App Device
Launches an app on a connected device.
Parameters
1List 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 schemes for a project or workspace.
Show Build Settings
Shows xcodebuild build settings.
Start Device Log Cap
Starts log capture on a connected device.
Parameters
1Stop App Device
Stops a running app on a connected device.
Parameters
1Stop Device Log Cap
Stops an active Apple device log capture session and returns the captured logs.
Parameters
1Test Device
Runs tests on a physical Apple device.
Parameters
5Doctor
Provides comprehensive information about the MCP server environment, available dependencies, and configuration status.
Parameters
1Start Sim Log Cap
Starts capturing logs from a specified simulator. Returns a session ID. By default, captures only structured logs.
Parameters
3Stop Sim Log Cap
Stops an active simulator log capture session and returns the captured logs.
Parameters
1Build Macos
Builds a macOS app.
Parameters
3Build Run Macos
Builds and runs a macOS app.
Parameters
3Get Mac App Path
Retrieves the built macOS app bundle path.
Parameters
2Get 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 environ...
Parameters
1Launch 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 ...
Parameters
2Stop Mac App
Stops a running macOS application. Can stop by app name or process ID.
Parameters
2Test Macos
Runs tests for a macOS target.
Parameters
4Scaffold 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.
Parameters
11Scaffold 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.
Parameters
8Session Clear Defaults
Clear selected or all session defaults.
Parameters
2allbooleankeysarraySession Set Defaults
Set the session defaults needed by many tools. Most tools require one or more session defaults to be set before they can be used. Agents should set the relevant defaults at the beginning of a session.
Parameters
9schemestringdeviceIdstringprojectPathstringsimulatorIdstringSession Show Defaults
Show current session defaults.
Boot Sim
Boots an iOS simulator.
Build Run Sim
Builds and runs an app on an iOS simulator.
Parameters
3Build Sim
Builds an app for an iOS simulator.
Parameters
3Describe 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 screen...
Parameters
1simulatorUuidstringGet Sim App Path
Retrieves the built app path for an iOS simulator.
Parameters
1Install App Sim
Installs an app in an iOS simulator.
Parameters
1Launch App Logs Sim
Launches an app in an iOS simulator and captures its logs.
Parameters
2Launch App Sim
Launches an app in an iOS simulator.
Parameters
2List Sims
Lists available iOS simulators with their UUIDs.
Parameters
1Open Sim
Opens the iOS Simulator app.
Record Sim Video
Starts or stops video capture for an iOS simulator.
Parameters
4Screenshot
Captures screenshot for visual verification. For UI coordinates, use describe_ui instead (don't determine coordinates from screenshots).
Parameters
1simulatorUuidstringStop App Sim
Stops an app running in an iOS simulator.
Parameters
1Test Sim
Runs tests on an iOS simulator.
Parameters
4Erase Sims
Erases simulator content and settings. Provide exactly one of: simulatorUdid or all=true. Optional: shutdownFirst to shut down before erasing.
Parameters
3Reset Sim Location
Resets the simulator's location to default.
Parameters
1Set Sim Appearance
Sets the appearance mode (dark/light) of an iOS simulator.
Parameters
2Set Sim Location
Sets a custom GPS location for the simulator.
Parameters
3Sim 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).
Parameters
2Swift Package Build
Builds a Swift Package with swift build
Parameters
5Swift Package Clean
Cleans Swift Package build artifacts and derived data
Parameters
1Swift Package List
Lists currently running Swift Package processes
Swift Package Run
Runs an executable target from a Swift Package with swift run
Parameters
7Swift Package Stop
Stops a running Swift Package executable started with swift_package_run
Parameters
1Swift Package Test
Runs tests for a Swift Package with swift test
Parameters
7Button
Press hardware button on iOS simulator. Supported buttons: apple-pay, home, lock, side-button, siri
Parameters
3durationnumbersimulatorUuidstringGesture
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
Parameters
8Key Press
Press a single key by keycode on the simulator. Common keycodes: 40=Return, 42=Backspace, 43=Tab, 44=Space, 58-67=F1-F10.
Parameters
3keyCodeintegerdurationnumbersimulatorUuidstringKey Sequence
Press key sequence using HID keycodes on iOS simulator with configurable delay
Parameters
3delaynumberkeyCodesarraysimulatorUuidstringLong Press
Long press at specific coordinates for given duration (ms). Use describe_ui for precise coordinates (don't guess from screenshots).
Parameters
4xintegeryintegerdurationnumbersimulatorUuidstringSwipe
Swipe from one point to another. Use describe_ui for precise coordinates (don't guess from screenshots). Supports configurable timing.
Parameters
9x1integerx2integery1integery2integerdeltanumberTap
Tap at specific coordinates. Use describe_ui to get precise element coordinates (don't guess from screenshots). Supports optional timing delays.
Parameters
5xintegeryintegerpreDelaynumberpostDelaynumbersimulatorUuidstringTouch
Perform touch down/up events at specific coordinates. Use describe_ui for precise coordinates (don't guess from screenshots).
Parameters
6xintegeryintegerupbooleandownbooleandelaynumberType Text
Type text (supports US keyboard characters). Use describe_ui to find text field, tap to focus, then type.
Parameters
2textstringsimulatorUuidstring
Комментарии
Комментариев пока нет. Будьте первым.