MCP server for Xcode build automation and log parsing.
- Opens Xcode projects and triggers builds in Xcode, not using xcodebuild. 1
- Parses build logs to extract errors and warnings with precise line:column numbers using XCLogParser
- Provides MCP tools for AI assistants to interact with Xcode
⚠️ Warning: This tool directly controls Xcode through JavaScript for Automation (JXA). It may interfere with your active Xcode session and trigger builds that could overwrite unsaved work. Use with caution in active development environments.
- macOS with Xcode installed
- Node.js 18+
- XCLogParser:
brew install xclogparser
Run directly with npx:
brew install xclogparser
npx -y xcodemcp@latest
Or install globally:
brew install xclogparser
npm install -g xcodemcp
Add to your MCP configuration:
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {}
}
}
}
To add XcodeMCP to Claude Code using the command line:
claude mcp add-json XcodeMCP '{
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {}
}'
Or clone locally:
git clone https://github.com/lapfelix/XcodeMCP.git
cd XcodeMCP
npm install
node index.js
xcode_open_project
- Open Xcode projects and workspacesxcode_build
- Build with optional scheme and destination, returns errors/warnings with line:column numbersxcode_clean
- Clean build artifactsxcode_test
- Run unit and UI tests with optional command line argumentsxcode_run
- Run the active scheme with optional command line argumentsxcode_debug
- Start debugging session with optional schemexcode_stop
- Stop current build/run/test operationxcode_get_schemes
- List all available schemes with active statusxcode_set_active_scheme
- Switch between schemesxcode_get_run_destinations
- List simulators and devices with platform infoxcode_get_workspace_info
- Get workspace details and current statusxcode_get_projects
- List projects in workspacexcode_open_file
- Open specific files in Xcode with optional line number
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "xcode_build", "arguments": {}}}' | node index.js
Output:
❌ BUILD FAILED (1 errors)
ERRORS:
• /path/file.swift:42:10: Expected expression
⚠️ BUILD COMPLETED WITH WARNINGS (2 warnings)
WARNINGS:
• /path/file.swift:25: Variable 'unused' was never mutated; consider changing to 'let' constant
• /path/file.swift:30:5: Initialization of immutable value 'data' was never used
Footnotes
-
For an alternative that uses
xcodebuild
, see XcodeBuildMCP ↩