xclane MCP server
Coordinates Xcode builds and GUI/headless sessions across warm build slots, manages simulator pools and test sharding, and provides diagnostics plus build/test/run tools for Xcode projects.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
xclane
Native Swift macOS (macOS 15+) Xcode build coordinator for Antigravity, Claude Code, and OpenAI Codex: warm fixed-path build slots, Xcode GUI (windowtab-*) coordination, managed simulator pooling, and a built-in stdio MCP server.
Inspired by xcslot, rebuilt from the ground up in Swift 6 with zero third-party dependencies.

Features
Warm build slots (
~/Library/Developer/xclane, override via$XCLANE_HOME): Mirrors git worktrees viaclonefile(2)at fixed paths so Xcode keeps incremental builds across parallel branches and agent worktrees.3-tier fast sync, split manifest & conflict-safe write-back: Reads
.git/indexdirectly using APFS nanosecond timestamps to bypass racy same-secondgit statusre-hashing, separates lightweight slot metadata (state.json) from the per-file mirror table (manifest.json, skipping rewrites on unchanged syncs), and mirrors diffs viaclonefile(2)across three tiers: stat hit -> Git blob OID hit (zero file reads across worktrees) -> 64 KB streaming compare for dirty and non-ignored untracked files (sync.includeIgnoreddefaults to["*.xcconfig"]), keeping warm wrapper overhead around~0.11–0.15s. After a command exits cleanly, write-back copies slot-created or modified files back to the source worktree while skipping any file edited concurrently in the worktree so live edits are never clobbered.Kernel
flock(2)locks & machine permit cap: Zeropspolling, zero stale locks onSIGKILL, and machine-wide concurrency permits (maxConcurrent) acquired before syncing so slots stay fresh.Xcode GUI (
windowtab-*) & headless MCP awareness: Coordinates with Xcode's open GUI window (windowtab-*via native Xcode MCP), activegui-lockcooperative leases (managed viaxclane gui-lockor installed client hooks), configured external lockfiles, and live compiler/XCBBuildService/SWBBuildServiceactivity owned byXcode.appor Xcode 27's headlessXcode Service.app(xcrun mcp-server). When Xcode is busy,xclanewaits until it finishes (up towaitSeconds, default3600; pass--no-waitto fail immediately or--no-yieldto override).Build-flavor & dirty-tree slot selection: Ranks free slots by matching worktree + build flavor (scheme, configuration, destination, action, and build/cache settings), then warm matching-flavor slots from another worktree or detached slot (preferring matching cache mode over clobbering a different mode), then same worktree (different flavor), then unused (
cold) slots, then detached/other warm slots. If the best warm matching slot is busy and the best free alternative is cold or a different worktree's flavor,xclanewaits briefly (up towarmSlotWaitSeconds, default60, scaled to the busy slot's last build duration) before falling back with a warning. Automatically caps-jobswhen multiplexcodebuildpermits are active concurrently.Shared repo caches & multi-package workspaces: Supports
.xcworkspace, local & remote SwiftPM dependencies, and-testPlan; reuses the user's shared SwiftPM cache (~/Library/Caches/org.swift.swiftpmvia-packageCachePath); maintains a repo-level APFSSourcePackagessnapshot (and reads Xcode's existing~/Library/Developer/Xcode/DerivedDataread-only) so Cold Slot 2 bootstraps offline even while Slot 1 is held busy; skips redundant network fetches (-skipPackageUpdates -onlyUsePackageVersionsFromResolvedFile) whenPackage.resolvedmatches; supports opt-in shared LLVM CAS (--cacheor"enableCompilationCache": true,10Gcap viaCOMPILATION_CACHE_LIMIT_SIZE) with slot-root prefix mapping (SWIFT_OTHER_PREFIX_MAPPINGS/CLANG_OTHER_PREFIX_MAPPINGS, hitting up to 100% cross-slot compile tasks); and, when product handouts are requested (--products-to,-derivedDataPath, orSYMROOT/DSTROOT/BUILD_DIR/BUILD_ROOT/CONFIGURATION_BUILD_DIR), provides UUID-cacheddsymutilhandouts with<App>.dSYM/Contents/Resources/<UUID>.plistDBGSourcePathRemapping.Workspace hygiene: Ignores ephemeral Xcode user state (
xcuserdata,.DS_Store) on untracked sync and write-back while preserving genuine generated files likePackage.resolved.Bounded storage & physical size reporting: Caps active per-repo slots (
1..slots), expires dormant slots idle longer thanslotIdleDays(default30days), detaches slots whose linked worktree was deleted (git worktree remove) and clears theirDerivedDataafter 24h idle, runs lazy daily housekeeping (at most once every 24h duringxclaneinvocations, or on demand viaxclane slots prune— no background daemon) to prune stale.dSYMs, old logs, oversized CAS, and idle simulators, and reports physical APFS allocation viaxclane status --sizes.Zero-config fast builds (on by default in
0.5+) &--fast-agent: Automatically injectsCOMPILER_INDEX_STORE_ENABLE=NO(override with--index-store), shares Apple SDKMODULE_CACHE_DIR,SDK_STAT_CACHE_DIR, andSDK_EXPLICIT_MODULES_OUTPUT_PATHacross all slots and repos in<root>/shared-sdk(opt out with--no-shared-sdk-caches), and scopesgeneric/platform=*Simulatorbuilds on Apple Silicon toONLY_ACTIVE_ARCH=YES ARCHS=arm64(unlessONLY_ACTIVE_ARCH=,ARCHS=, or-archis passed). For rapid agent iteration loops, add--fast-agent(skips dSYMs, debug dylib wrapping, stdlib tool copy, and product validation while keeping XCTest and Swift Testingfile:linediagnostics intact). Automatically bypassed onarchive,install,exportArchive,clean, andanalyze.Managed simulator pool, async pre-boot, slim clones & diff-aware/weighted testing: Lazily clones matching
Shutdownbaseline simulators intoxclane-<Device>-<n>devices (falling back tosimctl createwhen matching baselines areBooted) for test runs, starts backgroundsimctl bootimmediately when leased to overlap simulator boot with compilation, prefers already-Bootedclones on subsequent runs, locks explicit-destination id=<UDID>test runs withflock(2), and prunes idle clones. Runxclane sim slim --all(or set"simPool": { "slimClones": true }) to disable 65 non-essential background daemons while protectingcom.apple.gamed. Pass--affected(or--affected-base <ref>) to walkXCBuildData/PIFCachereverse dependencies and run only impacted test targets (skipping test execution in~0.07swhen no test targets are impacted, falling back safely on manifest/config/unmapped source edits). With--shards N(orshards: Ninxclane_test),xclanebuilds once (build-for-testing), enumerates XCTest + Swift Testing identifiers, balances suites via EMA duration-weighted LPT bin packing (test-timings.json), and fanstest-without-buildingacross up toNisolated simulator clones concurrently.Background slot pre-warming (
xclane slots warm): Automatically persists portable replay args (lastBuildArgs) after successful builds so idle spare slots can be pre-warmed ahead of parallel agent work (xclane slots warm --if-idle --backgroundor MCPxclane_slotsaction: "warm"). Skips busy or already-warm slots atHEAD, throttles CPU/I/O withtaskpolicy -c utility -d throttle(--low-priority), and stops automatically if an active build or Xcode GUI session starts.Build diagnostics & SQLite forensics (
xclane doctor --profile): InspectsXCBuildData/build.db(slowest tasks in the latest build iteration), detects.xcbuilddatabloat with actionable recommendations, and prunes stale.xcbuilddatabundles automatically during daily housekeeping /xclane slots prune.Stall watchdog: Detects silent/flat-CPU wedged builds across descendant process trees and terminates them cleanly with
build_stalled(exit code 116; defaultstallTimeoutSeconds: 300,0disables).Native stdio MCP server & multi-client plugins:
xclane mcpexposesxclane_build,xclane_test(withshards,affected,affectedBase,fastAgent,indexStore,noSharedSDKCaches),xclane_run(each supportingbackground: truefor long builds),xclane_job(inspect/wait/cancel background jobs),xclane_status,xclane_slots(list,remove,prune,warm),xclane_sim(list,prune,slim), andxclane_doctor(withcheckEnv,profile).

