XC-MCP is an intelligent Xcode CLI wrapper that optimizes developer workflows through progressive disclosure, smart caching, and AI-driven learning to address MCP client token limits.
Core Capabilities:
Xcode Project Management: Execute builds with smart defaults, list targets/schemes/configurations, show SDKs, get version info, and clean artifacts with cached logs and learning systems
Simulator Control: Manage iOS simulators with concise summaries, progressive disclosure for full details, boot/shutdown operations with performance tracking, and smart recommendations
Intelligent Caching System: Multi-layer caching with configurable timeouts, comprehensive statistics, cache clearing, and cached response listing
Data Persistence: File-based state persistence across server restarts for cache data and learned patterns
AI-Driven Optimization: Learning from usage patterns, performance metrics tracking (build/boot times), and adaptive intelligence for improved recommendations and workflow efficiency
Provides intelligent Xcode CLI tooling with progressive disclosure, enabling build operations, simulator management, project discovery, and cache management while solving token overflow issues through smart caching and concise summaries
XC-MCP: Intelligent Xcode MCP Server
Production-grade MCP server for Xcode workflows — optimized for AI agents with accessibility-first iOS automation
XC-MCP makes Xcode and iOS simulator tooling accessible to AI agents through intelligent context engineering. V3.0.0 adds platform-native — Claude's tool search automatically discovers tools on-demand, minimizing baseline context overhead while maintaining full 29-tool functionality.
Why XC-MCP?
The Problem: Token Overflow Breaks MCP Clients
Traditional Xcode CLI wrappers dump massive output that exceeds MCP protocol limits:
simctl list: 57,000+ tokens (unusable in MCP context)Build logs: 135,000+ tokens (catastrophic overflow)
Screenshot-first automation: 170 tokens per screen, 2000ms latency
No state memory between operations
The Solution: Progressive Disclosure + Accessibility-First
V3.0.0 Architecture:
Token Efficiency Evolution:
Version | Baseline Tokens | Total Tools | Architecture | Context Available |
Pre-RTFM (v1.2.1) | ~45k | 51 | Individual tools | 3.9% (155k) |
V1.3.2 (RTFM) | ~30k | 51 | Individual + RTFM | 1.5% (170k) |
V2.0.0 | ~18.7k | 28 | Routers + Full Docs | 9.3% (181k) |
V3.0.0 | ~0 | 29 | Platform defer_loading | 100% (200k) |
Key Improvements (V3.0.0):
✅ Platform-native defer_loading - All tools deferred; Claude discovers on-demand
✅ Workflow tools - High-level abstractions for common operations
✅ Zero baseline overhead - Platform handles tool discovery
✅ Accessibility-first automation (3-4x faster, 3-4x cheaper than screenshots)
✅ Progressive disclosure (summaries → cache IDs → full details on demand)
✅ 60% test coverage with comprehensive error handling
Related MCP server: iOS simulators MCP
Quick Start
MCP Configuration (Claude Desktop):
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Minimal Mode (for Claude Code and other clients that don't support defer_loading):
The --mini flag reduces tool descriptions from ~18.7k tokens to ~540 tokens (~97% reduction). Use rtfm for full documentation on-demand.
Build-Only Mode (for build-focused workflows without UI automation):
The --build-only flag loads only 11 tools (vs 30): xcodebuild tools, simctl-list, cache, and system tools. Excludes IDB/UI automation and workflow tools. Combine with --mini for maximum reduction: ["--mini", "--build-only"].
Token Optimization Architecture
Progressive Disclosure Pattern
XC-MCP returns concise summaries first, with cache IDs for on-demand detail retrieval:
Example: Simulator List (96% token reduction)
Example: Build Operations
RTFM On-Demand Documentation
Discovery Workflow:
Why RTFM?
Tool descriptions: <10 words + "See rtfm for details"
Full docs retrieved only when needed
80% token savings vs traditional verbose MCP servers
Operation Enum Consolidation
Before V2.0: 21 individual tools
V2.0: 6 consolidated routers
Result: 40% token reduction through shared parameter schemas and unified documentation.
Accessibility-First iOS Automation
Our Philosophy
XC-MCP promotes accessibility-first automation because it:
Encourages better apps: Developers building accessible UIs benefit all users (screen readers, voice control, assistive technologies)
Enables precise AI interaction: Semantic element discovery via accessibility tree vs visual guesswork from screenshots
Improves efficiency: 3-4x faster execution, 3-4x cheaper token cost
Reduces energy usage: Skip computationally expensive image processing entirely
Objective Performance Data
Approach | Tokens | Latency | Use Case |
Accessibility Tree | ~50 | ~120ms | Rich UIs with >3 tappable elements |
Screenshot Analysis | ~170 | ~2000ms | Minimal UIs with ≤1 tappable element |
Efficiency Gain | 3.4x cheaper | 16x faster | When accessibility sufficient |
Accessibility-First Workflow
Why This Matters:
For Users: Encourages inclusive app development benefiting everyone
For AI Agents: Precise semantic targeting vs visual pattern matching
For Efficiency: 50 tokens (accessibility) vs 170 tokens (screenshot)
For Speed: 120ms (accessibility) vs 2000ms (screenshot)
For Energy: Skip image encoding/decoding/analysis entirely
Accessibility Tools (3 specialized)
accessibility-quality-check: Rapid assessment without full tree query
Returns:
rich(>3 tappable) |moderate(2-3) |minimal(≤1)Use case: Decision point before screenshot vs accessibility
Cost: ~30 tokens, ~80ms
idb-ui-find-element: Semantic element search by label/identifier
Returns: Tap-ready coordinates (centerX, centerY) with frame boundaries
Use case: Find specific button, field, or cell without visual analysis
Cost: ~40 tokens, ~120ms
idb-ui-describe: Full accessibility tree with progressive disclosure
Operation
all: Summary + uiTreeId for full tree retrievalOperation
point: Element details at specific coordinatesUse case: Discover all interactive elements, validate tap coordinates
Cost: ~50 tokens for summary, ~500 tokens for full tree
Platform defer_loading (V3.0.0 Feature)
How It Works
XC-MCP V3.0 adds the defer_loading: true flag to all 29 tool registrations. Claude's platform-native tool search automatically:
Discovers tools on-demand — No custom tool-search implementation needed
Loads tools when relevant — Based on conversation context
Minimizes baseline overhead — Zero tokens at startup
RTFM: On-Demand Documentation
Use rtfm to get comprehensive documentation for any tool:
Environment Variable: Disable defer_loading
Default (V3.0.0): All tools have defer_loading enabled
Disable defer_loading (for debugging/testing):
Workflow Tools (New in V3.0.0)
XC-MCP provides 2 high-level workflow tools that combine common operations into single steps:
workflow-tap-element — High-Level Semantic Tap
Combines accessibility quality check + element search + tap into one operation:
Cost: ~90 tokens (vs 130 tokens separately) Latency: ~300ms (vs ~400ms separately) Use case: User login, form submission, navigation flows
workflow-fresh-install — Clean Install Workflow
Performs complete app refresh: shutdown → (erase) → boot → build → install → launch
Cost: ~200 tokens (vs 300+ tokens separately) Latency: ~20s (vs 25+ seconds separately) Use case: CI/CD pipelines, clean state testing, fresh debugging sessions
Tool Reference
6 Consolidated Router Tools
simctl-device — Simulator lifecycle (7 operations)
boot,shutdown,create,delete,erase,clone,renameAuto-UDID detection, performance tracking, smart defaults
simctl-app — App management (4 operations)
install,uninstall,launch,terminateBundle ID resolution, launch arguments, environment variables
idb-app — IDB app operations (4 operations)
install,uninstall,launch,terminatePhysical device + simulator support via IDB
cache — Cache management (4 operations)
get-stats,get-config,set-config,clearMulti-layer caching (simulator, project, response, build settings)
persistence — Persistence control (3 operations)
enable,disable,statusFile-based cache across server restarts
idb-targets — Target management (2 operations)
list,describe,connect,disconnectPhysical device and simulator discovery
22 Individual Specialized Tools
Build & Test (6 tools)
xcodebuild-build: Build with progressive disclosure via buildIdxcodebuild-test: Test with filtering, test plans, cache IDsxcodebuild-clean: Clean build artifactsxcodebuild-list: List targets/schemes with smart cachingxcodebuild-version: Get Xcode and SDK versionsxcodebuild-get-details: Access cached build/test logs
UI Automation (6 tools)
idb-ui-describe: Accessibility tree queries (all | point operations)idb-ui-tap: Coordinate-based tapping with percentage conversionidb-ui-input: Text input with keyboard controlidb-ui-gesture: Swipes, pinches, rotations with coordinate transformsidb-ui-find-element: Semantic element search (NEW in v2.0)accessibility-quality-check: Rapid UI richness assessment (NEW in v2.0)
I/O & Media (2 tools)
simctl-io: Screenshots and video recording with semantic namingscreenshot: Vision-optimized base64 screenshots (inline, max 800px)
Discovery & Health (3 tools)
simctl-list: Progressive disclosure simulator listing (96% token reduction)simctl-get-details: On-demand full simulator data retrievalsimctl-health-check: Xcode environment validation
Utilities (5 tools)
simctl-openurl: Open URLs and deep linkssimctl-get-app-container: Get app container paths (bundle, data, group)simctl-push: Simulate push notificationsrtfm: On-demand comprehensive documentation
Workflow Tools (2 high-level abstractions) - NEW in V3.0.0
workflow-tap-element: High-level semantic tap (find + tap in one call)workflow-fresh-install: Clean install workflow (shutdown → erase → boot → build → install → launch)
Total: 29 active tools (27 core + 2 workflow abstractions)
Usage Examples
Example 1: Accessibility-First Login Automation
Efficiency Comparison:
Accessibility approach: 4 queries × 50 tokens = 200 tokens, ~500ms total
Screenshot approach: 3 screenshots × 170 tokens = 510 tokens, ~6000ms total
Savings: 2.5x cheaper, 12x faster
Example 2: RTFM Discovery Workflow
Example 3: Progressive Disclosure Build Workflow
CLAUDE.md Template for End Users
Copy this into your project's CLAUDE.md to guide AI agents toward optimal XC-MCP usage:
Installation & Configuration
Prerequisites
macOS with Xcode command-line tools
Node.js 18+
Xcode 15+ recommended
Install Xcode CLI tools:
Installation Options
MCP Client Configuration
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
Environment Variables (optional):
XCODE_CLI_MCP_TIMEOUT: Operation timeout in seconds (default: 300)XCODE_CLI_MCP_LOG_LEVEL: Logging verbosity (debug | info | warn | error)XCODE_CLI_MCP_CACHE_DIR: Custom cache directory pathXC_MCP_DEFER_LOADING: Enable deferred tool loading (default: true for V3.0)
Breaking Changes & Migration Guide
V3.0.0: Platform defer_loading Support
What Changed:
All 29 tools now have
defer_loading: trueflagClaude's platform tool search discovers tools automatically
No custom tool-search implementation needed
Tools loaded on-demand based on conversation context
Migration Path:
Scenario | Action | Notes |
New Projects | No action needed | Platform handles discovery |
Existing Integrations | No action needed | Compatible with V2.x usage |
Debugging/Testing | Set env var | Use
|
Usage (same as V2.x):
Token Impact:
Version | Startup | Discovery | Notes |
V2.0.x | ~18.7k | N/A | All tools loaded upfront |
V3.0.0 | ~0 | Platform-managed | Tools loaded on-demand |
Development
Build Commands
Testing
Jest with ESM support and TypeScript compilation
60% coverage across statements, branches, functions, lines
1136 tests covering core functionality, edge cases, error handling
Pre-commit hooks enforce code quality via Husky + lint-staged
Architecture
Core Components:
src/index.ts— MCP server with tool registration and routingsrc/tools/— 29 tools organized by category (xcodebuild, simctl, idb, cache, workflows)src/state/— Multi-layer intelligent caching (simulator, project, response, build settings)src/utils/— Shared utilities (command execution, validation, error formatting)src/types/— TypeScript definitions for Xcode data structures
Cache Architecture:
Simulator Cache: 1-hour retention, usage tracking, performance metrics
Project Cache: Remembers successful build configurations per project
Build Settings Cache: Auto-discovers bundle IDs, deployment targets, capabilities
Response Cache: 30-minute retention for progressive disclosure
Contributing
Contributions welcome! Please ensure:
Tests pass (
npm test)Coverage remains ≥60% (
npm run test:coverage)Code passes linting (
npm run lint)TypeScript compiles (
npm run build)
See CLAUDE.md for detailed development guidelines and architecture documentation.
License
MIT License — See LICENSE for details.
XC-MCP: Production-grade Xcode automation for AI agents through progressive disclosure and accessibility-first workflows.