A comprehensive Model Context Protocol (MCP) server for Xcode development automation, providing 115+ tools for project management, building, testing, simulator control, crash reporting, asset management, localization, and AI-powered workflows.
- 112 Direct Xcode Tools - Fast, single-step operations for common tasks
- 3 LangGraph Subagentic Tools - Multi-step workflows with reasoning and state management
- 21 New Tools - Crash reporting, asset management, localization, and simulator enhancements
- Unified Server - Single MCP server combining all capabilities
- Token Optimized - 30-40% token reduction through caching and compression
- Hyper-Specific Schemas - Comprehensive JSON schemas with examples and validation
- Persona System - Configurable agent personas for different use cases
- Quick Start
- Installation
- Configuration
- Usage
- Tools Reference
- Architecture
- Personas
- Troubleshooting
- Development
- macOS (for Xcode tools)
- Python 3.11+
- Conda (recommended) or pip
- Xcode Command Line Tools
# Clone the repository
git clone <repository-url>
cd xcode-mcp
# Create conda environment
conda env create -f environment.yml
conda activate xcode-mcp
# Or use pip
pip install -r requirements.txtAdd to ~/.cursor/mcp.json:
{
"mcpServers": {
"xcode-mcp": {
"command": "/path/to/miniconda3/envs/xcode-mcp/bin/python",
"args": [
"/path/to/xcode-mcp/run_unified_mcp.py"
],
"env": {
"DEEPSEEK_API_KEY": "your-api-key-here"
}
}
}
}Restart Cursor to load the MCP server.
./setup.shThis script will:
- Create conda environment
- Install dependencies
- Verify installation
- Test the server
# Create conda environment
conda env create -f environment.yml
conda activate xcode-mcp
# Verify installation
python -c "from src.unified_mcp_server import UnifiedMCPServer; print('β
Installation successful')"Core dependencies:
fastapi- HTTP server (optional)pydantic- Data validationlanggraph- Subagentic workflows (optional)langchain- LLM integration (optional)
See environment.yml for complete list.
# LLM Provider API Keys
export DEEPSEEK_API_KEY="your-deepseek-key"
export OPENAI_API_KEY="your-openai-key" # Optional
# Model Selection
export DEFAULT_MODEL="ollama:qwen3-coder:30b" # or "deepseek:deepseek-coder"The server is configured via ~/.cursor/mcp.json. Use absolute paths for reliability:
{
"mcpServers": {
"xcode-mcp": {
"command": "/Users/username/miniconda3/envs/xcode-mcp/bin/python",
"args": ["/Users/username/Projects/xcode-mcp/run_unified_mcp.py"],
"env": {
"DEEPSEEK_API_KEY": "your-key"
}
}
}
}Use direct tools for simple, single-step operations:
Use the list_projects tool
Use the build_project tool with scheme "MyApp"
Use the run_tests tool
Use LangGraph tools for complex, multi-step workflows:
Use langgraph_agent with prompt "Set up my development environment"
Use langgraph_workflow with workflow "Build, test, and generate report"
Apply personas for specialized behavior:
{
"name": "langgraph_agent",
"arguments": {
"prompt": "Help me optimize my build",
"persona": {
"id": "build-optimizer",
"role": "optimizer"
}
}
}- Crash Reporting (4 tools):
symbolicate_crash_log,analyze_crash_log,get_crash_reports,export_crash_log - Asset Management (5 tools):
optimize_images,generate_app_icons,validate_asset_catalog,check_asset_sizes,manage_color_assets - Simulator Enhancements (5 tools):
set_simulator_location,get_simulator_logs,list_simulator_apps,simulate_network_conditions,clone_simulator - Localization (4 tools):
extract_strings,validate_localizations,check_localization_coverage,list_localizations - Build Enhancements (3 tools):
set_build_number,set_version,analyze_build_time
list_projects- List all Xcode projectscreate_project- Create new Xcode projectopen_project- Open project in Xcodelist_schemes- List available build schemesswitch_scheme- Change active scheme
build_project- Build a projectbuild_workspace- Build a workspaceclean_build- Clean build artifactsarchive_project- Create archiveanalyze_build- Analyze build performance
run_tests- Run unit testsrun_ui_tests- Run UI testsgenerate_test_report- Generate test reportcode_coverage_report- Get coverage report
list_devices- List available simulatorsboot_simulator- Boot a simulatorinstall_app- Install app on devicelaunch_app- Launch app
get_llm_status- Check LLM service statusconfigure_llm- Configure LLM provider
See schemas/xcode-mcp-tools.json for complete list.
Subagentic agent for complex workflows with reasoning and state management.
Parameters:
prompt(required) - Natural language task descriptionmodel(optional) - Model override (e.g., "ollama:qwen3-coder:30b")persona(optional) - Persona configuration
Example:
Use langgraph_agent with prompt "Verify my development environment and list all projects"
Execute multi-step workflows with automatic tool orchestration.
Parameters:
workflow(required) - Workflow descriptioncontext(optional) - Additional contextpersona(optional) - Persona configuration
Example:
Use langgraph_workflow with workflow "1. Clean build 2. Build project 3. Run tests 4. Generate report"
Get status of LangGraph agent and available capabilities.
The project uses a unified MCP server (src/unified_mcp_server.py) that combines:
- Direct Tools - 94 tools from
src/xcode_tools/ - LangGraph Tools - 3 subagentic tools using LangGraph
- Optimization Layer - Caching, compression, schema optimization
xcode-mcp/
βββ src/
β βββ unified_mcp_server.py # Main unified server
β βββ tool_registry.py # Tool registration system
β βββ langgraph_agent.py # LangGraph agent implementation
β βββ llm_service.py # LLM provider abstraction
β βββ xcode_tools/ # Tool implementations
β βββ project.py # Project management
β βββ build.py # Build operations
β βββ testing.py # Testing tools
β βββ simulator.py # Simulator control
β βββ ...
βββ schemas/
β βββ xcode-mcp-tools.json # Tool schema definitions
β βββ persona_schemas.json # Persona schema
β βββ persona_examples.json # Pre-configured personas
βββ tests/
β βββ test_unified_server.py # Comprehensive test suite
βββ docs/ # Additional documentation
βββ examples/ # Usage examples
βββ run_unified_mcp.py # Server entry point
βββ environment.yml # Conda dependencies
Tools are automatically registered from:
- JSON schema (
schemas/xcode-mcp-tools.json) - Python implementations (
src/xcode_tools/) - Dynamic discovery and mapping
LangGraph tools use the direct tools internally:
- Agent receives natural language prompt
- Breaks down into steps
- Calls appropriate direct tools
- Maintains state across steps
- Returns comprehensive result
Personas provide specialized agent behavior for different use cases.
- Role: Architect
- Expertise: Swift, Xcode, Architecture, iOS, Performance
- Style: Professional, Detailed, Expert-level
- Use for: Architecture decisions, best practices, design patterns
- Role: Mentor
- Expertise: Swift, Xcode, iOS, SwiftUI
- Style: Friendly, Comprehensive, Intermediate-level
- Use for: Learning, education, step-by-step guidance
- Role: Optimizer
- Expertise: Xcode, Performance, CI/CD
- Style: Concise, Moderate, Advanced-level
- Use for: Build performance, optimization, CI/CD
- Role: Tester
- Expertise: Testing, Xcode, Swift, CI/CD
- Style: Professional, Detailed, Advanced-level
- Use for: Test strategies, coverage, quality
{
"persona": {
"id": "build-optimizer",
"role": "optimizer",
"expertise": ["xcode", "performance"],
"communication_style": {
"tone": "concise",
"verbosity": "moderate",
"technical_level": "advanced"
}
}
}See schemas/persona_examples.json for complete examples.
-
Verify Configuration
python3 -m json.tool ~/.cursor/mcp.json -
Test Server Manually
python test_mcp_connection.py
-
Kill Stale Processes
pkill -f "run_unified_mcp.py" -
Restart Cursor
- Quit completely (Cmd+Q)
- Wait 5 seconds
- Reopen Cursor
-
Use Absolute Python Path Update
~/.cursor/mcp.jsonto use absolute path:"command": "/path/to/miniconda3/envs/xcode-mcp/bin/python"
- Check server is GREEN in Cursor
- Verify tools list:
python -c "from src.unified_mcp_server import UnifiedMCPServer; s = UnifiedMCPServer(); print(len(s.registry.tools))" - Restart Cursor
-
Verify installation:
conda activate xcode-mcp python -c "import langgraph; print('β LangGraph installed')" -
Install if missing:
pip install langgraph langchain langchain-core langchain-openai langchain-ollama
-
Check Xcode CLI tools:
xcodebuild -version
-
Verify permissions for Xcode operations
-
Check tool-specific requirements in
schemas/xcode-mcp-tools.json
# Comprehensive tests
python tests/test_unified_server.py
# Connection test
python test_mcp_connection.py- β 8/8 tests passing
- β 97 tools available
- β All protocols working
- β Server responds correctly
-
Add to Schema (
schemas/xcode-mcp-tools.json):{ "name": "my_new_tool", "description": "Tool description", "parameters": [...] } -
Implement Function (
src/xcode_tools/):def my_new_tool(param1: str, param2: int) -> dict: # Implementation return {"result": "..."}
-
Test:
python -c "from src.tool_registry import get_registry; r = get_registry(); print(r.execute_tool('my_new_tool', param1='test', param2=1))"
- Core Server:
src/unified_mcp_server.py - Tool Registry:
src/tool_registry.py - Tool Implementations:
src/xcode_tools/ - Schemas:
schemas/ - Tests:
tests/ - Documentation:
docs/
- Schema Caching: 5-minute TTL
- Response Caching: Successful responses cached
- Compact JSON: Reduced token usage
- Lazy Loading: LangGraph loaded only when needed
- Token Reduction: 30-40% through optimization
- Memory Usage: 50% reduction (unified server)
- Response Time: 50% faster (cached responses)
- Schema Loading: 80% faster (cached)
- Tool Schema:
schemas/xcode-mcp-tools.json - Persona Schema:
schemas/persona_schemas.json - Persona Examples:
schemas/persona_examples.json - Examples:
examples/
- Follow existing code structure
- Add tests for new features
- Update schemas and documentation
- Run test suite before submitting
[Add your license here]
To expose the MCP server to other devices on your network:
# Start network server (default: port 8000)
python run_network_server.py
# With custom settings
MCP_HOST=0.0.0.0 MCP_PORT=8000 python run_network_server.py
# With authentication
MCP_API_KEY=your-secret-key MCP_REQUIRE_AUTH=true python run_network_server.pyEndpoints:
- HTTP:
http://YOUR_IP:8000/mcp - WebSocket:
ws://YOUR_IP:8000/ws - Tools List:
http://YOUR_IP:8000/tools - Health:
http://YOUR_IP:8000/health
See docs/NETWORK_SETUP.md for complete network setup guide, including:
- Configuration options
- Authentication setup
- Client examples (Python, JavaScript, curl)
- Security considerations
- Production deployment
- Model Context Protocol specification
- LangGraph for subagentic workflows
- Xcode Command Line Tools
Version: 2.1.0
Last Updated: 2025-01-XX
Maintainer: Eddikson PeΓ±a
- Symbolicate and analyze crash logs
- Extract crash information automatically
- Export crash reports
- Optimize images automatically
- Generate app icon sets
- Validate asset catalogs
- Check asset sizes
- Set GPS location
- Get simulator logs
- List installed apps
- Clone simulators
- Extract localizable strings
- Validate translations
- Check coverage percentage
- List supported locales
- Set specific build/version numbers
- Analyze build times
- Enhanced version management
See DEPLOYMENT_SUMMARY.md for complete details.