xcforge
MCP server and CLI for iOS development — build, test, automate, and diagnose from any AI agent or terminal.
README
xcforge
<p align="center"><img src="xcforge.png" alt="xcforge" width="100%"></p>
An MCP server and CLI for iOS development — build, test, automate, and diagnose from any AI agent or terminal.
103 MCP tools. 17 CLI command groups. Single native binary (~8 MB stripped, ~18 MB with debug symbols). Zero external runtime dependencies.
Install
Homebrew (recommended)
brew tap justinthevoid/tap && brew install xcforge
Claude Code (one-liner)
claude mcp add xcforge -- xcforge
This registers xcforge as an MCP server in your current project. Run it after installing via Homebrew.
From source
git clone https://github.com/justinthevoid/xcforge.git
cd xcforge && swift build -c release
cp .build/release/XCForgeCLI /usr/local/bin/xcforge
Uninstall
Homebrew
brew uninstall xcforge
brew untap justinthevoid/tap # optional: remove the tap
From source
rm /usr/local/bin/xcforge
Remove MCP configuration
After uninstalling the binary, remove the "xcforge" entry from your MCP client config file (see Configure for file locations).
For Claude Code:
claude mcp remove xcforge
Configure
Add xcforge to your MCP client. Each client has a different config format and file location.
Claude Code
The fastest way is the CLI command shown above under Install. To configure manually, add to .mcp.json in your project root (or ~/.claude/.mcp.json for global):
{
"mcpServers": {
"xcforge": {
"command": "xcforge",
"args": [],
"type": "stdio"
}
}
}
Claude Desktop
File: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"xcforge": {
"command": "/opt/homebrew/bin/xcforge",
"args": []
}
}
}
Note: Claude Desktop does not inherit your shell PATH. Use the full Homebrew path —
/opt/homebrew/bin/xcforgeon Apple Silicon,/usr/local/bin/xcforgeon Intel.
Cursor
File: .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global)
{
"mcpServers": {
"xcforge": {
"command": "/opt/homebrew/bin/xcforge",
"args": []
}
}
}
Note: Same PATH caveat as Claude Desktop — use the absolute path. Restart Cursor after changes.
VS Code (GitHub Copilot)
File: .vscode/mcp.json in your project root
{
"servers": {
"xcforge": {
"command": "xcforge",
"args": [],
"type": "stdio"
}
}
}
Note: VS Code uses
"servers"not"mcpServers". Requires the GitHub Copilot extension with agent mode enabled. VS Code typically resolves PATH from your shell, so the bare command works.
Windsurf
File: ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"xcforge": {
"command": "/opt/homebrew/bin/xcforge",
"args": []
}
}
}
Note: Full path recommended. Restart Windsurf after editing.
Zed
File: ~/.config/zed/settings.json (or .zed/settings.json per-project)
{
"context_servers": {
"xcforge": {
"command": {
"path": "/opt/homebrew/bin/xcforge",
"args": []
},
"settings": {}
}
}
}
Note: Zed uses
"context_servers"with a nested"command.path"— different from every other client.
Config quick reference
| Client | Config key | File location | Needs absolute path? |
|---|---|---|---|
| Claude Code | mcpServers |
.mcp.json |
No |
| Claude Desktop | mcpServers |
~/Library/Application Support/Claude/claude_desktop_config.json |
Yes |
| Cursor | mcpServers |
.cursor/mcp.json |
Yes |
| VS Code | servers |
.vscode/mcp.json |
No |
| Windsurf | mcpServers |
~/.codeium/windsurf/mcp_config.json |
Yes |
| Zed | context_servers |
~/.config/zed/settings.json |
Yes |
Claude Code Skill
xcforge includes a Claude Code skill that loads the full tool reference into context when you're working on iOS tasks. Install it globally with:
npx skills justinthevoid/xcforge
Once installed, Claude will automatically load the right reference files when you use xcforge tools — exact parameters, return values, and usage patterns for each category (build, test, simulator, UI automation, logs, LLDB, diagnosis, and more).
Two Modes, Same Tools
xcforge # MCP server (stdio JSON-RPC, 95 tools)
xcforge build --scheme MyApp # CLI mode (16 command groups)
Every tool available over MCP has a matching CLI command. Every CLI command supports --json.
Tools Overview
| Category | Count | Highlights |
|---|---|---|
| Build | 5 | build_sim, build_run_sim (build + boot + install + launch), clean, project/scheme discovery |
| Test | 6 | test_sim with xcresult parsing, test_failures with screenshots, test_coverage, list_tests |
| Simulator | 17 | Full lifecycle + video recording, location simulation, dark mode toggle, status bar override |
| Physical Devices | 7 | Via devicectl — list, install, launch, screenshot, pair |
| UI Automation | 19 | WebDriverAgent + native AX bridge — find, tap, swipe, drag, type, alerts, hierarchy |
| Screenshots | 2 | Framebuffer capture (0.3s), point-space coordinate alignment |
| Visual Regression | 2 | Pixel-diff baselines, multi-device checks (Dark Mode, Landscape, iPad) |
| Logs | 4 | 4-layer filtered capture, 8 topic categories, regex wait |
| Console | 3 | stdout/stderr capture for launched apps |
| SPM | 5 | Resolve, update, show deps, reset, clean |
| Accessibility | 5 | Audit labels, traits, VoiceOver order, contrast |
| Git | 5 | Status, diff, log, commit, branch |
| LLDB Debugger | 8 | Attach, breakpoints, inspect variables, backtrace, step/continue, arbitrary commands |
| Diagnosis | 10 | Multi-step workflows: build, run, inspect, capture evidence, compare, verify |
| Plan Execution | 2 | Scripted multi-step automation with assertions |
| Session | 3 | Persistent defaults, .xcforge.yaml repo config, session profiles |
Key Capabilities
Structured Test Results
Test output is parsed from .xcresult bundles — the structured format Xcode generates internally — not from raw xcodebuild stdout/stderr.
A single test_sim call returns: pass/fail counts, failure messages with source location, exported failure screenshots, and the xcresult path for deeper inspection via test_failures or test_coverage.
Fast Screenshots
The screenshot tool reads the simulator framebuffer via CoreSimulator's IOSurface API, falling back to ScreenCaptureKit, then simctl. Typical latency is ~300ms.
UI Automation Without Appium
xcforge communicates directly with WebDriverAgent over HTTP and supplements it with a native Accessibility API bridge (AXPBridge). This means:
find_elementwithscroll: trueauto-scrolls using 3 fallback strategieshandle_alertsearches across SpringBoard, ContactsUI, and the active app —accept_allclears multiple permission dialogs in one calldrag_and_dropworks with element IDs, not just coordinatesget_sourcereturns the full view hierarchy in ~20ms
Topic-Filtered Logs
start_log_capture streams os_log through 4 filter layers:
- Noise exclusion — strips 15 known noisy processes at the stream level
- Capture modes —
smart(broad + topic-ready),app(tight, auto-detected bundle),verbose - Topic filtering —
read_logsclassifies lines into 8 topics (app, crashes, network, lifecycle, springboard, widgets, background, system) and shows only app + crashes by default - Deduplication — collapses repeated lines
The response includes a topic menu with counts, so the agent can pull in specific topics on demand without re-querying.
Interactive LLDB Debugger
8 tools for attaching LLDB to running simulator processes, setting breakpoints, inspecting variables, viewing stack traces, and stepping through code. Sessions persist for 30 minutes, so you can attach once and run multiple debugging operations. CLI commands are one-shot (attach → operation → detach). Includes:
- Session management:
lldb_attach(by bundle ID or PID),lldb_detach - Breakpoints: set by file+line or function name, remove by ID
- Inspection: evaluate expressions at the current frame, view stack traces
- Execution control: continue, step over, step into, step out (with 10-second timeout)
- Raw passthrough: run arbitrary LLDB commands
Use alongside logs and screenshots for systematic root-cause analysis.
Diagnosis Workflows
10 tools that chain together into structured diagnostic pipelines — start a session, build, launch, capture runtime signals, collect evidence (screenshots, logs, accessibility state), compare against previous runs, and verify fixes. Designed for agents to systematically debug issues across multiple iterations.
Physical Device Support
7 tools wrapping Apple's devicectl for real devices — list connected devices, install/launch/terminate apps, take screenshots, and manage pairing.
CLI Examples
xcforge build # Build (auto-detects project, scheme, sim)
xcforge build --scheme MyApp --simulator "iPhone 16 Pro"
xcforge test --scheme MyApp --json # Run tests, JSON output
xcforge test failures --xcresult /path/to.xcresult
xcforge test coverage --min-coverage 80
xcforge sim list # List simulators
xcforge sim boot "iPhone 16 Pro"
xcforge ui find --aid "loginButton" # Find by accessibility ID
xcforge ui tap --element el-0 # Tap element
xcforge screenshot # Screenshot to stdout
xcforge log start # Start log capture
xcforge log read --include network # Read with topic filter
xcforge spm resolve # Resolve packages
xcforge device list # Connected physical devices
xcforge debug attach --bundle-id com.example.App # Attach debugger
xcforge debug breakpoint set --bundle-id com.example.App --file ViewController.swift --line 42
xcforge debug inspect --bundle-id com.example.App --expression "self.count"
xcforge debug backtrace --bundle-id com.example.App # Show stack trace
xcforge debug continue --bundle-id com.example.App --mode step-over
xcforge diagnose start --scheme MyApp # Start diagnosis session
Alternatives
There are several iOS-focused MCP servers worth knowing about:
| Server | Stars | Scope | Build | Test | UI Automation | Screenshots | Visual Regression | Accessibility | Physical Devices | SPM | Git | Logs |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| xcforge | — | 95 tools | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
| XcodeBuildMCP | ~5k | ~15 tools | Yes | Yes | Partial | No | No | No | No | No | No | No |
| ios-simulator-mcp | ~1.8k | ~10 tools | No | No | Yes | Yes | No | No | No | No | No | No |
| xcode-mcp-server | ~370 | ~8 tools | Partial | No | No | No | No | No | No | No | No | No |
| iosef | <10 | ~5 tools | No | No | Yes | No | No | No | No | No | No | No |
| Appium MCP | <50 | ~10 tools | No | No | Yes | Yes | No | No | Partial | No | No | No |
- XcodeBuildMCP — The most popular iOS MCP server. Backed by Sentry. Covers build, test, and simulator management well. If you only need build/run workflows, it's a solid choice.
- ios-simulator-mcp — Focused on simulator UI interaction — screenshots, taps, swipes, accessibility tree. Good if you only need simulator automation.
- xcode-mcp-server — Early MCP server for Xcode project management. Basic integration — no simulator automation, testing, or device support.
- iosef — Agent-optimized simulator CLI with clean ergonomics. Narrow scope but thoughtful design. Swift native.
- Appium MCP — Cross-platform (iOS + Android) via the Appium ecosystem. Requires Node.js + Java + Appium server — heavier dependency chain.
Where xcforge fits: It combines build, test, UI automation, log analysis, visual regression, device support, SPM, accessibility auditing, and multi-step diagnosis in a single zero-dependency binary. The trade-off is iOS-only — no Android, watchOS, or visionOS.
Requirements
- macOS 13+
- Xcode 15+
- Swift 6.0+ (source builds only)
- WebDriverAgent on simulator (UI automation only)
Support
If xcforge saves you time, consider supporting development:
License
MIT — see LICENSE.
Contributing
Issues and PRs welcome. See CONTRIBUTING.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。