
Xcode Index MCP
https://github.com/block/xcode-index-mcp- Category
- Developer Tools
- Rank
- No. 1574Tools index
Previous survey · No. 1581 ·
- Pricing
- Open Source
- Type
- TOOL
- Builder
- block
- GitHub
- 68 stars
- Date
About
MCP server that exposes Xcode's project index to AI coding agents.
What it does
It lets coding assistants trace Swift symbols through indexes already produced by Xcode. An assistant can search names, resolve a symbol at a source location, then retrieve definitions and references by unique symbol identifier. A Python front end translates MCP requests for a Swift service that queries IndexStoreDB.
Why it's ranked here
A focused, credible choice for refactoring and navigation in Apple projects. It returns file locations and symbol roles from Xcode’s own index rather than relying only on text search. The narrow scope is useful, but setup requires both Python and Swift builds, a prepared Xcode index, and project-specific agent instructions.
What's good
The workflow connects name search, source-location lookup, unique symbol resolution, and reference discovery. Queries can distinguish definitions, declarations, reads, writes, calls, and other roles. Pattern matching supports anchored, subsequence, and case-insensitive searches. Swift tests exercise request dispatch, successful results, missing parameters, and unknown requests through a mock provider.
Tradeoffs
It only works with Xcode projects that already have index data in Derived Data. Users must install a Python package manager, synchronize dependencies, build the Swift service, configure an absolute executable path, and tell the agent the project name. Initial index scanning is explicitly costly and may block for up to 30 seconds.
How to use it well
Use it for iOS or macOS refactors where missing one call site would be costly. Start from a symbol name or an exact file and line, resolve its unique identifier, then collect definitions and references before editing. Keep text search nearby for locating source lines. It does not build missing Xcode indexes or perform code changes itself.
Technical notes+
pyproject.toml packages a Python 3.13+ Hatchling project with an xcode-index-mcp console script and FastMCP dependency. src/xcode_index_mcp/server.py launches IndexStoreMCPService, connects to localhost port 7949, and exchanges newline-delimited JSON. swift-service/Package.swift targets macOS 12, depends on IndexStoreDB’s main branch, and defines executable and test targets. swift-service/Sources/TCPServer.swift binds with INADDR_ANY, reads into a fixed 1024-byte buffer, and dispatches four request methods. swift-service/Sources/Index/SymbolProvider.swift locates matching Derived Data directories, loads Xcode’s libIndexStore.dylib, and creates a temporary IndexStoreDB database. swift-service/Tests/IndexStoreMCPServiceTests/TCPServerTests.swift tests routing with a mock provider.
Observed
- Languages
- Python and Swift
- Interface
- MCP server with a packaged command-line entry point
- Packaging
- Python package built with Hatchling and synchronized with uv; Swift service built with Swift Package Manager
- Platform
- macOS 12 or later with Xcode installed and an Xcode-generated project index
- Dependency surface
- FastMCP, Requests, and Apple IndexStoreDB
- Tests
- Swift test target includes request-routing tests and mock index components
Read from README.md, pyproject.toml, src/xcode_index_mcp/server.py, src/xcode_index_mcp/__init__.py, src/xcode_index_mcp/__main__.py, swift-service/Package.swift, swift-service/Sources/main.swift, swift-service/Sources/TCPServer.swift, swift-service/Sources/Index/Models.swift, swift-service/Sources/Index/XcodePath.swift, swift-service/Sources/Index/IndexStore.swift, swift-service/Sources/Index/IndexReader.swift, swift-service/Sources/Index/SymbolProvider.swift, swift-service/Tests/IndexStoreMCPServiceTests/TCPServerTests.swift, swift-service/Tests/IndexStoreMCPServiceTests/MockIndexReader.swift.
What it can do
Expose Xcode project structure to AI agents
Xcode project files → Project structure data accessible to AI coding agents
Query source code symbols and definitions
Symbol or function names → Symbol definitions and metadata from Xcode index
Retrieve code dependencies and relationships
Source file or class references → Dependency graph and relationship data
Search codebase using Xcode's indexing system
Search queries for code elements → Indexed search results with file locations
Access build configuration information
Xcode project build settings → Build configuration data for AI analysis
Tags
Tech Stack
Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.