X
Xcodemcp
作者 @lapfelix
MCP server for Xcode that wraps its AppleScript interface & uses XCLogParser to return clear build results
创建于 6/4/2025
更新于 2 days ago
README
Repository documentation and setup instructions
XcodeMCP
MCP server for Xcode build automation and log parsing.
What it does
- Opens Xcode projects and triggers builds in Xcode, not using xcodebuild. [^1]
- Parses build logs to extract errors and warnings using XCLogParser
- Provides MCP tools for AI assistants to interact with Xcode
[^1]: For an alternative that uses xcodebuild
, see XcodeBuildMCP
Requirements
- macOS with Xcode installed
- Node.js 18+
- XCLogParser:
brew install xclogparser
Usage
Quick Install
Install from npm
Run directly with npx:
brew install xclogparser
npx xcodemcp@latest
Or install globally:
brew install xclogparser
npm install -g xcodemcp
MCP Configuration
Add to your MCP configuration:
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["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": ["xcodemcp@latest"],
"env": {}
}'
Or clone locally:
git clone https://github.com/lapfelix/XcodeMCP.git
cd XcodeMCP
npm install
node index.js
Available Tools
xcode_open_project
- Open Xcode projects and workspacesxcode_build
- Build and get errors/warningsxcode_build_scheme
- Build with specific scheme and destinationxcode_clean
- Clean build artifactsxcode_test
- Run unit and UI testsxcode_run
- Run the active schemexcode_debug
- Start debugging sessionxcode_stop
- Stop current build/run/test operationxcode_get_schemes
- List all available schemesxcode_get_run_destinations
- List simulators and devicesxcode_set_active_scheme
- Switch between schemesxcode_get_workspace_info
- Get workspace details and statusxcode_get_projects
- List projects in workspacexcode_open_file
- Open specific files in Xcode
Example
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "xcode_build", "arguments": {}}}' | node index.js
Output:
❌ BUILD FAILED (1 errors)
ERRORS:
• /path/file.swift: 'SomeType' file not found
快速设置
此服务器的安装指南
安装包 (如果需要)
npx @modelcontextprotocol/server-xcodemcp
Cursor 配置 (mcp.json)
{
"mcpServers": {
"lapfelix-xcodemcp": {
"command": "npx",
"args": [
"lapfelix-xcodemcp"
]
}
}
}