Set the active Xcode project for subsequent operations
Get detailed information about the current Xcode project
Create a new Xcode project from a template
Add a file to the Xcode project
List all available schemes in the current project
Read the contents of a file
Write content to a file
Search for text content within files
Build the current Xcode project
Run tests for the current Xcode project
Analyze code for potential issues
Clean build directories
Archive the project for distribution
Initialize CocoaPods in the project
Install CocoaPods dependencies
Add a pod dependency
Remove a pod dependency
Initialize a new Swift package
Add a dependency to a Swift package
Build a Swift package
The Xcode Integration MCP provides a comprehensive bridge between AI assistants and Apple's Xcode development environment. It enables AI agents to manage iOS, macOS, watchOS, and tvOS projects, perform build operations, run tests, and interact with CocoaPods and Swift Package Manager. With enhanced error handling and support for multiple project types, this MCP significantly improves the ability of AI assistants to help with iOS and macOS development tasks.
The Xcode Integration MCP server provides AI assistants with the ability to interact with Xcode projects, manage iOS simulators, and perform various Xcode-related tasks. This server bridges the gap between AI capabilities and iOS/macOS development workflows.
Clone the repository:
git clone https://github.com/r-huijts/xcode-mcp-server.git
cd xcode-mcp-server
Install dependencies:
npm install
Create a .env
file based on the example:
cp .env.example .env
Run the setup script to configure the server:
./setup.sh
Build the server:
npm run build
Start the server:
npm start
The included setup.sh
script automates the installation process by:
If you encounter issues with the automatic setup, you can perform the steps manually as outlined above.
The server can be configured through environment variables in the .env
file:
PORT
: The port on which the MCP server will run (default: 3000)LOG_LEVEL
: Logging verbosity (options: debug, info, warn, error)DEFAULT_PROJECT_PATH
: Default directory to look for Xcode projectsXCODE_PATH
: Custom path to Xcode.app if not in the standard locationOnce the server is running, AI assistants can interact with it through the Model Context Protocol. The server provides tools for:
Server fails to start
npm install
Project operations failing
Build or test operations failing
xcode-select --install
The server logs can provide valuable information for troubleshooting:
LOG_LEVEL
in the .env
file for more detailed logsFor advanced users, the server can be further customized:
tsconfig.json
file to adjust TypeScript compilation optionssrc
directoryTo update the server to the latest version:
Pull the latest changes:
git pull origin master
Install any new dependencies:
npm install
Rebuild the server:
npm run build
Restart the server:
npm start