@ebowwa/mcp xcode
Xcode MCP服务器-从Claude Code构建、测试、运行和管理模拟器。
安装
npm install @ebowwa/mcp-xcode
需求
- macOS(达尔文)
- Xcode命令行工具(
xcode-select --install)
工具
构建工具
| 工具 |
说明 |
xcode_build |
构建Xcode项目/工作区 |
xcode_test |
运行单元/UI测试 |
xcode_archive |
创建.xccarchive进行分发 |
xcode_clean |
清理构建文件夹 |
xcode_show_build_settings |
显示方案的所有生成设置 |
项目信息
| 工具 |
说明 |
xcode_project_info |
获取项目/工作区信息 |
xcode_scheme_list |
列出所有方案 |
xcode_destination_list |
列出可用目的地 |
模拟器工具
| 工具 |
说明 |
xcode_simulator_list |
列出所有可用的模拟器 |
xcode_simulator_boot |
启动模拟器 |
xcode_simulator_shutdown |
停机模拟器 |
xcode_simulator_install |
在模拟器上安装应用程序 |
xcode_simulator_launch |
在模拟器上启动应用程序 |
xcode_simulator_terminate |
在模拟器上终止应用程序 |
xcode_simulator_open_url |
在模拟器上打开URL |
xcode_simulator_take_screenshot |
截图 |
设备工具
| 工具 |
说明 |
xcode_device_list |
列出连接的物理设备 |
xcode_runtime_list |
列出已安装的iOS/tvOS/watchOS运行时 |
使用示例
构建方案
{
"scheme": "MyApp",
"destination": "platform=iOS Simulator,name=iPhone 15"
}
运行测试
{
"scheme": "MyAppTests",
"onlyTesting": "MyAppTests/MyTestCase/testExample"
}
开机模拟器
{
"name": "iPhone 15",
"runtime": "iOS 17.2"
}
安装并启动应用程序
{
"appPath": "/path/to/MyApp.app",
"bundleId": "com.mycompany.myapp"
}
Claude代码配置
添加到您的 ~/.claude.json:
{
"mcpServers": {
"xcode": {
"command": "bun",
"args": ["run", "/path/to/mcp-xcode/dist/index.js"]
}
}
}
许可证
麻省理工学院