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 "Install 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 MCPfind 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
| Name | Required | Description | Default |
|---|---|---|---|
| usr | Yes | ||
| roles | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It mentions that roles 'must be "reference" or "definition"' and returns a 'Dict containing all occurrences,' but lacks critical behavioral details such as whether this is a read-only operation, potential rate limits, error conditions, or how results are structured beyond 'Dict.' For a tool with no annotation coverage, this is insufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and front-loaded with the core purpose, followed by clear sections for Args and Returns. Every sentence adds value: the first states the tool's goal, the next two explain parameters, and the last specifies the return type. There's no wasted text.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 2 parameters with 0% schema coverage and no annotations, the description does a decent job explaining parameters and the return type. However, it lacks context on behavioral aspects like safety, performance, or error handling. The presence of an output schema (implied by 'Has output schema: true') mitigates the need to detail return values, but overall completeness is only adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It effectively explains both parameters: 'usr' as 'The USR (Unified Symbol Resolution) of the symbol' and 'roles' as 'The roles to search for (must be "reference" or "definition").' This adds meaningful context beyond the bare schema, though it doesn't detail format constraints (e.g., USR string format) or array handling for roles.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get all occurrences of a symbol by its USR.' It specifies the verb ('Get'), resource ('occurrences of a symbol'), and key identifier ('USR'). However, it doesn't explicitly differentiate from sibling tools like 'symbol_occurrences' which likely has overlapping functionality, preventing a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. With siblings like 'search_pattern' and 'symbol_occurrences' available, there's no indication of scenarios where this tool is preferred or should be avoided, leaving the agent to guess based on naming alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| projectName | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full burden for behavioral disclosure. It mentions loading from 'Derived Data folder' and returns a success boolean, but fails to describe critical traits like whether this is a read-only operation, if it requires specific permissions, potential side effects (e.g., caching), or error conditions. This leaves significant gaps for a tool that interacts with project data.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is efficiently structured with a clear purpose statement followed by Args and Returns sections. Every sentence earns its place by providing essential information without redundancy, making it easy to parse and front-loaded with the core function.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (1 parameter, no annotations, but with an output schema), the description is minimally adequate. The output schema covers the return value, so the description doesn't need to explain returns further. However, it lacks details on behavioral aspects and usage context, leaving room for improvement in guiding the agent effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds meaningful context beyond the input schema, which has 0% description coverage. It explains that 'projectName' refers to 'Name of the project to load the index for', clarifying the parameter's purpose. However, it doesn't detail format constraints (e.g., case sensitivity) or examples, keeping it from a perfect score.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Load the IndexStore') and resource ('for a project from the Derived Data folder'), providing specific verb+resource pairing. However, it doesn't explicitly differentiate from sibling tools like 'get_occurrences' or 'search_pattern', which likely operate on different resources or with different purposes.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., whether the project must exist or be indexed first) or exclusions, leaving the agent with no usage boundaries beyond the basic function.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| options | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool searches for symbol occurrences and returns a dict with canonical symbols, which gives basic behavioral context. However, it lacks details on permissions, rate limits, side effects, or error handling. For a search tool with no annotations, this is minimal but not entirely absent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections for Args and Returns, using bullet points for options. It's front-loaded with the core purpose and avoids unnecessary fluff. However, the formatting could be slightly more compact, and some sentences are a bit verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (2 parameters, no annotations, but with an output schema), the description is reasonably complete. It explains the purpose, parameters, and return value. The output schema exists, so the description doesn't need to detail return values further. It covers the essentials but could benefit from more behavioral context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds significant value by explaining 'pattern' as the search pattern and detailing 'options' with valid values like 'anchorStart', 'anchorEnd', etc., including their semantics. This goes beyond the schema's basic types, though it doesn't cover all parameter nuances like format constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'search' and resource 'symbol occurrences matching a pattern', which is specific and actionable. However, it doesn't explicitly differentiate from sibling tools like 'get_occurrences' or 'symbol_occurrences', which likely have overlapping functionality. The purpose is clear but lacks sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_occurrences' or 'symbol_occurrences'. It mentions what the tool does but offers no context about use cases, prerequisites, or exclusions. This leaves the agent without direction on tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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
| Name | Required | Description | Default |
|---|---|---|---|
| filePath | Yes | ||
| lineNumber | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. While it states what the tool does and the return type, it lacks critical behavioral details: whether it requires specific file permissions, what happens with invalid paths/line numbers, if it's read-only or has side effects, performance characteristics, or error handling. For a tool with no annotation coverage, this is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is appropriately concise with three clear sections: purpose statement, args, and returns. Each sentence earns its place by providing essential information. The structure is front-loaded with the core purpose first. Minor improvement could be made by integrating the sections more fluidly, but overall it's efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has an output schema (returns a dict), the description doesn't need to detail return values. However, with no annotations, 0% schema description coverage, and two parameters, the description should do more to explain behavioral aspects and usage context. It covers the basics but leaves gaps in error handling, permissions, and sibling differentiation, making it minimally adequate.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter descriptions. The description adds basic semantics by explaining 'filePath' as 'Absolute path to the file' and 'lineNumber' as 'Line number in the file', which clarifies what each parameter represents. However, it doesn't provide format details, constraints, or examples (e.g., lineNumber starting at 0 or 1). This gives some value but doesn't fully compensate for the coverage gap.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Get') and resource ('symbols occurring at a specific location in a file'). It distinguishes from siblings like 'get_occurrences' by specifying it's for symbols at a location rather than general occurrences, but doesn't fully differentiate from 'search_pattern' which might also involve file locations. The purpose is clear but sibling differentiation could be more explicit.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives like 'get_occurrences' or 'search_pattern'. It doesn't mention prerequisites, constraints, or typical use cases. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
4 tool updates
v1.0.0- First observed
get_occurrences - First observed
load_index - First observed
search_pattern - First observed
symbol_occurrences
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Let ChatGPT, Claude & Cursor use your Mac: email, calendar, iMessage, Teams, files. Local, free.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
MCP connector for iMessage & Contacts via a local Mac agent + Vercel relay
Related MCP Servers
- AlicenseAqualityCmaintenanceEnable 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.295MIT
- FlicenseNot gradedqualityCmaintenanceBridges 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.-
- FlicenseAqualityCmaintenanceIndexes a workspace and exposes code-navigation tools to Codex, enabling symbol lookup, reference finding, dependency analysis, and security audit for local codebases.10-
- AlicenseNot gradedqualityBmaintenanceIndexes a codebase into a live symbol graph and serves it via MCP to AI coding tools for context-aware code queries.351MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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