home / mcp / mcp xcode server

MCP Xcode Server

Provides Xcode project tools to read, inspect, build, test, and modify Xcode projects via MCP

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "chacebot-mcp-xcode-server": {
      "command": "node",
      "args": [
        "/absolute/path/to/mcp-xcode-server/src/index.js"
      ]
    }
  }
}

You have an MCP server that exposes a set of tools to interact with Xcode projects programmatically. It lets you read project files, list schemes and targets, modify targets, build and test projects, and manage build settings and artifacts from an MCP-enabled client or assistant.

How to use

Configure your MCP client to load this server as a local STDIO endpoint. You will run the server locally and connect your MCP client to it so you can invoke the Xcode project tools through natural language commands and structured requests. The supported tools enable reading project structure, listing schemes and targets, adding a test target, adding files to targets, building, testing, retrieving build settings, and cleaning build artifacts.

How to install

Prerequisites you need installed on your machine before you start:

  • Node.js 18+
  • Xcode command-line tools
  • Access to Xcode projects

Step by step setup to run the MCP Xcode Server locally:

# 1. Install dependencies for the MCP server
npm install

# 2. Start the MCP server locally (standalone testing)
npm start

# 3. Configure your MCP client to connect to the local stdio server
# Example client config will reference the stdio interface and the runtime command shown in the server setup

Usage notes

To use the server with an MCP client, load a configuration that points to the stdio command you run to start the server. You will pass the required arguments to access each Xcode tool, such as reading a project, listing schemes, or performing a build. When you start the server, it communicates over stdio using the MCP protocol, enabling you to invoke the available Xcode tools from your AI assistant or CLI client.

Configuration and tools overview

The server includes the following tools for Xcode project management:

Security and best practices

Ensure you run the server in a secure, trusted environment. Only expose it to clients you control, and avoid handling sensitive credentials through logs or plain text environment variables. Keep Xcode and its command-line tools up to date to avoid compatibility issues with project formats and pbxproj parsing.

Troubleshooting

If you encounter issues reading a project or manipulating pbxproj files, verify the Xcode command-line tools are installed and accessible from your shell. Check that the target paths and project paths you pass to tools are correct and that you have the necessary permissions to modify the project files.

Notes

This server includes functions to read project structure, list schemes and targets, add test targets, add files to targets, build, test, get build settings, and clean build artifacts. Some operations that modify pbxproj files require careful parsing and validation, so expect incremental improvements and follow best practices when integrating with automated workflows.

Available tools

xcode_read_project

Read and parse an Xcode project file to extract its structure.

xcode_list_schemes

List all build schemes available in the project.

xcode_list_targets

List all targets in the project.

xcode_add_test_target

Add a new test target to the project. Note: this currently provides instructions rather than direct modification of the pbxproj file.

xcode_add_file_to_target

Add a file to a specific target in the project.

xcode_build

Build the Xcode project using xcodebuild.

xcode_test

Run tests in the Xcode project.

xcode_get_build_settings

Get build settings for the project or a specific scheme.

xcode_clean

Clean build artifacts from the project.