Xcode Index MCP
Gives access to iOS project indexes, allowing AI agents to perform intelligent refactoring and code navigation across iOS codebases.
Provides access to macOS project indexes, enabling AI agents to find function references and perform accurate code modifications across macOS applications.
Interfaces with Swift codebases through IndexStoreDB, helping with refactoring tasks by locating all references to functions and their definitions.
Provides access to Xcode's project index through IndexStoreDB, enabling comprehensive code navigation and refactoring by identifying function call sites and definitions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Xcode Index MCP find all call sites for the updateUI method in my project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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."
Related MCP server: Xcode Errors MCP Server
How to use
Install
uv(Python package manager) and runuv syncbrew install uv cd /path/to/this/repo uv syncBuild 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:/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcpNote: Replace
<USERNAME>with your actual system username, or with the correct path xcode-index-mcp on your machine.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": "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp" } } }Note: Replace
<USERNAME>with your actual system username, or with the correct path xcode-index-mcp on your machine.Claude Code:
Run this command in the terminal to add the mcp to Claude Code
claude mcp add xcode-index-mcp -- /Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcpNote: Replace
<USERNAME>with your actual system username, or with the correct path xcode-index-mcp on your machine.Update
.gooseHints,cursorRules, orCLAUDE.MDin 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/CursorA 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.
Available Tools
4 toolsget_occurrencesB
Get all occurrences of a symbol by its USR.
Args: usr: The USR (Unified Symbol Resolution) of the symbol roles: The roles to search for (must be "reference" or "definition")
Returns: Dict containing all occurrences of the symbol
Inputs: usr (required), roles (required). Returns: result
load_indexB
Load the IndexStore for a project from the Derived Data folder.
Args: projectName: Name of the project to load the index for.
Returns: bool: True if the index was loaded successfully, False otherwise.
Inputs: projectName (required). Returns: result
search_patternB
Search for symbol occurrences matching a pattern.
Args: pattern: The pattern to search for options: Optional list of search options. Valid options are: - anchorStart: Match pattern at start of symbol name - anchorEnd: Match pattern at end of symbol name - subsequence: Match pattern as subsequence (not exact match) - ignoreCase: Case-insensitive matching
Returns: Dict containing matching canonical symbol occurrences
Inputs: pattern (required), options. Returns: result
symbol_occurrencesC
Get symbols occurring at a specific location in a file.
Args: filePath: Absolute path to the file lineNumber: Line number in the file
Returns: Dict containing symbol information at the specified location
Inputs: filePath (required), lineNumber (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
The tools have distinct primary purposes: loading an index, searching by pattern, retrieving by USR, and looking up by file location. However, get_occurrences and symbol_occurrences could be slightly confused as both retrieve symbol occurrences, though they use different input parameters (USR vs. file location).
All tool names follow a consistent snake_case verb_noun pattern (e.g., load_index, search_pattern, get_occurrences, symbol_occurrences). The naming is predictable and readable throughout the set.
With 4 tools, the count is reasonable for an index query server, covering core operations like loading, searching, and retrieving symbols. It might be slightly thin if advanced features like filtering or batch operations are needed, but it's well-scoped for basic functionality.
The tools cover key index operations: loading, pattern search, and symbol retrieval by USR or location. However, there are notable gaps, such as no ability to update or delete index data, list available projects, or handle errors more granularly, which could limit agent workflows in complex scenarios.
Maintenance
Related MCP Connectors
Build, test and cache insights for Xcode, Gradle and Bazel projects, for coding agents.
Coding agents in multi-service codebases routinely rebuild existing helpers, trust stale type definitions, and modify API contracts without knowing who consumes them. Carrick solves this by indexing your entire TypeScript ecosystem across service and repository boundaries. By integrating deeply with the TypeScript compiler, Carrick traces every route, type, and cross-service call while recording function behaviour so agents search by intent rather than name. Delivered via MCP for AI agents and LSP for IDEs, Carrick ensures models see existing endpoints and utilities before generating new code. The scanner is source-available and runs from your CLI or CI pipeline.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnable Claude Code, Cursor, or your favorite LLM to interact with Xcode, building your projects the same way you do, and seeing the same errors. Greatly increases productivity when working on iOS, iPadOS, macOS, visionOS, tvOS projects & Swift packages - or any time you might use Xcode.29225 PyPI5MIT
- FlicenseNot gradedqualityDmaintenanceBridges Xcode and Cursor to provide real-time access to build errors, warnings, and debug output from Xcode's DerivedData, enabling automated error analysis and fixes directly within Cursor.-
- AlicenseNot gradedqualityDmaintenanceIndexes a codebase into a live symbol graph and serves it via MCP to AI coding tools for context-aware code queries.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to index and search multi-project codebases through semantic and full-text retrieval, symbol lookup, and reference search via a local MCP endpoint.MIT