
sl-test
sl-test
README
<img src="banner.png" alt="XcodeBuild MCP" width="600"/>
A Model Context Protocol (MCP) server that provides Xcode-related tools for integration with AI assistants and other MCP clients.
Table of contents
- Overview
- Why?
- Features
- Getting started
- Incremental build support
- Troubleshooting
- Privacy
- Selective tool registration
- Demos
- Contributing
- Licence
Overview
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.
<caption>Using Cursor to build, install, and launch an app on the iOS simulator while capturing logs at run-time.</caption>
Why?
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.
Features
The XcodeBuildMCP server provides the following tool capabilities:
Xcode project management
- Discover Projects: Xcode projects and workspaces discovery
- 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
- Incremental build support: Lightning fast builds using incremental build support (experimental, opt-in required)
- Project Scaffolding: Create new iOS and macOS projects from modern templates with workspace + SPM package architecture, customizable bundle identifiers, deployment targets, and device families
Swift Package Manager
- Build Packages: Build Swift packages with configuration and architecture options
- Run Tests: Execute Swift package test suites with filtering and parallel execution
- Run Executables: Execute package binaries with timeout handling and background execution support
- Process Management: List and stop long-running executables started with Swift Package tools
- Clean Artifacts: Remove build artifacts and derived data for fresh builds
Simulator management
- Simulator Control: List, boot, and open iOS simulators
- App Deployment: Install and launch apps on iOS simulators
- Log Capture: Capture run-time logs from a simulator
- UI Automation: Interact with simulator UI elements (beta)
- Screenshot: Capture screenshots from a simulator (beta)
App utilities
- Bundle ID Extraction: Extract bundle identifiers from iOS and macOS app bundles
- App Launching: Launch built applications on both simulators and macOS
Getting started
Prerequisites
- macOS 14.5 or later
- Xcode 16.x or later
- Node 18.x or later
- AXe 1.0.0 or later (optional, required for UI automation)
UI Automation
For UI automation features (tap, swipe, type etc.), you'll need to install AXe:
brew tap cameroncooke/axe
brew install axe
For more information about AXe and other installation methods, see the AXe repository.
Configure your MCP client
Quick install
For a quick install, you can use the following links:
- <img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">
- <img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">
Manual installation
Configure your MCP client (Windsurf, Cursor, Claude Desktop, Claude Code etc.) to use the XcodeBuildMCP server by ammending your client application's MCP configuration.
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
]
}
}
}
Alternative installation method using mise
Alternatively, you can use XcodeBuildMCP without a specific installation of Node.js by using mise
to install it:
# macOS (Homebrew)
brew install mise
# Other installation methods
# See https://mise.jdx.dev/getting-started.html
Then configure your MCP client to use mise to install XcodeBuildMCP:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "mise",
"args": [
"x",
"npm:xcodebuildmcp@1.7.0",
"--",
"xcodebuildmcp"
]
}
}
}
[!NOTE] When using mise avoid using the @latest tag as mise will cache the package and may not update to the latest version automatically, instead prefer an explicit version number.
[!IMPORTANT] Please note that XcodeBuildMCP will request xcodebuild to skip macro validation. This is to avoid errors when building projects that use Swift Macros.
Incremental build support
XcodeBuildMCP includes experimental support for incremental builds. This feature is disabled by default and can be enabled by setting the INCREMENTAL_BUILDS_ENABLED
environment variable to true
:
To enable incremental builds, set the INCREMENTAL_BUILDS_ENABLED
environment variable to true
:
Example MCP client configuration:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
],
"env": {
"INCREMENTAL_BUILDS_ENABLED": "true"
}
}
}
}
[!IMPORTANT] Please note that incremental builds support is currently highly experimental and your mileage may vary. Please report any issues you encounter to the issue tracker.
Troubleshooting
If you encounter issues with XcodeBuildMCP, the diagnostic tool can help identify the problem by providing detailed information about your environment and dependencies.
Diagnostic Tool
The diagnostic tool is a standalone utility that checks your system configuration and reports on the status of all dependencies required by XcodeBuildMCP. It's particularly useful when reporting issues.
Using with npx
# Run the diagnostic tool using npx
npx xcodebuildmcp@1.7.0 xcodebuildmcp-diagnostic
Using with mise
# Run the diagnostic tool using mise
mise x npm:xcodebuildmcp@1.7.0 -- xcodebuildmcp-diagnostic
The diagnostic tool will output comprehensive information about:
- System and Node.js environment
- Xcode installation and configuration
- Required dependencies (xcodebuild, AXe, etc.)
- Environment variables affecting XcodeBuildMCP
- Feature availability status
When reporting issues on GitHub, please include the full output from the diagnostic tool to help with troubleshooting.
MCP Server Logs
It can be helpful to have access to the log messages from the MCP server to identify any issues. The logs are captured by the client application, for example in Cursor:
Cursor:
find ~/Library/Application\ Support/Cursor/logs -name "Cursor MCP.log" -exec zip -r matching_logs.zip {} +
If your MCP client doesn't have log files you can run the server directly using the MCP Inspector tool see Debugging for more information on how to do this. Once running the MCP tool prints all log messages to it's error pane, which can be helpful in diagnosing issues.
Privacy
This project uses Sentry for error monitoring and diagnostics. Sentry helps us track issues, crashes, and unexpected errors to improve the reliability and stability of XcodeBuildMCP.
What is sent to Sentry?
- Only error-level logs and diagnostic information are sent to Sentry by default.
- Error logs may include details such as error messages, stack traces, and (in some cases) file paths or project names. You can review the sources in this repository to see exactly what is logged.
Opting Out of Sentry
- If you do not wish to send error logs to Sentry, you can opt out by setting the environment variable
SENTRY_DISABLED=true
.
Example MCP client configuration:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
],
"env": {
"SENTRY_DISABLED": "true"
}
}
}
}
Selective tool registration
By default all tools are enabled but for some clients it may be useful to only enable specific tools to reduce the amount of context that is sent to the client. This can be achieved by setting specific environment variables in your clients MCP configuration.
Once you have enabled one or more tools or groups of tools all other tools will be disabled. For example, to enable only the simulator related tools, you can set the environment variable to XCODEBUILDMCP_GROUP_IOS_SIMULATOR_WORKFLOW=true
this will only expose tools for building, running and debugging on simulators
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": [
"-y",
"xcodebuildmcp@latest"
],
"env": {
"XCODEBUILDMCP_GROUP_IOS_SIMULATOR_WORKFLOW": "true"
}
}
}
}
You can find a list of available tools and detailed instructions on how to enable them in the TOOL_OPTIONS.md file.
Demos
Autonomously fixing build errors in Cursor
Utilising the new UI automation and screen capture features
Building and running iOS app in Claude Desktop
https://github.com/user-attachments/assets/e3c08d75-8be6-4857-b4d0-9350b26ef086
Contributing
Contributions are welcome! Here's how you can help improve XcodeBuildMCP.
See our CONTRIBUTING document for more information on how to configure your local environment and contribute to the project.
Licence
This project is licensed under the MIT License - see the LICENSE file for details.
MCP Server Verification
Glama.ai
<a href="https://glama.ai/mcp/servers/@cameroncooke/XcodeBuildMCP"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@cameroncooke/XcodeBuildMCP/badge" alt="XcodeBuildMCP MCP server" /> </a>
MseeP.a
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。