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.
README
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
-
Install
uv(Python package manager) and runuv syncbrew install uv cd /path/to/this/repo uv sync -
Build the Swift service (Xcode must be installed)
cd swift-service swift buildThis step is required as it provides the interface to Xcode's index.
-
Install in Agent of your choice
Goose:
Go to settings and add a custom extension. In the modal that pops up, under the
commandfield, add this line:uv run /Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcpNote: Replace
<USERNAME>with your actual system username.The rest should look something like this:
<img src="goose-config-screenshot.png" width="400">
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. -
Update
.gooseHintsorcursorRulesin 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
instructionsfield.
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:
- An MCP server in the
srcdirectory that handles communication with Goose/Cursor - A Swift service in the
swift-servicedirectory that interfaces with Xcode's index using Apple'sIndexStoreDBpackage
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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.