Server data from the Official MCP Registry
Control Xcode directly via JXA for build, test, debug operations with XCLogParser integration
Control Xcode directly via JXA for build, test, debug operations with XCLogParser integration
Valid MCP server (1 strong, 1 medium validity signals). 2 known CVEs in dependencies (0 critical, 2 high severity) Package registry verified. Imported from the Official MCP Registry.
4 files analyzed · 3 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-lapfelix-xcodemcp": {
"args": [
"-y",
"xcodemcp"
],
"command": "npx"
}
}
}From the project's GitHub README.
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.
Model Context Protocol (MCP) server that controls Xcode directly through JavaScript for Automation (JXA). Available as both an MCP server and a standalone CLI.
brew install xclogparserXcodeMCP can be used in two ways:
xcodecontrolXCLogParser is recommended but optional:
brew install xclogparser
Run directly with npx:
npx -y xcodemcp@latest
Or install globally:
npm install -g xcodemcp
Add to your MCP configuration:
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
}
}
}
}
To add XcodeMCP to Claude Code using the command line:
claude mcp add-json XcodeMCP '{
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
}
}'
To add XcodeMCP to Claude Code using the command line:
claude mcp add-json XcodeMCP '{
"command": "npx",
"args": ["-y", "xcodemcp@latest", "--no-clean"],
"env": {
}
}'
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:
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
When using XcodeMCP alongside Apple's official Xcode MCP server, enable sidekick mode to only include complementary tools:
This excludes build/run/test/debug tools that Apple's MCP handles natively.
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"]}'
{
"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.
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
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:
Install globally to use the CLI:
npm install -g xcodemcp
# 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
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.
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
# 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
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-xcresultsProject 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 numberBuild 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 operationConfiguration:
xcode_get_schemes - List available schemesxcode_set_active_scheme - Switch active schemexcode_get_run_destinations - List simulators and devicesXCResult 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 resultsDiagnostics:
xcode_health_check - Environment validation and troubleshootingXcodeMCP provides comprehensive tools for analyzing Xcode test results (.xcresult files), making it easy to debug test failures and extract valuable information:
t=type, l=label, f=frame, c=children, j=index)# Browse test results
xcresult_browse "/path/to/TestResults.xcresult"
# Get console output to find failure timestamps
xcresult_browser_get_console "/path/to/TestResults.xcresult" "MyTest/testMethod()"
# Get UI hierarchy at specific timestamp (AI-readable slim version)
xcresult_get_ui_hierarchy "/path/to/TestResults.xcresult" "MyTest/testMethod()" 45.25
# Get full UI hierarchy (with size warning)
xcresult_get_ui_hierarchy "/path/to/TestResults.xcresult" "MyTest/testMethod()" 45.25 true
# Get detailed properties of a specific UI element
xcresult_get_ui_element "/path/to/ui_hierarchy_full.json" 15
# Extract screenshot at failure point
xcresult_get_screenshot "/path/to/TestResults.xcresult" "MyTest/testMethod()" 30.71
XcodeMCP supports configurable logging to help with debugging and monitoring:
LOG_LEVEL: Controls logging verbosity (default: INFO)
SILENT: No logging outputERROR: Only error messagesWARN: Warnings and errorsINFO: General operational information (recommended)DEBUG: Detailed diagnostic informationXCODEMCP_LOG_FILE: Optional file path for logging
/tmp/xcodemcp.log or ~/Library/Logs/xcodemcp.logXCODEMCP_CONSOLE_LOGGING: Enable/disable console output (default: true)
false to disable stderr logging (useful when using file logging only)Debug logging with file output:
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
"LOG_LEVEL": "DEBUG",
"XCODEMCP_LOG_FILE": "~/Library/Logs/xcodemcp.log"
}
}
}
}
Silent mode (no logging):
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
"LOG_LEVEL": "SILENT"
}
}
}
}
File-only logging:
{
"mcpServers": {
"xcodemcp": {
"command": "npx",
"args": ["-y", "xcodemcp@latest"],
"env": {
"LOG_LEVEL": "INFO",
"XCODEMCP_LOG_FILE": "/tmp/xcodemcp.log",
"XCODEMCP_CONSOLE_LOGGING": "false"
}
}
}
}
All logs are properly formatted with timestamps and log levels, and stderr output maintains compatibility with the MCP protocol.
If you see a warning that XCLogParser is not found even though it's installed:
Verify installation:
which xclogparser
xclogparser version
Common issues and solutions:
PATH issue: If which xclogparser returns nothing, add the installation directory to your PATH:
# For Homebrew on Intel Macs
export PATH="/usr/local/bin:$PATH"
# For Homebrew on Apple Silicon Macs
export PATH="/opt/homebrew/bin:$PATH"
Wrong command: Older documentation may reference xclogparser --version, but the correct command is xclogparser version (without dashes)
Permission issue: Ensure xclogparser is executable:
chmod +x $(which xclogparser)
Environment validation: Run the health check to get detailed diagnostics:
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "xcode_health_check", "arguments": {}}}' | npx xcodemcp
Note: XcodeMCP can operate without XCLogParser, but build error parsing will be limited.
Build with errors:
❌ BUILD FAILED (2 errors)
ERRORS:
• /path/HandsDownApp.swift:7:18: Expected 'func' keyword in instance method declaration
• /path/MenuBarManager.swift:98:13: Invalid redeclaration of 'toggleItem'
Health check:
✅ All systems operational
✅ OS: macOS environment detected
✅ XCODE: Xcode found at /Applications/Xcode.app (version 16.4)
✅ XCLOGPARSER: XCLogParser found (XCLogParser 0.2.41)
✅ OSASCRIPT: JavaScript for Automation (JXA) is available
✅ PERMISSIONS: Xcode automation permissions are working
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.