BX

block/xcode-index-mcp

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

67 stars 12 forks Качество 61 Тренд 0Apache-2.0

block/xcode-index-mcp - это MCP-серверный кандидат, импортированный из https://github.com/block/xcode-index-mcp.

Обзор

block/xcode-index-mcp - это MCP-серверный кандидат, импортированный из https://github.com/block/xcode-index-mcp.

Обзор (машинный перевод)

Предоставляет Goose/Cursor доступ к индексу проекта iOS/macOS через протокол управления моделями (MCP) и IndexStoreDB. Это предоставляет исчерпывающие списки сайтов вызовов функций, чтобы помочь вашему агенту с рефакторингом и навигацией по коду.

Пример подсказки

"Удалить myParameter из инициализатора на линии 48 MyViewController.swift. Используйте индекс Xcode MCP для обеспечения обновления всех ссылок».

Как использовать

1.Установить uv (управляющий пакетом Python) и запустить uv sync

2.Создайте сервис Swift (должен быть установлен Xcode)

Этот шаг необходим, поскольку он обеспечивает интерфейс для индекса Xcode.

3.Установка в Агенте по вашему выбору

Гусь:

Перейдите в настройки и добавьте пользовательское расширение. В модале, который всплывает под полем command, добавьте эту строку:

Примечание: Замените вашим фактическим именем пользователя системы или с правильным путем xcode-index-mcp на вашем компьютере.

Остальное должно выглядеть примерно так:

Курсор:

Иди к [6]. Обновите mcp.json (обычно расположенный в каталоге конфигурации курсора), чтобы выглядеть примерно так:

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального 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

  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:

    /Users//Development/xcode-index-mcp/.venv/bin/xcode-index-mcp
    

    Note: Replace `` 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//Development/xcode-index-mcp/.venv/bin/xcode-index-mcp"
                }
            }
        }
    

    Note: Replace `` 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//Development/xcode-index-mcp/.venv/bin/xcode-index-mcp
    

    Note: Replace `` with your actual system username, or with the correct path xcode-index-mcp on your machine.

  4. Update .gooseHints, cursorRules, or CLAUDE.MD 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 . 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

Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "Xcode Index MCP": { "command": "/Users/<USERNAME>/Development/xcode-index-mcp/.venv/bin/xcode-index-mcp" } } }