| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
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.
Using Cursor to build, install, and launch an app on the iOS simulator while capturing logs at run-time.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:
To install mise:
# macOS (Homebrew)
brew install mise
# Other installation methods
# See https://mise.jdx.dev/getting-started.htmlFor more information about mise, visit the official documentation.
Configure your MCP client (Windsurf, Cursor, Claude Desktop, etc.) to use the XcodeBuildMCP server by ammending your client application's MCP configuration, changing the version number to match the version you wish to use:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "mise",
"args": [
"x",
"npm:xcodebuildmcp@1.4.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.
For UI automation features (tap, swipe, screenshot, etc.), you'll need to install Facebook's idb_companion:
brew tap facebook/fb
brew install idb-companionThe idb client is also required but XcodeBuildMCP attempts to install it for you. If you find that the UI automation features are still not available you can install the client manually using the following command (assumes you have Python installed):
pipx install fb-idb==1.1.7Important
Please note that UI automation features are currently in beta so there might be some rough edges. If you encounter any issues, please report them in the issue tracker.
Note
Displaying images in tool responses and embedding them in chat context may not be supported by all MCP Clients; it's currently known to be supported in Cursor.
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": "mise",
"args": [
"x",
"npm:xcodebuildmcp@1.4.0",
"--",
"xcodebuildmcp"
],
"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.
If you encounter issues with XcodeBuildMCP, the diagnostic tool can help identify the problem by providing detailed information about your environment and dependencies.
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.
# Run the diagnostic tool using mise
mise x npm:xcodebuildmcp@1.4.0 -- xcodebuildmcp-diagnostic# Run the diagnostic tool using npx
npx xcodebuildmcp@1.4.0 xcodebuildmcp-diagnosticThe diagnostic tool will output comprehensive information about:
When reporting issues on GitHub, please include the full output from the diagnostic tool to help with troubleshooting.
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.
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.
Example MCP client configuration:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "mise",
"args": [
"x",
"npm:xcodebuildmcp@1.4.0",
"--",
"xcodebuildmcp"
],
"env": {
"SENTRY_DISABLED": "true"
}
}
}
}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": "mise",
"args": [
"x",
"npm:xcodebuildmcp@1.4.0",
"--",
"xcodebuildmcp"
],
"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.
Demo3.mp4Contributions 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.
This project is licensed under the MIT License - see the LICENSE file for details.
| Back | FazBrowse Home | New Git URL |