Xcode Index MCP server

Provides direct access to Xcode's project index store through Apple's IndexStoreDB, enabling precise code navigation and refactoring operations on iOS/macOS projects with tools for loading project indexes, finding symbol occurrences, retrieving symbol references, and pattern-based symbol searching.
Back to servers
Setup instructions
Provider
Block, Inc.
Release date
Jun 06, 2025
Stats
15 stars

Xcode Index MCP allows AI assistants like Goose or Cursor to access your iOS/macOS project index through the Model Control Protocol. This powerful integration provides comprehensive listings of function call sites, making it invaluable for refactoring tasks and navigating through your codebase.

Installation

Follow these steps to set up the Xcode Index MCP server:

Prerequisites

  • Xcode must be installed
  • Homebrew (for installing uv)

Setup Steps

  1. Install uv (Python package manager) and synchronize dependencies:
brew install uv
cd /path/to/this/repo
uv sync
  1. Build the Swift service:
cd swift-service
swift build

This step is essential as it builds the interface that communicates with Xcode's index.

Integration With AI Assistants

Goose Integration

  1. Open Goose settings and add a custom extension
  2. In the command field, enter:
uv run /Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp

Replace <USERNAME> with your actual system username.

Cursor Integration

  1. Navigate to Settings > MCP > Add new global MCP server
  2. Update your mcp.json configuration with:
{
    "mcpServers": {
        "Xcode Index MCP": {
            "command": "uv",
            "args": ["run", "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp"]
        }
    }
}

Replace <USERNAME> with your actual system username.

Usage Configuration

Add instructions to your project's configuration file to tell your AI assistant how to use the plugin:

For Goose

Add to your .gooseHints file:

Use tool `xcode-index-mcp` if available. Use project name <Your project name here>. The tool can locate call sites of functions, and function definitions from call sites. If you need a filepath to make a request, use `rg` to find the file and `rg -n` to find the line number. Use the absolute path when requesting symbols from a file.

For Cursor

Add similar instructions to your cursorRules file, specifying your project name as it appears in the derived data folder.

Example Usage

You can ask your AI assistant to perform tasks like:

"Remove myParameter from the initializer on line 48 of MyViewController.swift. Use the Xcode Index MCP to ensure all references are updated."

The plugin will help identify all call sites that need to be updated when making such changes.

How It Works

The tool operates through two main components:

  1. An MCP server that handles communication with your AI assistant
  2. A Swift service that interfaces with Xcode's index using Apple's IndexStoreDB package

When you request to load an index, the Swift service searches Xcode's derived data directory for your project and loads its index. This allows queries to be passed from the MCP server to the index through methods provided by IndexStoreDB.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "Xcode-Index-MCP" '{"command":"uv","args":["run","/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp"]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

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

{
    "mcpServers": {
        "Xcode Index MCP": {
            "command": "uv",
            "args": [
                "run",
                "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "Xcode Index MCP": {
            "command": "uv",
            "args": [
                "run",
                "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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