The MCP Xcode server enables AI assistants and development tools to comprehensively manage, build, test, and debug Apple platform projects directly through automated workflows.
Project Management: Build, run, test, archive, and export Xcode projects and Swift packages across all Apple platforms (iOS, macOS, tvOS, watchOS, visionOS)
Simulator Control: List, boot, shutdown simulators, capture screenshots, and manage installed apps
Project Information: Retrieve schemes, targets, build settings, and comprehensive project details
Dependency Management: Resolve, update, add, or remove Swift Package Manager dependencies
File Management: Programmatically add/remove files from Xcode projects with safety checks
SwiftUI Previews: Generate previews of SwiftUI views in specified devices and color schemes
Testing: Execute unit and integration tests with filtering options, supporting both XCTest and Swift Testing frameworks
Build Maintenance: Clean build artifacts, DerivedData, and test results
Debugging Tools: Retrieve and filter device logs with detailed error handling
Automation: Auto-add new Swift files to Xcode projects via Claude Code hooks for streamlined development workflows
Provides tvOS development support through Apple TV simulator integration, enabling building, testing, and running tvOS applications with simulator management capabilities.
Supports building, testing, and running iOS applications with iOS Simulator integration, including app installation/uninstallation, simulator management, screen capture, and device log retrieval for iOS development.
Enables native macOS application development with direct build and test execution on the host machine, supporting macOS-specific project configurations and testing workflows.
Enables management of Swift Package Manager modules and dependencies, including testing SPM packages across all Apple platforms and adding/removing Swift package dependencies from projects.
Provides comprehensive control over Xcode projects and workspaces, enabling building, testing, running, and managing Apple platform applications across iOS, macOS, tvOS, watchOS, and visionOS. Includes project modification, dependency management, archiving, and IPA export capabilities.
MCP Xcode Server
A Model Context Protocol (MCP) server that enables AI assistants to build, test, run, and manage Apple platform projects through natural language interactions.
Version: 0.6.0
Purpose
This MCP server bridges the gap between AI assistants and Apple's development ecosystem. It allows AI tools like Claude to directly execute Xcode and Swift Package Manager commands, enabling automated development workflows without manual intervention. The server is designed for token efficiency, providing concise output while maintaining comprehensive error reporting and debugging capabilities.
Why Use MCP Xcode Server?
Key Advantages
- AI-Native Development: Enables AI assistants to build, test, and run iOS/macOS apps directly
- Token Efficiency: Optimized output shows only essential information (errors, warnings, test results)
- Smart Error Handling: Parses build errors and provides actionable suggestions
- Visual Debugging: Capture simulator screenshots to verify UI changes
- Automatic Simulator Management: Intelligently reuses running simulators to save time
- Xcode Integration: Auto-syncs file operations with Xcode projects via hooks
- Persistent Logging: All operations saved to
~/.mcp-xcode-server/logs/
for debugging - Multi-Platform: Supports iOS, macOS, tvOS, watchOS, and visionOS from a single interface
Use Cases
- Automated Testing: AI can run your test suites and analyze failures
- Build Verification: Quickly verify code changes compile across platforms
- UI Development: Build and screenshot apps to verify visual changes
- Dependency Management: Add, update, or remove Swift packages programmatically
- Cross-Platform Development: Test the same code on multiple Apple platforms
- CI/CD Integration: Automate build and test workflows through natural language
Limitations
What It Can't Do
- No SwiftUI Previews: Xcode's live preview requires the full IDE
- No Interactive UI Testing: Cannot simulate user interactions (taps, swipes)
- No Physical Devices: Simulator-only for iOS/tvOS/watchOS/visionOS
- No Debugging: No breakpoints, step-through debugging, or LLDB access
- No Xcode UI Features: Project configuration, storyboard editing require Xcode
- Platform Requirements: Requires macOS 14+, Xcode 16+, iOS 17+ simulators
When You Still Need Xcode
- Designing UI with Interface Builder or SwiftUI previews
- Debugging with breakpoints and variable inspection
- Profiling with Instruments
- Managing certificates and provisioning profiles
- Testing on physical devices
- Using Xcode-specific features (Playgrounds, AR tools, etc.)
Core Features
Build & Test Automation
- Build and run Xcode projects/workspaces
- Execute Swift Package Manager packages
- Run XCTest and Swift Testing suites
- Xcode projects: Support for custom build configurations (Debug, Release, Beta, Staging, etc.)
- Swift packages: Standard SPM configurations (Debug/Release only - SPM limitation)
Simulator Management
- List and boot simulators for any Apple platform
- Capture screenshots for visual verification
- Install/uninstall apps
- Retrieve device logs with filtering
Error Intelligence
- Compile Errors: Shows file, line, column with error message
- Scheme Errors: Suggests using
list_schemes
tool - Code Signing: Identifies certificate and provisioning issues
- Dependencies: Detects missing modules and version conflicts
File Sync Hooks
- Automatically syncs file operations with Xcode projects
- Intelligently assigns files to correct build phases (Sources, Resources, etc.)
- Respects
.no-xcode-sync
opt-out files - Maintains proper group structure in Xcode
Installation
Prerequisites
- macOS 14.0 or later
- Xcode 16.0 or later
- Node.js 18+
- Xcode Command Line Tools
- Simulators for target platforms
Quick Setup
The setup wizard will:
- Configure the MCP server for Claude
- Optionally set up Xcode sync hooks
- Build necessary helper tools
Manual Configuration
Add to ~/.claude.json
(global) or .claude/settings.json
(project):
Available Tools
Building
build_xcode
: Build Xcode projects/workspaces (supports custom configurations)build_swift_package
: Build Swift packages (Debug/Release only per SPM spec)run_xcode
: Build and run on simulator/macOSrun_swift_package
: Execute Swift package executables
Testing
test_xcode
: Run XCTest/Swift Testing suitestest_swift_package
: Test Swift packages- Supports test filtering by class/method
Project Information
list_schemes
: Get available Xcode schemesget_project_info
: Comprehensive project detailslist_targets
: List all build targetsget_build_settings
: Get scheme configuration
Simulator Management
list_simulators
: Show available devicesboot_simulator
: Start a simulatorshutdown_simulator
: Stop a simulatorview_simulator_screen
: Capture screenshot
App Management
install_app
: Install app on simulatoruninstall_app
: Remove app by bundle IDget_device_logs
: Retrieve filtered device logs
Distribution
archive_project
: Create .xcarchiveexport_ipa
: Export IPA from archive
Maintenance
clean_build
: Clean build artifacts/DerivedDatamanage_dependencies
: Add/remove/update Swift packages
Platform Support
Platform | Simulator Required | Default Device | Min Version |
---|---|---|---|
iOS | Yes | iPhone 16 Pro | iOS 17+ |
macOS | No | Host machine | macOS 14+ |
tvOS | Yes | Apple TV | tvOS 17+ |
watchOS | Yes | Apple Watch Series 10 | watchOS 10+ |
visionOS | Yes | Apple Vision Pro | visionOS 1.0+ |
Architecture
The server follows SOLID principles with a modular, class-based architecture:
Core Structure
Key Design Principles
- Single Responsibility: Each class has one clear purpose
- Dependency Injection: Testable, mockable components
- Type Safety: Full TypeScript with Zod validation
- Security First: Path validation, command injection protection
- Error Recovery: Graceful handling with helpful suggestions
Logging
All operations are logged to ~/.mcp-xcode-server/logs/
:
- Daily folders (e.g.,
2025-01-27/
) - 7-day automatic retention
- Full xcodebuild/swift output preserved
- Symlinks to latest logs for easy access
Development
Contributing
Contributions welcome! Please ensure:
- Tests pass (
npm test
) - Code follows SOLID principles
- New tools include tests
- Documentation updated
License
MIT
Support
- Report issues: GitHub Issues
- Documentation: MCP Protocol
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
Enables AI assistants to build, test, run, and manage Apple platform projects (iOS, macOS, tvOS, watchOS, visionOS) directly through Xcode. Provides comprehensive control over Xcode projects, Swift packages, simulators, and development workflows without leaving your editor.
Related MCP Servers
- -securityAlicense-qualityProvides code manipulation, execution, and version control capabilities. It allows AI assistants to read, write, and execute code while maintaining a history of changes.Last updated -9MIT License
- AsecurityAlicenseAqualityBridges Claude AI with Xcode, enabling AI-powered code assistance, project management, and automated development tasks securely on your local machine.Last updated -13314MIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to build and test Xcode projects directly through a standardized interface, with capabilities for running tests, monitoring progress, and accessing logs in real-time.Last updated -181346
- -securityAlicense-qualityConnects to Xcode's build system to extract, parse, and display errors and warnings from your Swift projects, helping AI assistants quickly identify code issues without manually searching through build logs.Last updated -5MIT License