A Model Context Protocol (MCP) server that brings the power of AI to your Xcode projects. This server acts as a bridge between Claude and your local Xcode development environment, enabling intelligent code assistance, project management, and automated development tasks.
At its core, this server follows a client-server architecture where Claude can securely interact with your local Xcode projects:
flowchart LR
subgraph "Your Computer"
Claude["Claude Desktop"]
MCP["Xcode MCP Server"]
XP[("Xcode Projects")]
Claude <-->|"MCP Protocol\n(Commands & Results)"| MCP
MCP <-->|"Local Access\n(File & Build Operations)"| XP
end
The communication between the Xcode MCP server and your local projects happens entirely on your machine—your code is not exposed to the internet. The Model Context Protocol ensures that Claude can only perform approved operations through well-defined interfaces, giving you a secure way to let AI assist with your development while maintaining complete control.
- Automatically finds and connects to your active Xcode project
- Supports manual project selection for precise control
- Maintains workspace context across interactions
- Read and analyze Swift, Objective-C, and project configuration files
- Create and modify source files with proper syntax and imports
- Intelligent file listing with type filtering and search
- Access project targets, configurations, and schemes
- Analyze source files for potential issues
- Execute builds with specific configurations
- Run and manage test suites
Before you begin, ensure you have:
- Node.js (v14 or later)
- Xcode Command Line Tools
- TypeScript
- Claude Desktop with MCP support
-
Install the Server:
# Clone the repository git clone [repository-url] cd xcode-server # Install dependencies npm install # Build the project npm run build
-
Configure Claude Desktop: Add this to your Claude Desktop config file (
~/Library/Application Support/Claude/claude_desktop_config.json
):{ "mcpServers": { "xcode-server": { "command": "node", "args": [ "/path/to/xcode-server/build/index.js" ], "env": { "PROJECTS_BASE_DIR": "/path/to/your/xcode/projects" } } } }
Replace the paths with your actual installation and projects directory.
The server provides a natural interface for Claude to assist with your Xcode development. Here are some ways you can interact:
Ask Claude to:
- "Set my Xcode projects directory to
/Users/username/Documents/XcodeProjects
" - "What's my current active project?"
- "Switch to the MyApp.xcodeproj project"
- "Show me all Swift files in the project"
Get help with:
- "Create a new view called ProfileView with a preview provider"
- "Add a @Published email property to UserModel.swift"
- "Set up a modern async/await networking layer"
- "Implement Core Data models with SwiftUI bindings"
Let Claude assist with:
- "Analyze NetworkManager.swift for potential issues"
- "Build the project in Debug configuration"
- "Run the unit tests for the UserModel module"
- "What build schemes are available?"
npm run build
npm test
The server provides detailed logging through stderr. Common issues and their solutions:
-
Project Detection Issues
- Verify your projects directory path
- Ensure Xcode Command Line Tools are installed
- Check file permissions
-
Build Problems
- Validate Xcode installation
- Check project configurations
- Review build settings
We welcome contributions! Whether it's:
- 🐛 Bug fixes
- ✨ New features
- 📚 Documentation improvements
- 🧪 Additional tests
Feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.