Skip to main content
Glama

Xcode Index MCP

by block
Apache 2.0
2
  • Apple

Xcode Index MCP

Gives Goose/Cursor access to your iOS/macOS project index through the Model Control Protocol (MCP) and IndexStoreDB. This provides exhaustive lists of function call sites to help your agent with refactoring and code navigation.

Example prompt

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

How to use

  1. Install uv (Python package manager) and run uv sync
    brew install uv cd /path/to/this/repo uv sync
  2. Build the Swift service (Xcode must be installed)
    cd swift-service swift build
    This step is required as it provides the interface to Xcode's index.
  3. Install in Agent of your choice

    Goose:

    Go to settings and add a custom extension. In the modal that pops up, under the command field, add this line:
    uv run /Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp
    Note: Replace <USERNAME> with your actual system username. The rest should look something like this:

    Cursor:

    Go to Settings > MCP > Add new global MCP server. Update mcp.json (typically located in your Cursor configuration directory) to look something like this:
    { "mcpServers": { "Xcode Index MCP": { "command": "uv", "args": ["run", "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp"] } } }
    Note: Replace <USERNAME> with your actual system username.
  4. Update .gooseHints or cursorRules in your project to tell your agent how to use the plugin. Replace the project name with the name of your project as it appears in the derived data folder.
    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, you may want to add these instructions in their own rule file - at the time of writing I don't think cursor reads the MCP instructions field.

Running tests

To run tests for Swift, cd into swift-service and run swift test.

How it works

The tool consists of two main components:

  1. An MCP server in the src directory that handles communication with Goose/Cursor
  2. A Swift service in the swift-service directory that interfaces with Xcode's index using Apple's IndexStoreDB package

When the MCP server calls 'load_index', the Swift service will look through Xcode's derived data directory for a project file. When found it will attempt to load the project's index. Queries are passed from the MCP server to the index through a subset of the methods provided in IndexStoreDB.

-
security - not tested
A
license - permissive license
-
quality - not tested

Gives Goose/Cursor access to your iOS/macOS project index through the Model Control Protocol (MCP) and IndexStoreDB. This provides exhaustive lists of function call sites to help your agent with refactoring and code navigation.

  1. Example prompt
    1. How to use
      1. Running tests
        1. How it works

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            A Goose MCP extension providing voice interaction with modern audio visualization, allowing users to communicate with Goose through speech rather than text.
            Last updated -
            36
            Python
            MIT License
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            An MCP server that enables interaction with Kubernetes/Minikube clusters through natural language, allowing AI agents like Codename Goose to manage Kubernetes resources via the Model Context Protocol.
            Last updated -
            Python
            MIT License
          • -
            security
            A
            license
            -
            quality
            An MCP server that enables web searches using a SearxNG instance, allowing MCP-compatible applications like Goose to perform internet searches.
            Last updated -
            Python
            GPL 3.0
          • -
            security
            F
            license
            -
            quality
            This MCP server allows users to create, manage, and serve web applications through Goose, storing apps in configurable directories and providing web app serving capabilities.
            Last updated -
            JavaScript
            • Linux
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/block/xcode-index-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server