Xcode MCP server

Integrates with Xcode to streamline iOS development workflows, automate build processes, and facilitate code generation for efficient app creation.
Back to servers
Provider
R Huijts
Release date
Jan 17, 2025
Language
TypeScript
Stats
267 stars

The Xcode MCP Server provides a bridge between Claude and your local Xcode development environment, enabling AI-assisted code creation, project management, and automated development tasks. All communication happens entirely on your machine, ensuring your code remains secure and private while allowing Claude to help with development tasks through well-defined interfaces.

Prerequisites

Before installing the Xcode MCP Server, ensure you have:

  • Node.js (v14 or later)
  • Xcode Command Line Tools
  • TypeScript
  • Claude Desktop with MCP support

Installation

Follow these steps to set up the Xcode MCP Server:

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 configuration to your Claude Desktop config file located at ~/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"
      }
    }
  }
}

Be sure to replace the paths with your actual installation and Xcode projects directory.

Using the Server

The Xcode MCP Server provides a natural interface for Claude to assist with your Xcode development. Here are some ways you can interact with it:

Project Navigation

Ask Claude to help you navigate your projects:

  • "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"

Code Creation & Modification

Get assistance with writing and modifying code:

  • "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"

Project Analysis & Building

Let Claude help with project analysis and build tasks:

  • "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?"

Troubleshooting

The server provides detailed logging through stderr. Here are solutions to common issues:

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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later