MCP Server for Claude Code

Xcode errors,
fixed automatically.

XcodeAutoPilot is an MCP server that gives Claude Code the ability to build, analyze, and fix Xcode errors โ€” autonomously.

Fix Loop
autopilot_build
โ†’
analyze errors
โ†’
autopilot_apply_fixes
โ†’
0 errors โœ“
Repeats up to 5 iterations. Files are backed up before every patch.

10 tools, one goal.

Every tool returns structured JSON โ€” no parsing raw xcodebuild output.

autopilot_build core
Run xcodebuild and return structured errors with smart context: enclosing scope + related definitions and call sites.
autopilot_apply_fixes core
Apply fixes safely โ€” line-verified, backed up before patching.
autopilot_test test
Run tests and return structured failures with source context โ€” failing test method + related implementation code.
autopilot_screenshot vision
Build and run the app in a simulator, capture a screenshot, and return it as an image for AI visual analysis. Saves to .xap/screenshots/ and opens in Preview.
autopilot_tuist_build tuist
Build Tuist projects end-to-end. Auto-detects version: v4+ uses tuist install โ†’ generate, v3.x uses tuist fetch โ†’ generate.
autopilot_resolve_spm spm
Resolve SPM dependency issues with structured error output.
autopilot_cache_clean cache
Selectively clear DerivedData, ModuleCache, SPM cache, or Index store.
autopilot_list_schemes util
List all available Xcode build schemes.
autopilot_clean util
Run xcodebuild clean to remove build artifacts.
autopilot_history util
Return the fix session history for the current server session.

Just say it.

Type xbuild or xap build in any prompt โ€” Claude Code detects the keyword and runs the full workflow automatically.

xbuild
xap build
Build โ†’ analyze โ†’ fix loop (up to 5 iterations)
xfix
xap fix
Focused error analysis + fix with deep source context
xclean
xap clean
Cache clean โ†’ verify build
xspm
xap spm
SPM resolve โ†’ cache clean โ†’ verify build
xshot
xap shot
Build โ†’ launch in simulator โ†’ screenshot โ†’ AI visual verification
xtest
xap test
Run tests โ†’ analyze failures โ†’ fix loop (up to 5 iterations)

Up in 3 steps.

Requires Node.js 18+, Claude Code, and an Xcode project.

1

Clone & build

git clone https://github.com/leejh08/XcodeAutoPilot.git
cd XcodeAutoPilot
npm install && npm run build
2

Register the MCP server

Copy .mcp.json.example to .mcp.json and set your project path:

// .mcp.json
{
  "mcpServers": {
    "xcode-autopilot": {
      "command": "node",
      "args": ["/path/to/XcodeAutoPilot/dist/index.js"]
    }
  }
}
3

Install XAP keyword triggers (optional)

bash scripts/install-xap.sh
# Restart Claude Code โ€” then type "xbuild" to go.