xcode-mcp-server
by: r-huijts
MCP Server implementation for Xcode integration
📌Overview
Purpose: The Xcode MCP Server serves as a bridge between AI capabilities and the Xcode development environment, facilitating intelligent assistance for code and project management.
Overview: The Xcode MCP Server follows a client-server architecture, enabling Claude to interact securely with local Xcode projects without exposing code to the internet. It allows for seamless integration of AI-driven tools within a secure workflow.
Key Features:
-
Intelligent Project Detection: Automatically connects to active Xcode projects and maintains workspace context, ensuring a smooth user experience.
-
Smart File Operations: Allows for reading and modifying various programming files while providing intelligent listing and search capabilities.
-
Project Management: Grants access to project configurations and schemes, enables analysis of source files, and supports building and testing functionality.
Xcode MCP Server
A Model Context Protocol (MCP) server that integrates AI into your Xcode projects. This server acts as a bridge between Claude and your local Xcode development environment, providing intelligent code assistance, project management, and automated development tasks.
What is Xcode MCP Server?
The Xcode MCP server follows a client-server architecture, allowing Claude to securely interact with your local Xcode projects. Communication occurs entirely on your machine, ensuring that your code remains private while allowing Claude to perform approved operations through defined interfaces.
Key Features
🔍 Intelligent Project Detection
- Automatically detects and connects to your active Xcode project.
- Supports manual project selection for control.
- Maintains workspace context across interactions.
📁 Smart File Operations
- Reads and analyzes Swift, Objective-C, and project configuration files.
- Creates and modifies source files with proper syntax.
- Provides intelligent file listing with type filtering.
🛠 Project Management
- Accesses project targets, configurations, and schemes.
- Analyzes source files for potential issues.
- Executes builds with specific configurations.
- Manages test suites.
Getting Started
Prerequisites
Ensure you have the following before you begin:
- Node.js (v14 or later)
- Xcode Command Line Tools
- TypeScript
- Claude Desktop with MCP support
Quick Setup
-
Install the Server:
git clone [repository-url] cd xcode-server npm install npm run build
-
Configure Claude Desktop: Add the following configuration to your Claude Desktop config file:
{ "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 installation and projects directory.
Working with the Server
Project Navigation
Interact with Claude to:
- Set your Xcode projects directory.
- Check your current active project.
- Switch projects or list files.
Code Creation & Modification
Request help with:
- Creating new views or properties.
- Setting up networking layers.
- Implementing models with bindings.
Project Analysis & Building
Let Claude assist with:
- Analyzing files for issues.
- Building the project or running tests.
- Retrieving available build schemes.
Development and Debugging
Building the Project
npm run build
Running Tests
npm test
Troubleshooting
Common issues include:
- Project Detection Issues: Verify your projects directory path and ensure that Xcode Command Line Tools are installed.
- Build Problems: Validate your Xcode installation and check project configurations.
Contributing
Contributions are welcome! This can include:
- Bug fixes
- New features
- Documentation improvements
- Additional tests
Feel free to submit a Pull Request.
License
This project is licensed under the MIT License.