Related MCP server: XCAutokit
Benchmarks (Xcode 27.2 / Apple M1 Pro)
Measured on mastodon/mastodon-ios (f3dc8d3, 1,351 compiled Swift files, MastodonSDK + remote SwiftPM packages) as well as two reproducible fixture suites: WorkApp (55-file multi-package .xcworkspace with 4 chained local SwiftPM packages, 1 remote dependency, and WorkSmoke.xctestplan) and BenchApp (63-file SwiftUI .xcodeproj + unit test target). See docs/benchmarks.md for full methodology and storage breakdown.

Workload | Result | Highlight |
| 113.21s Cold S1 / 69.78s Cold S2 / 13.95s 1-file edit | vs 211.37s S1 / 232.96s S2 / 21.53s |
| 87.91s Cold S1 / 67.72s Cold S2 | 2.40x–3.44x faster cold, |
| 6.08s leaf change / 0.07s docs-only (vs 12.83s full warm) | Scopes via |
History-weighted | 16.99s Run 2 (shard workers | EMA timings fix Run 1 imbalance ( |
| 22.30s first-boot test vs 34.88s stock clone | 1.56x faster ( |
| 14.71s / 8.43s (vs 120.11s plain cold) |
|
| 58.37s vs 110.17s no-CAS (120.11s plain cold) |
|
| 25.02s wall clock | Distinct slots |
| 3.94s (vs 13.63s plain cold) |
|
| 18.61s vs 28.88s ( | Shard execution |
| 3.99s (vs 13.08s cold Slot 3) | Pre-warmed Slot 2 at utility QoS; |
Install
Requirements: macOS 15+, Xcode, and a git repository (building from source also requires Swift 6 / swift-tools-version: 6.0).
Homebrew (recommended)
brew install stefanoshea/tap/xclane
xclane plugin install --client allQuick install script (prebuilt Apple Silicon binary)
curl -fsSL https://raw.githubusercontent.com/stefanoshea/xclane/main/scripts/install.sh | sh
xclane plugin install --client allOr run both in one command: curl -fsSL https://raw.githubusercontent.com/stefanoshea/xclane/main/scripts/install.sh | sh -s -- --client all (make sure ~/.local/bin is on your PATH).
Build from source
git clone https://github.com/stefanoshea/xclane.git
cd xclane
swift build -c release
.build/release/xclane plugin install --client allClient integrations
--client accepts antigravity (default), claude, codex, or all. The binary embeds the plugin bundle so xclane plugin install works standalone without a local checkout. For source/script installs, it installs ~/.local/bin/xclane (Homebrew installs keep /opt/homebrew/bin/xclane authoritative), registers the MCP server/skills/rules, and installs PreToolUse/PostToolUse hooks (which intercept raw xcodebuild commands to route through xclane and automatically acquire/release xclane gui-lock around native Xcode MCP build/test calls):
Antigravity:
~/.gemini/config/plugins/xclane(MCP server, skill, rules, lifecycle hooks)Claude Code:
~/.claude.json(mcpServers.xclane),~/.claude/skills/xclane/SKILL.md, and~/.claude/settings.json(PreToolUse/PostToolUsehooks)OpenAI Codex:
~/.codex/config.toml([mcp_servers.xclane]),~/.codex/skills/xclane/SKILL.md, and~/.codex/hooks.json
Or register the MCP server manually (for Antigravity, use xclane plugin install --client antigravity):
claude mcp add -s user xclane -- xclane mcp
codex mcp add xclane -- xclane mcpTo remove installed client integrations cleanly (without touching other MCP servers or hooks), run xclane plugin uninstall --client all (pass --remove-binary if installed via script/source; Homebrew users run brew uninstall xclane).
Quick Start
xclane flags (--no-yield, --cache, --no-cache, --no-wait, --products-to <dir>, --summary, --json, etc.) go before xcodebuild arguments (xclane xcodebuild [xclane-opts] <xcodebuild-args...>):
# Build in a warm slot (auto-reuses shared SwiftPM cache + APFS SourcePackages snapshot)
xclane xcodebuild -workspace App.xcworkspace -scheme App -destination 'generic/platform=iOS Simulator' build
# Run tests on an automatically cloned & locked simulator
xclane xcodebuild -workspace App.xcworkspace -scheme App -testPlan UnitSmoke -destination 'platform=iOS Simulator,name=iPhone 18 Pro' test
# Run fast agent verification (skips dSYMs/debug dylibs/validation)
xclane xcodebuild --fast-agent -workspace App.xcworkspace -scheme App -destination 'generic/platform=iOS Simulator' build
# Run only test targets impacted by uncommitted / branch changes (via PIFCache)
xclane xcodebuild --affected -workspace App.xcworkspace -scheme App -destination 'platform=iOS Simulator,name=iPhone 18 Pro' test
# Slim managed simulator clones (disables 65 background daemons while keeping com.apple.gamed)
xclane sim slim --all
# Build once (build-for-testing) and fan tests across 3 isolated simulator clones in parallel
xclane xcodebuild --shards 3 -workspace App.xcworkspace -scheme App -destination 'platform=iOS Simulator,name=iPhone 18 Pro' test
# Pre-warm Slot 2 in the background while idle using low-priority utility QoS
xclane slots warm --if-idle --background
# Run an arbitrary command inside a synced warm slot (with write-back)
xclane run -- swift test
# Inspect permits, GUI status, slots, simulators, and physical APFS disk usage
xclane status --sizes --json
# Check toolchain, git repo, build.db profile + .xcbuilddata bloat, and sanitized env stability
xclane doctor --env --profileBuild Performance Tips
Zero-config
v0.5.0optimizations (automatic onbuild/test/build-for-testing): By default,xclaneinjectsCOMPILER_INDEX_STORE_ENABLE=NO, shares Apple SDKMODULE_CACHE_DIR/SDK_STAT_CACHE_DIR/SDK_EXPLICIT_MODULES_OUTPUT_PATHacross all slots/repos under<root>/shared-sdk, and narrowsgeneric/platform=*Simulatorbuilds on Apple Silicon toONLY_ACTIVE_ARCH=YES ARCHS=arm64. All optimizations are skipped automatically onarchive,install,exportArchive,clean, andanalyze. Override any setting individually with--index-store,--no-shared-sdk-caches, or explicitONLY_ACTIVE_ARCH=NO/ARCHS=.../-arch ....--fast-agentmode: AddsGCC_GENERATE_DEBUGGING_SYMBOLS=NO,ENABLE_DEBUG_DYLIB=NO,VALIDATE_PRODUCT=NO, andDONT_RUN_SWIFT_STDLIB_TOOL=YES, cutting Cold Slot 1 onmastodon-iosto 87.91s (2.40x faster than baseline) while preserving XCTest and Swift Testingfile:linefailure diagnostics.Opt-in shared LLVM compilation cache (
--cache/"enableCompilationCache": true): Off by default (false) because LLVM CAS adds ~14s on Slot 1 cold, ~1.8s on small incremental edits, and ~2.5 GB of disk onmastodon-ios; pass--cache(or set"enableCompilationCache": truein config) when running multi-slot builds across parallel agents (SWIFT_OTHER_PREFIX_MAPPINGS/CLANG_OTHER_PREFIX_MAPPINGSmap<slotDir>=/^slot, delivering 93–100% cross-slot CAS task hits and cutting Cold Slot 2 in half). Passing--no-cacheinjectsCOMPILATION_CACHE_ENABLE_CACHING=NOand omitsCOMPILATION_CACHE_CAS_PATH, disabling compile caching even when enabled in.pbxprojbuild settings (and updating the build flavor hash so switching cache modes on the same scheme reportsflavorSwitched: true).Stick to one cache mode per repo (and use
--slot <n>when pinning): Default mode and--cacheproduce distinct build flavors. Switching modes in the same slot triggers a full rebuild and keeps outputs for both modes inside that slot'sDerivedData(roughly doubling per-slot disk usage). Pick one mode per repository — either keep the default or set"enableCompilationCache": true/ always pass--cache— and pass--slot <n>if you explicitly want to pin a build to a separate slot.Shared compilation cache cap: When CAS is enabled,
xclanepassesCOMPILATION_CACHE_LIMIT_SIZE=10G(compilationCacheLimitMB), which Xcode enforces across builds. Duringxclane slots pruneand daily housekeeping (when no slot in the repo is held),xclanerunsllvm-cas --prunewhenever the cache exceeds1×compilationCacheLimitMB, and only resets the CAS as a safety valve if it still exceeds2×compilationCacheLimitMBafter pruning (reportingcacheReset: trueinBuildSummaryand printing the action in status output). OnSIGINT/SIGTERM,xclaneforwards the signal toxcodebuildand waits up to 5s before escalating so active compilers can finish their CAS writes.
Configuration
User config lookup order: $XCLANE_CONFIG -> $XDG_CONFIG_HOME/xclane/config.json -> ~/.config/xclane/config.json. Override the slots root directory with $XCLANE_HOME or root. Defaults:
{
"slots": 3,
"maxConcurrent": 3,
"waitSeconds": 3600,
"warmSlotWaitSeconds": 60,
"stallTimeoutSeconds": 300,
"enableCompilationCache": false,
"compilationCacheLimitMB": 10240,
"disableIndexStore": true,
"shareSDKCaches": true,
"singleArchSimulator": true,
"fastAgentMode": false,
"slotIdleDays": 30,
"yieldToXcodeGUI": true,
"simPool": {
"autoLease": true,
"maxClones": 3,
"idleDays": 7,
"slimClones": false
}
}slots:3active slots per repomaxConcurrent:3concurrent builds machine-widewarmSlotWaitSeconds:60max seconds to wait for a busy warm matching slot (scaled to its lastcommandSeconds) before falling back to a cold/other-flavor slot (0disables waiting)stallTimeoutSeconds:300idle seconds beforebuild_stalled(0disables)enableCompilationCache:false(settrueor pass--cachefor opt-in shared LLVM CAS)compilationCacheLimitMB:10240(10GviaCOMPILATION_CACHE_LIMIT_SIZE)disableIndexStore:true(injectsCOMPILER_INDEX_STORE_ENABLE=NO; override with--index-store)shareSDKCaches:true(sharesMODULE_CACHE_DIR,SDK_STAT_CACHE_DIR, andSDK_EXPLICIT_MODULES_OUTPUT_PATHunder<root>/shared-sdk)singleArchSimulator:true(usesONLY_ACTIVE_ARCH=YES ARCHS=arm64on Apple Silicongeneric/platform=*Simulatorbuilds)fastAgentMode:false(settrueor pass--fast-agentto skip dSYMs/debug dylibs/validation/stdlib copy)slotIdleDays:30days before dormant slots are prunedsimPool:autoLeaseleases clones on test runs;maxClones: 3caps clones per(device, runtime)baseline;idleDays: 7;slimClones: false(trueauto-slims newly created clones)yieldToXcodeGUI:true(yields to bothXcode.appand headlessXcode Service.app)
Per-Repo .xclane.json
Optional .xclane.json at the repository root customizes gitignored file mirroring, cached prepare generators (pod install, xcodegen, tuist), and default simulator targets. Even without .xclane.json, sync.includeIgnored defaults to ["*.xcconfig"] and Tuist.swift / Tuist/ projects are auto-detected for prepare. prepare commands run inside the slot worktree (skipping when hashed file/directory inputs are unchanged and declared outputs exist, preserving unchanged output mtimes; newly generated or modified files follow normal write-back), and sim provides defaults when -destination omits device/OS:
{
"sync": {
"includeIgnored": ["*.xcconfig", "App/Secrets.plist"]
},
"prepare": [
{
"name": "xcodegen",
"run": ["xcodegen", "generate"],
"inputs": ["project.yml", "Specs"],
"outputs": ["App.xcodeproj"]
}
],
"sim": {
"deviceName": "iPhone 18 Pro",
"osVersion": "27"
}
}Locked Slot Worktrees & Cleanup
Each xclane slot registers a locked detached git worktree under ~/Library/Developer/xclane/<repo>-<hash>/slots/<n>/src so git worktree prune will not erase warm build caches.
Inspect slots and physical APFS disk usage:
xclane status --sizesCleanly remove slots (unlocks the git worktree first, deletes the slot atomically, and runs
git worktree prune):xclane slots remove --all --yesPrune orphan repos, dormant slots, stale
.dSYMs, old logs, oversized CAS, and idle simulators on demand:xclane slots pruneIf you ever delete
~/Library/Developer/xclanemanually by hand, clean up any remaining locked worktree entries in your repo with:git worktree list git worktree unlock <missing-slot-path> && git worktree prune
Testing, Evals & Benchmarks
Build .build/release/xclane (swift build -c release) before running the Python eval or benchmark scripts:
swift test # Unit & integration tests
python3 scripts/run-evals.py --bin .build/release/xclane # Fast sandboxed CLI, MCP, hook & security evals
python3 scripts/run-live-xcode-evals.py --bin .build/release/xclane # Real Xcode + simulator integration evals
python3 scripts/run-benchmarks.py --bin .build/release/xclane # Reproduces the benchmark tableLearnings
See docs/LEARNINGS.md for verified findings and fixes from dogfooding xclane on macOS 27 / Xcode 27 / Antigravity.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Build, run, and inspect iOS apps in disposable hosted Simulators from cloud coding agents.
The cloud Mac alone, with Xcode, for AI agents: run commands, build and test, use the screen.
Cloud iPhone Simulators for AI agents: build the Xcode project, read the screen, tap by label, test.
Build, test and cache insights for Xcode, Gradle and Bazel projects, for coding agents.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides programmatic access to Xcode functionality, enabling AI assistants to create, build, test, and manage iOS/macOS projects directly.336MIT
- AlicenseNot gradedqualityCmaintenanceFirst-party MCP server and CLI for Xcode and iOS Simulator automation. Enables control of Xcode and iOS Simulator via MCP tools for tasks like building, testing, and automation.9 npm1MIT
- AlicenseNot gradedqualityBmaintenanceConnects AI coding clients like OpenCode, Codex, and Claude Code to Xcode and Apple development tools, enabling builds, tests, simulator and device management, profiling, asset handling, and more through natural language.78 npm1MIT
- AlicenseNot gradedqualityBmaintenanceEnables multiple AI agent sessions to share a single Mac's Apple Simulator pool through one shared daemon that tracks leases and auto-dispatches freed simulators to the next waiting caller. It provides simulator UI automation, app lifecycle, profiling, live streaming, crash debugging, and HTTPS interception tools, all gated to the lease holder.21 npmMIT