Xcodemcp
概览
作者提供的说明(英文原文)
Control Xcode directly via JXA for build, test, debug operations with XCLogParser integration
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 开发者工具
安装
选择你使用的 AI 应用,然后复制设置。
通过 1/2 项检查 · 在你的电脑上运行
第一步:你用哪个 AI?
选择你用的应用,步骤会显示在下方。
可连接 Claude,但需要先准备
需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
打开电脑版 Claude 应用的设置文件
SettingsDeveloperEdit Config
粘贴这些设置并保存文件
{ "mcpServers": { "xcodemcp": { "command": "npx", "args": [ "-y", "xcodemcp" ] } } }退出 Claude 再重新打开
试一试
用 Xcodemcp 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude 说正在使用 Xcodemcp,或回答中出现 Xcodemcp 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
ChatGPT 暂时无法连接 Xcodemcp
Xcodemcp 需要安装在你的电脑上,而 ChatGPT 只能连接在网上运行的服务器
你可以改用这些方式
A · 使用能连接 Xcodemcp 的应用
- 需要先在电脑上安装 Node.js(只需一次) · 仅限电脑上的 Claude 应用(Windows 或 Mac),网页和手机不可用
- 需要先在电脑上安装 Node.js(只需一次)
- 需要先在电脑上安装 Node.js(只需一次)
- 需要先在电脑上安装 Node.js(只需一次)
B · 开发者工具 类中能连接 ChatGPT 的其他服务器
从同类中使用较多的里挑选,仅限用地址即可连接、无需密钥的
- Sentry✓ ChatGPT
- Front-End Checklist✓ ChatGPT
- Compiler Explorer✓ ChatGPT
可连接 Claude Code,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
打开终端
Mac:按 Command+空格,输入 Terminal · Windows:打开 PowerShell
粘贴这条命令并按 Enter
claude mcp add xcodemcp -- npx -y xcodemcp在 Claude Code 中输入 /mcp
应能看到 Xcodemcp 在列表中并显示已连接
试一试
用 Xcodemcp 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Claude Code 说正在使用 Xcodemcp,或回答中出现 Xcodemcp 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Anthropic 帮助页面核实 · 你的界面可能因版本略有不同
可连接 Cursor,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
在 Cursor 中以 Agent 模式打开 AI 聊天
试一试
用 Xcodemcp 告诉我你能帮我做什么,然后做一件给我看✓ 如果 Cursor 说正在使用 Xcodemcp,或回答中出现 Xcodemcp 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 Cursor 帮助页面核实 · 你的界面可能因版本略有不同
可连接 VS Code,但需要先准备
需要先在电脑上安装 Node.js(只需一次)
在 VS Code 中以 Agent 模式打开 AI 聊天
试一试
用 Xcodemcp 告诉我你能帮我做什么,然后做一件给我看✓ 如果 VS Code 说正在使用 Xcodemcp,或回答中出现 Xcodemcp 的工具名称,就表示连接成功
菜单名称已于 2026年11月11日 对照 VS Code 帮助页面核实 · 你的界面可能因版本略有不同
开发者专用:终端命令和 JSON 设置
安装在电脑上
Claude Code
claude mcp add xcodemcp -- npx -y xcodemcpClaude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": [
"-y",
"xcodemcp"
]
}
}
}Cursor (~/.cursor/mcp.json)
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": [
"-y",
"xcodemcp"
]
}
}
}VS Code (mcp.json)
{
"servers": {
"xcodemcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"xcodemcp"
]
}
}
}这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
一览
哪些应用可以使用它
依据这个服务器的连接方式和各应用自己的文档,检查于 2026年11月10日。
在你的电脑上运行,适用于
ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月11日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 lapfelix 验证,该账户拥有此仓库
- ! 注意
仍在维护
代码最后更新于9个月前,已超过 6 个月
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
讨论
提问、分享技巧或报告无法使用。按“有帮助”数量排序。
用户评价
还没有评价
与“开发者工具”中的其他服务器比较i
- 星标数多于此分类中其他 5751 个服务器的 96%
- 发布到注册中心的时间比此分类中其他 5751 个服务器的 0% 更新
- 基础检查结果等于或优于此分类中其他 5751 个服务器的 12%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
Xcodemcp 安全吗?
它在 2 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于9个月前,最新版本(2.1.4)于14个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Node.js。
有什么可以替代它?
同一分类中有:REA, Netdata, Front-End Checklist
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
Netdata
Real-time infrastructure monitoring with metrics, logs, alerts, and ML-based anomaly detection.
Front-End Checklist
Review frontend code and live pages against 386 quality-gated web development rules.
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
Using with Apple's Official Xcode MCP: Apple now provides an official Xcode MCP server. XcodeMCP can run alongside it in sidekick mode (
--sidekick-only), providing complementary tools like project management and XCResult analysis. In a future version, XcodeMCP will transition to sidekick-only mode by default. See configuration below.
XcodeMCP
Model Context Protocol (MCP) server that controls Xcode directly through JavaScript for Automation (JXA). Available as both an MCP server and a standalone CLI.
What it does
- Controls Xcode directly through JavaScript for Automation (not xcodebuild CLI)
- Opens projects, builds, runs, tests, and debugs from within Xcode
- Parses build logs with precise error locations using XCLogParser
- Provides comprehensive environment validation and health checks
- Supports graceful degradation when optional dependencies are missing
- NEW: Includes a full-featured CLI with 100% MCP server feature parity
Requirements
- macOS with Xcode installed
- Node.js 18+
- XCLogParser (recommended):
brew install xclogparser
Usage
XcodeMCP can be used in two ways:
- MCP Server: Integrate with Claude Desktop, VS Code, or other MCP clients
- CLI Tool: Run commands directly from the terminal with
xcodecontrol
Quick Install
XCLogParser is recommended but optional:
brew install xclogparser
Install from npm
Run directly with npx:
npx -y xcodemcp@latest
Or install globally:
npm install -g xcodemcp
MCP Configuration
Add to your MCP configuration:
{
"mcpServers": { "xcodemcp": { "command": "npx", "args": ["-y", "xcodemcp@latest"], "env": { } } } }
Claude Code CLI Setup
To add XcodeMCP to Claude Code using the command line:
claude mcp add-json XcodeMCP '{
"command": "npx", "args": ["-y", "xcodemcp@latest"], "env": { } }'
Without the clean build folder tool
To add XcodeMCP to Claude Code using the command line:
claude mcp add-json XcodeMCP '{
"command": "npx", "args": ["-y", "xcodemcp@latest", "--no-clean"], "env": { } }'
Using Preferred Values for Single Project Workflows
For projects where you're working with a single xcodeproj and scheme, you can configure preferred values to make tool parameters optional:
claude mcp add-json XcodeMCP '{
"command": "npx", "args": ["-y", "xcodemcp@latest"], "env": { "XCODE_MCP_PREFERRED_SCHEME": "MyApp", "XCODE_MCP_PREFERRED_XCODEPROJ": "MyApp.xcodeproj" } }'
With preferred values configured:
- Tool parameters become optional instead of required
- Tool descriptions show default values (e.g., "defaults to MyApp.xcodeproj")
- You can still override defaults by providing explicit parameters
- Reduces repetition when working with a single project
Troubleshooting
If /mcp in Claude Code indicates the MCP failed, try running it from the project folder manually to see what the output is: npx -y xcodemcp@latest
Sidekick Mode
When using XcodeMCP alongside Apple's official Xcode MCP server, enable sidekick mode to only include complementary tools:
- Project management: Open/close projects, manage schemes, workspace info
- XCResult analysis: Browse test results, extract screenshots, inspect UI hierarchies
This excludes build/run/test/debug tools that Apple's MCP handles natively.
Claude Code CLI Setup (Both Servers)
First, enable Xcode Tools in Xcode > Settings > Intelligence > Model Context Protocol.
Then add both Apple's Xcode MCP and XcodeMCP in sidekick mode:
# Add Apple's official Xcode MCP
claude mcp add --transport stdio xcode -- xcrun mcpbridge
Add XcodeMCP in sidekick mode (project management + XCResult analysis)
claude mcp add-json xcodemcp '{"command": "npx", "args": ["-y", "xcodemcp@latest", "--sidekick-only"]}'
JSON Configuration (Both Servers)
{
"mcpServers": { "xcode": { "command": "xcrun", "args": ["mcpbridge"] }, "xcodemcp": { "command": "npx", "args": ["-y", "xcodemcp@latest", "--sidekick-only"] } } }
Future direction: In a future version, XcodeMCP will transition to sidekick-only mode by default, focusing exclusively on tools that complement Apple's official Xcode MCP rather than duplicating functionality.
Development Setup
For local development:
git clone https://github.com/lapfelix/XcodeMCP.git
cd XcodeMCP npm install
Run in development mode (TypeScript)
npm run dev:ts
Or build and run compiled version
npm run build npm start
CLI Usage
XcodeMCP includes a powerful CLI that provides 100% feature parity with the MCP server, allowing you to run any tool as a one-shot command:
Installation
Install globally to use the CLI:
npm install -g xcodemcp
Basic Usage
# Show help and available tools
xcodecontrol --help
Run a tool with flags
xcodecontrol build --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme
Get help for a specific tool
xcodecontrol build --help
Use JSON input instead of flags
xcodecontrol build --json-input '{"xcodeproj": "/path/to/Project.xcodeproj", "scheme": "MyScheme"}'
Output results in JSON format
xcodecontrol --json health-check
Path Resolution
The CLI supports both absolute and relative paths for convenience:
# Absolute paths (traditional)
xcodecontrol build --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp
Relative paths (NEW in v2.0.0)
xcodecontrol build --xcodeproj MyApp.xcodeproj --scheme MyApp xcodecontrol build --xcodeproj ../OtherProject/OtherProject.xcodeproj --scheme OtherApp
Works with file paths too
xcodecontrol open-file --filePath src/ViewController.swift --lineNumber 42
Relative paths are resolved from your current working directory, making the CLI much more convenient to use when working within project directories.
Verbosity Control
Control logging output with verbosity flags:
# Verbose mode (shows INFO and DEBUG logs)
xcodecontrol -v build --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme
Quiet mode (only errors)
xcodecontrol -q test --xcodeproj /path/to/Project.xcodeproj
Default mode (warnings and errors only)
xcodecontrol run --xcodeproj /path/to/Project.xcodeproj --scheme MyScheme
Quick Examples
# Check system health
xcodecontrol health-check
Build a project
xcodecontrol build --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp
Run the app
xcodecontrol run --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj --scheme MyApp
Run tests
xcodecontrol test --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj
Clean build directory
xcodecontrol clean --xcodeproj /Users/dev/MyApp/MyApp.xcodeproj
Browse XCResult files
xcodecontrol xcresult-browse --xcresult-path /path/to/result.xcresult
Get UI hierarchy from test failure
xcodecontrol xcresult-get-ui-hierarchy --xcresult-path /path/to/result.xcresult --test-id "MyTest/testMethod()" --timestamp 30.5
Tool Name Mapping
CLI commands use kebab-case instead of underscores:
xcode_build→buildxcode_test→testxcode_build_and_run→build-and-runxcode_health_check→health-checkxcresult_browse→xcresult-browsefind_xcresults→find-xcresults
Available Tools
Project Management:
xcode_open_project- Open projects and workspacesxcode_get_workspace_info- Get workspace status and detailsxcode_get_projects- List projects in workspacexcode_open_file- Open files with optional line number
Build Operations:
xcode_build- Build with detailed error parsingxcode_clean- Clean build artifactsxcode_test- Run tests with optional argumentsxcode_build_and_run- Build and run the active schemexcode_debug- Start debugging sessionxcode_stop- Stop current operation
Configuration:
xcode_get_schemes- List available schemesxcode_set_active_scheme- Switch active schemexcode_get_run_destinations- List simulators and devices
XCResult Analysis:
xcresult_browse- Browse test results and analyze failuresxcresult_browser_get_console- Get console output for specific testsxcresult_summary- Quick overview of test resultsxcresult_get_screenshot- Extract screenshots from test failuresxcresult_get_ui_hierarchy- Get UI hierarchy as AI-readable JSON with timestamp selectionxcresult_get_ui_element- Get detailed properties of specific UI elements by indexxcresult_list_attachments- List all attachments for a testxcresult_export_attachment- Export specific attachments from test results
Diagnostics:
xcode_health_check- Environment validation and troubleshooting
XCResult Analysis Features
XcodeMCP provides comprehensive tools for analyzing Xcode test results (.xcresult files), making it easy to debug test failures and extract valuable information:
Test Result Analysis
- Browse Results: Navigate through test hierarchies, view pass/fail status, and examine detailed test information
- Console Logs: Extract console output and test activities with precise timestamps for debugging
- Quick Summaries: Get overview statistics including pass rates, failure counts, and duration
Visual Debugging
- Screenshot Extraction: Extract PNG screenshots from test failures using ffmpeg frame extraction from video attachments
- Timestamp Precision: Specify exact timestamps to capture UI state at specific moments during test execution
UI Hierarchy Analysis
- AI-Readable Format: Extract UI hierarchies as compressed JSON with single-letter properties (
t=type,l=label,f=frame,c=children,j=index) - Timestamp Selection: Automatically find the closest UI hierarchy capture to any specified timestamp
- Element Deep-Dive: Use index references to get full details of any UI element, including accessibility properties and frame information
- Size Optimization: 75%+ size reduction compared to full hierarchy data while maintaining all essential information
Attachment Management
- Complete Inventory: List all attachments (screenshots, videos, debug descriptions, UI hierarchies) for any test
- Selective Export: Export specific attachments by index or type
- Smart Detection: Automatically identify and categorize different attachment types
Usage Examples
# Browse test results
xcresult_browse "/path/to/TestResults.xcresult"
Get console output to find failure timestamps
xcresult_browser_get_console "/p