Xclaude插件
/plugin marketplace add conorluddy/xclaude-pluginClaude Code的模块化iOS开发自动化
通过与Claude的自然对话,构建、测试和自动化iOS应用程序。8个特定于工作流的MCP服务器,配备24个跨Xcode、Simulator和IDB的工具。
只启用你需要的东西。 每个MCP都是为特定的工作流程专门构建的,使您的上下文窗口保持简洁。此外,我们的工具智能地封装了Xcode输出(错误、测试结果、构建日志),因此Claude处理结构化JSON而不是原始的50多行日志——节省了大量令牌并实现了更快的反馈循环。
特性
🎯 模块化架构
- 8个特定于工作流的MCP服务器 (每个600-3500个代币)
- 只启用您需要的功能 -超简约到功能齐全
- 23个共享工具 跨Xcode、模拟器和IDB
- 单一事实来源 -定义一次的工具,由MCP导入
🔥 外科MCPs(超聚焦)
- xc构建 (约600个令牌)-构建验证、错误、干净、列表方案
- xc启动 (约400个令牌)-模拟器应用程序生命周期:安装和启动
- xc互动 (约900个令牌)-纯UI交互,无需构建
📦 核心工作流程MCP
- xc-ai协助 (约1400个代币)-构建+UI自动化+截图
- xc设置 (约800个令牌)-环境配置和验证
- xc测试 (~1200个令牌)-测试执行+UI流
- xc元 (约700个代币)-项目维护和内务管理
🚀 完全访问
- xc全部 (约3500个令牌)-用于复杂工作流程的所有24个工具
📚 8程序技能(按需加载)
- xcode工作流 -构建系统指导和结果分析
- 模拟器工作流程 -设备和应用程序生命周期模式
- ui自动化工作流 -可访问性优先自动化
- 可访问性测试 -WCAG合规性和质量检查
- ios测试模式 -测试执行和片状测试检测
- 崩溃调试 -故障日志分析和符号化
- 性能分析 -仪器集成
- 国家管理 -缓存和配置管理
安装
来自GitHub(推荐)
/plugin marketplace add conorluddy/xclaude-plugin
/plugin install xclaude-plugin从地方发展
/plugin marketplace add /path/to/xclaude-plugin
/plugin install xclaude-plugin前60秒
刚刚安装?启用 xc构建 和 xc启动 为了快速发展:
1. In Claude settings, enable "xc-build" and "xc-launch" MCPs
2. Ask Claude: "Build and run MyApp on iPhone 15"
3. Done! ✨就这样 xc构建 + xc启动 为您提供了一个可组合的开发循环:使用xc-build构建,然后使用xc-launch安装和启动。Claude精心策划了两步工作流程。如果您需要其他工作流(测试、设置、UI自动化),请参阅 选择正确的MCP 在......下面
需求
- macOS 13.0+或Linux
- Xcode 15.0+(仅限macOS,用于iOS开发)
- Node.js 18+
- 可选:IDB(Facebook iOS开发桥)用于高级UI自动化
迁移指南(v0.4.0)
如果您要从早期版本升级,请注意以下重大更改:
重命名服务器: xc-build-and-launch → xc-launch
发生了什么变化:
- 服务器重命名自 xc构建和发布 到 xc启动 为清晰起见
- 远离的:
xcode_build_and_launch单片工具(带skip_build标志),加xcode_build,xcode_clean,xcode_list(移到xc build) - 现在包含: 仅
simulator_install_app和simulator_launch_app - 哲学: 使用 xc构建 + xc启动 共同开发循环
为什么? 单片 xcode_build_and_launch 工具将构建、安装和启动整合到一个操作中。新架构将构建关注点(xc构建)与模拟器生命周期(xc启动)分开,实现了:
- 更好的错误恢复(重试各个步骤)
- 更清晰的心智模型(构建→ 安装→ 发射)
- 不
skip_build代码异味 - 遵循单一责任原则
需要采取的行动:
- 更新您的
.mcp.json配置:
- "xc-build-and-launch": {
- "command": "node",
- "args": ["${CLAUDE_PLUGIN_ROOT}/mcp-servers/xc-build-and-launch/dist/index.js"]
+ "xc-launch": {
+ "command": "node",
+ "args": ["${CLAUDE_PLUGIN_ROOT}/mcp-servers/xc-launch/dist/index.js"]- 在Claude设置中,启用“xc启动”而不是“xc构建和启动”
以前的版本:
v0.3.0:xc-run→xc-build-and-launchv0.3.0:xc-compile→xc-build,xc-hybrid→xc-all
看 .mcp.json.example 对于当前配置。
选择正确的MCP
为您的任务启用正确的MCP
重要:启用 一次一个MCP 以获得最佳的令牌效率。根据您当前的工作流程进行选择:
☐ xc-build # Build validation, errors, clean? (~600 tokens)
☐ xc-launch # Simulator lifecycle: install + launch? (~400 tokens)
☐ xc-interact # Testing UI with app already built? (~900 tokens)
☐ xc-ai-assist # AI-driven UI iteration? (~1400 tokens)
☐ xc-setup # First time setup? (~800 tokens)
☐ xc-testing # Running test suites? (~1200 tokens)
☐ xc-meta # Maintenance tasks? (~700 tokens)
☐ xc-all # Complex workflow needing everything? (~3500 tokens)
💡 Tip: Enable xc-build + xc-launch together for development loop (~1000 tokens total)示例工作流
场景1:构建并修复错误
Enable: xc-build (~600 tokens)
"Build the project and show me the errors"
→ Uses xcode_build with automatic error extraction
→ Returns up to 10 errors for quick fixes
→ 87% less tokens than old architecture!场景2:快速开发-构建和运行
Enable: xc-build + xc-launch (~1000 tokens)
"Build and run MyApp on iPhone 15"
→ Claude orchestrates: build (xc-build) → install & launch (xc-launch)
→ Composable two-server workflow
→ Better error recovery (retry individual steps)
→ Perfect for iterative development场景3:测试UI流(应用程序已构建)
Enable: xc-interact (~900 tokens)
"Tap the Login button, then check if the profile screen appears"
→ Queries accessibility tree (3-4x faster than screenshots)
→ Taps elements by coordinates
→ Validates UI state without rebuilding场景4:AI驱动的UI迭代
Enable: xc-ai-assist (~1400 tokens)
"Update the button color to blue, rebuild, and show me a screenshot"
→ Modifies code, builds, captures screenshot
→ Complete workflow in one MCP
→ Includes visual feedback (screenshots)建筑
模块化MCP设计
┌─────────────────────────────────────────────────────┐
│ Shared Tool Library (24 tools) │
│ ├─ Xcode (6): build, build+run, clean, test, list, version │
│ ├─ Simulator (12): boot, install, screenshot, etc.│
│ └─ IDB (6): describe, tap, input, gesture, etc. │
└─────────────────────────────────────────────────────┘
↓ Tools imported by MCP servers ↓
┌─────────────────────────────────────────────────────┐
│ 8 Workflow-Specific MCP Servers │
│ ├─ xc-build: 3 tools (~600 tokens) │
│ ├─ xc-launch: 2 tools (~400 tokens) │
│ ├─ xc-interact: 6 tools (~900 tokens) │
│ ├─ xc-ai-assist: 7 tools (~1400 tokens) │
│ ├─ xc-setup: 5 tools (~800 tokens) │
│ ├─ xc-testing: 6 tools (~1200 tokens) │
│ ├─ xc-meta: 6 tools (~700 tokens) │
│ └─ xc-all: 24 tools (~3500 tokens) │
└─────────────────────────────────────────────────────┘关键利益
对于用户:
- 仅启用您需要的(300-3500个令牌)
- 清晰的心智模型(基于工作流的命名)
- 无工具重复混淆
- 在Claude设置中易于打开/关闭
对于开发者:
- 单一真相来源(共享工具)
- 易于测试(独立功能)
- 维护简单(更新一次)
- 全程类型安全(零
any使用)
MCP服务器参考
🔥 外科MCPs
| MCP | 工具 | 令牌成本 | 使用时间 |
|---|---|---|---|
| xc构建 | 3 | ~600 | 使用干净/方案发现构建验证 |
| xc启动 | 2 | ~400 | 模拟器生命周期:安装并启动应用程序 |
| xc互动 | 6 | ~900 | 使用已构建的应用程序测试UI流 |
📦 核心工作流程MCP
| MCP | 工具 | 令牌成本 | 使用时间 |
|---|---|---|---|
| xc-ai协助 | 7 | ~1400 | 具有视觉反馈的AI UI迭代 |
| xc设置 | 5 | ~800 | 初始设置、环境验证 |
| xc测试 | 6 | ~1200 | 运行测试套件+UI自动化 |
| xc元 | 6 | ~700 | 维护、内务、环境检查 |
🚀 完全访问
| MCP | 工具 | 令牌成本 | 使用时间 |
|---|---|---|---|
| xc全部 | 23 | ~3500 | 复杂的工作流程需要一切 |
专业建议:不要同时启用多个MCP-工具复制会增加令牌使用量!对于多工作流会话,请使用xc-all。
备忘单-哪些工具在哪个MCP中?
快速参考哪个MCP有您需要的工具:
Xcode工具
| 工具 | xc构建 | xc启动 | xc交互 | xc ai辅助 | xc设置 | xc测试 | xc元 | xc全部 |
|---|---|---|---|---|---|---|---|---|
xcode_build | ✅ | ✅ | ✅ | |||||
xcode_build_and_launch | ✅ | |||||||
xcode_clean | ✅ | ✅ | ✅ | |||||
xcode_test | ✅ | ✅ | ||||||
xcode_list | ✅ | ✅ | ✅ | |||||
xcode_version | ✅ | ✅ | ✅ |
模拟器工具
| 工具 | xc构建 | xc启动 | xc交互 | xc ai辅助 | xc设置 | xc测试 | xc元 | xc全部 |
|---|---|---|---|---|---|---|---|---|
simulator_list | ✅ | ✅ | ||||||
simulator_boot | ✅ | ✅ | ||||||
simulator_shutdown | ✅ | ✅ | ||||||
simulator_create | ✅ | ✅ | ||||||
simulator_delete | ✅ | ✅ | ||||||
simulator_install_app | ✅ | ✅ | ||||||
simulator_launch_app | ✅ | ✅ | ||||||
simulator_terminate_app | ✅ | |||||||
simulator_screenshot | ✅ | ✅ | ✅ | |||||
simulator_openurl | ✅ | |||||||
simulator_get_app_container | ✅ | |||||||
simulator_health_check | ✅ | ✅ | ✅ |
IDB工具
| 工具 | xc构建 | xc启动 | xc交互 | xc ai辅助 | xc设置 | xc测试 | xc元 | xc全部 |
|---|---|---|---|---|---|---|---|---|
idb_describe | ✅ | ✅ | ✅ | ✅ | ||||
idb_tap | ✅ | ✅ | ✅ | ✅ | ||||
idb_input | ✅ | ✅ | ✅ | ✅ | ||||
idb_gesture | ✅ | ✅ | ✅ | |||||
idb_find_element | ✅ | ✅ | ✅ | |||||
idb_check_quality | ✅ | ✅ | ✅ |
工具库(共24个)
Xcode工具(6)
xcode_build-使用自动错误提取进行构建xcode_build_and_launch-在模拟器上构建、安装和启动xcode_clean-清理构建工件xcode_test-运行XCTest套件xcode_list-列出方案/目标xcode_version-检查Xcode安装
模拟器工具(12)
simulator_list-枚举模拟器simulator_boot-启动设备simulator_shutdown-关机装置simulator_create-创建新模拟器simulator_delete-删除模拟器simulator_install_app-安装应用程序simulator_launch_app-启动应用程序simulator_terminate_app-终止应用程序simulator_screenshot-截图simulator_openurl-打开URL/深度链接simulator_get_app_container-获取应用容器路径simulator_health_check-验证环境
IDB工具(6)
idb_describe-查询可访问性树(可访问性优先!)idb_tap-点击坐标idb_input-键入文本或按键idb_gesture-滑动和硬件按钮idb_find_element-按标签搜索(语义)idb_check_quality-评估可访问性数据的丰富性
配置您的项目
将此部分添加到项目的 .claude/CLAUDE.md 文件。这将指导Claude何时以及为什么使用xclaude插件工具,而不是直接调用Xcode或shell命令:
## xclaude-plugin: Why and When to Use These Tools
The xclaude-plugin provides 8 modular MCPs with 24 specialized iOS tools. **Always prefer these over raw `xcodebuild` or shell commands** for iOS development tasks. Here's why:
### Why These Tools Trump Raw Commands
| Task | Direct Bash | xclaude-plugin | Why Plugin Wins |
| -------------------- | -------------------------------------------------------------- | -------------------------------- | ------------------------------------------------------------------------- |
| Build + get errors | `xcodebuild -scheme Foo 2>&1` (50+ lines of parsing) | `xcode_build` tool | Auto-extracts up to 10 errors, structured JSON, 87% fewer tokens |
| Test suite execution | `xcodebuild test` + manual parsing | `xcode_test` tool | Parses results, reports failures, timing, code coverage |
| Simulator screenshot | `xcrun simctl io booted screenshot /tmp/x.png` + file handling | `simulator_screenshot` tool | Auto-saves, encoded output, accessible in response |
| UI automation | Manual coordinate finding + shell taps | `idb_describe` + `idb_tap` tools | Queries accessibility tree (120ms), semantic element finding, 3-4x faster |
| App installation | `xcrun simctl install booted App.app` | `simulator_install_app` tool | Builds, finds app, installs, validates—one command |
### When to Use Each MCP
**Use `xc-build`** (~600 tokens) when:
- Building and fixing errors
- Need to clean build artifacts
- Discovering schemes/targets in project
- Build validation and configuration
**Use `xc-launch`** (~400 tokens) when:
- Installing and launching an app on the simulator
**Use `xc-interact`** (~900 tokens) when:
- Testing UI flows with app already built
- Automating screen validation without code changes
- Need accessibility-first element querying
**Use `xc-ai-assist`** (~1400 tokens) when:
- Iterating on UI with live feedback (code change → screenshot)
- Need visual validation of changes
- Combining code modification with testing
**Use `xc-testing`** (~1200 tokens) when:
- Running test suites and analyzing results
- Need both unit tests and UI automation
- Debugging test failures
**Use `xc-setup`** (~800 tokens) when:
- First-time environment validation
- Checking Xcode/simulator health
- Discovering project structure (schemes, targets)
**Use `xc-meta`** (~700 tokens) when:
- Maintenance tasks (clearing derived data, managing simulators)
- Non-coding iOS project operations
- Environment housekeeping
**Use `xc-all`** (~3500 tokens) when:
- Complex workflows requiring multiple tool categories
- Don't know which single MCP fits the task
- Need flexibility to pivot between workflows
### Critical: Prefer Plugin Tools Over Bash
When you encounter a task that could use either approach, **always choose the plugin tool**.
**Don't do this:**
# Manual build parsing
> `xcodebuild -scheme MyApp 2>&1 | grep -A5 "error:" | sed ...`
**Do this instead:** Use the `xcode_build` tool from `xc-build` MCP.
---
**Don't do this:**
# Manual screenshot saving
> `xcrun simctl io booted screenshot /tmp/screenshot.png`
> `cat /tmp/screenshot.png | base64`
**Do this instead:** Use the `simulator_screenshot` tool from `xc-interact` MCP.
---
**Don't do this:**
# Finding UI elements by trial and error
> `xcrun simctl spawn booted launchctl list | grep bundleid`
**Do this instead:** Use `idb_describe` tool to query accessibility tree, then `idb_tap` to interact.
### When Bash IS Still Appropriate
Use Bash for tasks outside iOS development:
- File operations: `mkdir`, `cp`, `rm`, `ls`
- Version control: `git status`, `git diff`, `git commit`
- General scripting: `jq`, `sed`, `awk`
- Environment setup: `npm install`, `brew install`
**Never use Bash for iOS-specific tasks** when a plugin tool exists.模拟器配置
xclaude插件会自动跟踪您的模拟器使用情况,并支持默认模拟器的配置文件。
配置文件位置
项目级别 (建议保持团队一致性):
# .xcplugin in your project root
{
"defaultSimulator": "platform=iOS Simulator,name=iPhone 15",
"maxRecentHistory": 10
}用户级别 (所有项目的个人默认值):
# ~/.xcplugin/config.json
{
"defaultSimulator": "platform=iOS Simulator,name=iPhone 15 Pro",
"maxRecentHistory": 10
}优先:项目配置覆盖用户配置。
运作原理
- 自动分辨率:部分目的地,如
"platform=iOS Simulator,name=iPhone 15"自动解析为可用的最新操作系统版本 - 使用跟踪:每个构建/测试都会自动跟踪您使用的模拟器
- 智能默认值:当不存在配置时,插件会记住您最近的模拟器
目标格式
这 xcode_build 和 xcode_test 工具接受三种目标格式:
# 1. Auto-resolve (recommended) - finds latest OS automatically
"platform=iOS Simulator,name=iPhone 15"
# 2. Explicit - specify exact OS version
"platform=iOS Simulator,name=iPhone 15,OS=18.0"
# 3. UDID - direct device identifier
"id=ABC-123-DEF-456"快速设置
- 创建配置文件 (选择一个):
# Project-level
echo '{"defaultSimulator": "platform=iOS Simulator,name=iPhone 15"}' > .xcplugin
# User-level
mkdir -p ~/.xcplugin
echo '{"defaultSimulator": "platform=iOS Simulator,name=iPhone 15"}' > ~/.xcplugin/config.json- 查找可用的模拟器:
xcrun simctl list devices available- 使用
simulator_list工具 查看您的设备:
Ask Claude: "Show me available simulators"配置示例
看 .xcplugin.example 在插件目录中查看完整示例。
启用最小MCP以提高令牌效率
- 代币效率:xc build(约600个代币)比xc-all(3500个代币)便宜83%
- 头脑清晰:每个工作流程阶段的重点工具
- 可组合工作流程:在开发循环中同时启用xc构建+xc启动(约1000个令牌)
指导方针:
- 单一工作流程:启用一个专注的MCP(例如,xc交互仅用于UI测试)
- 开发循环:启用xc构建+xc启动以进行构建→ 安装→ 发射
- 复杂的工作流程:当您同时需要多种功能时,启用xc-all
发展
从源头构建
# Clone repository
git clone https://github.com/conorluddy/xclaude-plugin.git
cd xclaude-plugin
# Install dependencies
npm install
# Build MCP server
npm run build
# Test locally
/plugin marketplace add /path/to/xclaude-plugin
/plugin install xclaude-plugin项目结构
xclaude-plugin/
├── .claude-plugin/
│ ├── plugin.json # Plugin manifest (8 MCP servers)
│ └── marketplace.json # Marketplace configuration
├── mcp-servers/ # 8 modular MCP servers
│ ├── shared/ # Shared tool library (24 tools)
│ │ ├── tools/ # Tool implementations
│ │ ├── types/ # Shared type definitions
│ │ └── utils/ # Command execution utilities
│ ├── xc-build/ # MCP 1: Build validation
│ ├── xc-launch/ # MCP 2: Simulator lifecycle (install + launch)
│ ├── xc-interact/ # MCP 3: Pure UI interaction
│ ├── xc-ai-assist/ # MCP 4: AI UI automation
│ ├── xc-setup/ # MCP 5: Environment setup
│ ├── xc-testing/ # MCP 6: Test execution
│ ├── xc-meta/ # MCP 7: Maintenance
│ └── xc-all/ # MCP 8: Full toolkit
├── skills/ # 8 Skills (markdown + YAML)
│ ├── xcode-workflows/
│ ├── simulator-workflows/
│ ├── ui-automation-workflows/
│ ├── accessibility-testing/
│ ├── ios-testing-patterns/
│ ├── crash-debugging/
│ ├── performance-profiling/
│ └── state-management/
└── README.md设计理念
模块化令牌效率
只启用你需要的东西。用于集中任务的超最小MCP(300个令牌),用于复杂工作流的综合MCP(3500个令牌)。外科手术象征性减少87%。
可访问性优先的UI自动化
在截图(2000ms,~170个令牌)之前查询可访问性树(120ms,~50个令牌)。速度快3-4x,成本低80%,跨主题更改更可靠。
单一事实来源
在共享库中定义了24个工具,由8个MCP导入。更新一次,处处受益。类型安全,零 any 使用。
基于工作流的组织
MCP按开发人员工作流阶段命名,而不是按技术领域命名。xc build用于构建验证,xc setup用于环境,xc-all用于复杂会话。
贡献
我感谢您的贡献,但请注意,此回购和我的其他公共回购在我正在进行的工作的优先级队列中排名靠后,所以我审查任何事情都会很慢。你最好的选择就是分叉回购,并根据自己的需求进行定制。
许可证
MIT许可证-请参阅 许可证 详情
支持
______________________________________________________________________
Claude Code的完整iOS开发自动化 🚀
