Contributions are welcome! Here's how you can help improve XcodeBuildMCP.
In addition to the prerequisites mentioned in the Getting started section of the README, you will also need:
- Node.js (v18 or later)
- npm
When running locally, you'll need to install AXe for UI automation:
# Install axe (required for UI automation)
brew tap cameroncooke/axe
brew install axe- Clone the repository
- Install dependencies:
npm install - Build the project:
npm run build - Start the server:
node build/index.js
To configure your MCP client to use your local XcodeBuildMCP server you can use the following configuration:
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "node",
"args": [
"/path_to/XcodeBuildMCP/build/index.js"
]
}
}
}VS Code is especially good for developing XcodeBuildMCP as it has a built-in way to view MCP client/server logs as well as the ability to configure MCP servers at a project level. It probably has the most comprehensive support for MCP development.
To make your development workflow in VS Code more efficient:
- Start the MCP Server: Open the
.vscode/mcp.jsonfile. You can start thexcodebuildmcp-devserver either by clicking theStartCodeLens that appears above the server definition, or by opening the Command Palette (Cmd+Shift+PorCtrl+Shift+P), runningMcp: List Servers, selectingxcodebuildmcp-dev, and starting the server. - Launch the Debugger: Press
F5to attach the Node.js debugger.
Once these steps are completed, you can utilize the tools from the MCP server you are developing within this repository in agent mode. For more details on how to work with MCP servers in VS Code see: https://code.visualstudio.com/docs/copilot/chat/mcp-servers
You can use MCP Inspector via:
npm run inspector if you prefer the explicit command:
npx @modelcontextprotocol/inspector node build/index.jsRunning the XcodeBuildMCP server with the environmental variable XCODEBUILDMCP_DEBUG=true will expose a new diagnostic tool which you can run using MCP Inspector:
XCODEBUILDMCP_DEBUG=true npm run inspectAlternatively, you can run the diagnostic tool directly:
node build/diagnostic-cli.js- Fork the repository and create a new branch
- Follow the TypeScript best practices and existing code style
- Add proper parameter validation and error handling
XcodeBuildMCP uses external template repositories for the iOS and macOS project scaffolding features. These templates are maintained separately to allow independent versioning and updates.
- iOS Template: XcodeBuildMCP-iOS-Template
- macOS Template: XcodeBuildMCP-macOS-Template
When developing or testing changes to the templates:
-
Clone the template repository you want to work on:
git clone https://github.com/cameroncooke/XcodeBuildMCP-iOS-Template.git git clone https://github.com/cameroncooke/XcodeBuildMCP-macOS-Template.git
-
Set the appropriate environment variable to use your local template:
# For iOS template development export XCODEBUILDMCP_IOS_TEMPLATE_PATH=/path/to/XcodeBuildMCP-iOS-Template # For macOS template development export XCODEBUILDMCP_MACOS_TEMPLATE_PATH=/path/to/XcodeBuildMCP-macOS-Template
-
When using MCP clients, add these environment variables to your MCP configuration:
{ "mcpServers": { "XcodeBuildMCP": { "command": "node", "args": ["/path_to/XcodeBuildMCP/build/index.js"], "env": { "XCODEBUILDMCP_IOS_TEMPLATE_PATH": "/path/to/XcodeBuildMCP-iOS-Template", "XCODEBUILDMCP_MACOS_TEMPLATE_PATH": "/path/to/XcodeBuildMCP-macOS-Template" } } } } -
The scaffold tools will use your local templates instead of downloading from GitHub releases.
- Templates are versioned independently from XcodeBuildMCP
- The default template version is specified in
package.jsonundertemplateVersion - You can override the template version with
XCODEBUILD_MCP_TEMPLATE_VERSIONenvironment variable - To update the default template version:
- Update
templateVersioninpackage.json - Run
npm run buildto regenerate version.ts - Create a new XcodeBuildMCP release
- Update
- Make changes to your local template
- Test scaffolding with your changes using the local override
- Verify the scaffolded project builds and runs correctly
- Once satisfied, create a PR in the template repository
- After merging, create a new release in the template repository using the release script
- Build the project with
npm run build - Test your changes with MCP Inspector
- Verify tools work correctly with different MCP clients
- Run
npm run lintto check for linting issues (usenpm run lint:fixto auto-fix) - Run
npm run format:checkto verify formatting (usenpm run formatto fix) - Update documentation if you've added or modified features
- Add your changes to the CHANGELOG.md file
- Push your changes and create a pull request with a clear description
- Link any related issues
For major changes or new features, please open an issue first to discuss your proposed changes.
Please follow our Code of Conduct and community guidelines.