XcodeMCP server provides programmatic control over Xcode operations through JavaScript for Automation (JXA). It enables:
- Project Management: Open projects/workspaces, get workspace information, list projects, manage schemes
- Build Operations: Build projects, clean artifacts, parse errors (integrates with XCLogParser)
- Testing & Execution: Run tests with optional arguments, execute projects
- Debugging: Start and control debugging sessions
- Navigation: Open specific files with optional line number targeting
- Environment: Perform health checks, validate configuration
- Process Control: Stop operations or pause execution
The server exposes these capabilities through various API endpoints that can be used for automation workflows.
Runs on macOS to interface with Xcode, allowing for interaction with Xcode projects, workspaces, schemes, and simulators within the macOS environment.
Provides tools for Xcode build automation and log parsing, enabling opening projects, triggering builds directly in Xcode, cleaning build artifacts, running tests, debugging, switching between schemes, and extracting build errors and warnings.
XcodeMCP
Model Context Protocol (MCP) server that controls Xcode directly through JavaScript for Automation (JXA).
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
Requirements
- macOS with Xcode installed
- Node.js 18+
- XCLogParser (recommended):
brew install xclogparser
Usage
Quick Install
XCLogParser is recommended but optional:
Install from npm
Run directly with npx:
Or install globally:
MCP Configuration
Add to your MCP configuration:
Claude Code CLI Setup
To add XcodeMCP to Claude Code using the command line:
Development Setup
For local development:
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_run
- 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
Diagnostics:
xcode_health_check
- Environment validation and troubleshooting
Configuration
Logging Configuration
XcodeMCP supports configurable logging to help with debugging and monitoring:
Environment Variables
LOG_LEVEL
: Controls logging verbosity (default:INFO
)SILENT
: No logging outputERROR
: Only error messagesWARN
: Warnings and errorsINFO
: General operational information (recommended)DEBUG
: Detailed diagnostic information
XCODEMCP_LOG_FILE
: Optional file path for logging- Logs are written to the specified file in addition to stderr
- Parent directories are created automatically
- Example:
/tmp/xcodemcp.log
or~/Library/Logs/xcodemcp.log
XCODEMCP_CONSOLE_LOGGING
: Enable/disable console output (default:true
)- Set to
false
to disable stderr logging (useful when using file logging only)
- Set to
Examples
Debug logging with file output:
Silent mode (no logging):
File-only logging:
All logs are properly formatted with timestamps and log levels, and stderr output maintains compatibility with the MCP protocol.
Troubleshooting
XCLogParser Not Found
If you see a warning that XCLogParser is not found even though it's installed:
- Verify installation:
- Common issues and solutions:
- PATH issue: If
which xclogparser
returns nothing, add the installation directory to your PATH: - Wrong command: Older documentation may reference
xclogparser --version
, but the correct command isxclogparser version
(without dashes) - Permission issue: Ensure xclogparser is executable:
- PATH issue: If
- Environment validation: Run the health check to get detailed diagnostics:
Note: XcodeMCP can operate without XCLogParser, but build error parsing will be limited.
Example Output
Build with errors:
Health check:
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
MCP server for Xcode build automation and log parsing that opens Xcode projects, triggers builds directly in Xcode, and parses build logs to extract errors and warnings.
Related MCP Servers
- AsecurityAlicenseAqualityMCP server for collecting code from files and directories into a single markdown document.Last updated -24PythonMIT License
- AsecurityAlicenseAqualityAn MCP server that provides access to project files and their contents, allowing users to retrieve file data from specified project directories with error handling and configuration options.Last updated -14TypeScriptMIT License
- -securityFlicense-qualityThis is an MCP server that facilitates building tools for interacting with various APIs and workflows, supporting Python-based development with potential for customizable prompts and user configurations.Last updated -Python
- -securityAlicense-qualityAn MCP server that assists with the orchestration of new software projects by applying standardized templates and best practices in design patterns and software architecture.Last updated -3PythonMIT License