Skip to main content
Glama
code-index-mcp

code-index-mcp

by johnhuang316

コードインデックスMCP

MCPサーバー パイソン ライセンス

コードのインデックス作成、検索、分析のためのモデル コンテキスト プロトコル サーバー。

コードインデックスMCPとは何ですか?

Code Index MCPは、インテリジェントなコードインデックス作成と分析機能を提供する専用のMCPサーバーです。大規模言語モデルとコードリポジトリの連携を可能にし、複雑なコードベースにおけるリアルタイムの洞察とナビゲーションを提供します。

このサーバーは、AI モデルが外部ツールやデータ ソースと対話するための標準化された方法であるモデル コンテキスト プロトコル(MCP) と統合されます。

Related MCP server: @lex-tools/codebase-context-dumper

主な特徴

  • プロジェクトのインデックス作成: ディレクトリを再帰的にスキャンして、コードファイルの検索可能なインデックスを構築します。

  • コード検索: コードベース全体でパターン、関数定義、参照を検索します

  • ファイル分析: ファイル構造、インポート、複雑さに関する詳細な情報を取得します

  • スマートフィルタリング: ビルドディレクトリ、依存関係、非コードファイルを自動的に無視します

  • 永続ストレージ: セッション間のパフォーマンスを向上させるためにインデックスをキャッシュします

サポートされているファイル形式

サーバーは、以下を含む複数のプログラミング言語とファイル拡張子をサポートしています。

  • Python (.py)

  • JavaScript/TypeScript (.js、.ts、.jsx、.tsx)

  • Java (.java)

  • C/C++ (.c、.cpp、.h、.hpp)

  • C# (.cs)

  • ゴー(.go)

  • ルビー(.rb)

  • PHP (.php)

  • スウィフト(.swift)

  • コトリン (.kt)

  • Rust (.rs)

  • Scala (.scala)

  • シェル スクリプト (.sh、.bash)

  • Web ファイル (.html、.css、.scss)

  • ドキュメント/設定 (.md、.json、.xml、.yml、.yaml)

インストール

前提条件

  • Python 3.8以上

  • uvパッケージ マネージャー (推奨)

uvxの使用(推奨)

code-index-mcp をインストールして使用する最も簡単な方法は、uvx を使用することです。

uvx code-index-mcp

pipの使用

あるいは、pip 経由でインストールすることもできます。

pip install code-index-mcp

インストール後、モジュールとして実行できます。

python -m code_index_mcp

Claude Desktopとの統合

これを Claude 設定 ( ~/Library/Application Support/Claude/claude_desktop_config.json ) に追加します。

{
  "mcpServers": {
    "code-index": {
      "command": "uvx",
      "args": [
        "code-index-mcp"
      ]
    }
  }
}

構成を追加した後、Claude Desktop を再起動すると、Code Index MCP ツールが使用できるようになります。

利用可能なツール

コアツール

  • set_project_path : インデックス作成の基本プロジェクト パスを設定します。

  • search_code : インデックスファイル内で一致するコードを検索します。

  • find_files : 指定されたパターンに一致するプロジェクト内のファイルを検索します。

  • get_file_summary : 行数、関数、インポートなどを含む特定のファイルの概要を取得します。

  • refresh_index : プロジェクトインデックスを更新します。

  • get_settings_info : プロジェクト設定に関する情報を取得します。

ユーティリティツール

  • create_temp_directory : インデックス データの保存に使用する一時ディレクトリを作成します。

  • check_temp_directory : インデックス データの保存に使用される一時ディレクトリをチェックします。

  • clear_settings : すべての設定とキャッシュされたデータをクリアします。

クロードとの使用例

Claude で Code Index MCP を使用する方法の例をいくつか示します。

プロジェクトパスの設定

Please set the project path to C:\Users\username\projects\my-python-project

コードパターンの検索

Search the code for all occurrences of "def process_data" in Python files

ファイルの概要を取得する

Give me a summary of the main.py file in the project

特定の種類のファイルをすべて検索する

Find all JavaScript files in the project

発達

ソースから構築

  1. リポジトリをクローンします。

git clone https://github.com/username/code-index-mcp.git
cd code-index-mcp
  1. 依存関係をインストールします:

uv sync
  1. サーバーをローカルで実行します。

uv run code_index_mcp

デバッグ

MCP インスペクタを使用してサーバーをデバッグできます。

npx @modelcontextprotocol/inspector uvx code-index-mcp

ライセンス

MITライセンス

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

言語

Available Tools

14 tools
build_deep_indexA
Build the deep index (full symbol extraction) for the current project.

This performs a complete re-index and loads it into memory.
Uses parallel processing by default. For large codebases (3000+ files),
tuning max_workers can significantly improve build times.

Args:
    max_workers: Maximum number of parallel workers for file processing.
        Defaults to min(4, cpu_count) when not specified.
        Increase for I/O-bound workloads on machines with many cores.
    timeout: Parallel build timeout in seconds. When not specified,
        scales dynamically based on file count (0.5s per file,
        min 30s, max 600s).

Inputs: max_workers, timeout. Returns: result

check_temp_directoryA

Check the temporary directory used for storing index data.

Inputs: no named parameters. Returns: object

clear_settingsB

Clear all settings and cached data.

Inputs: no named parameters. Returns: result

configure_file_watcherA

Configure file watcher service settings.

Args:
    enabled: Whether to enable file watcher
    debounce_seconds: Debounce time in seconds before triggering rebuild
    additional_exclude_patterns: Additional directory/file patterns to exclude
    observer_type: Observer backend to use. Options:
        - "auto" (default): platform default observer
        - "kqueue": Force kqueue observer (macOS/BSD)
        - "fsevents": Force FSEvents observer (macOS only, has known reliability issues)
        - "polling": Cross-platform polling fallback (slower but most compatible)

Inputs: enabled, debounce_seconds, additional_exclude_patterns, observer_type. Returns: result

create_temp_directoryA

Create the temporary directory used for storing index data.

Inputs: no named parameters. Returns: object

find_filesA

Find files matching glob pattern using in-memory index. Supports path patterns (.py, test_.js) and filename-only matching (README.md).

Inputs: pattern (required). Returns: result

get_file_summaryB
Get a summary of a specific file, including:
- Line count
- Function/class definitions (for supported languages)
- Import statements
- Basic complexity metrics

Inputs: file_path (required). Returns: object

get_file_watcher_statusA

Get file watcher service status and statistics.

Inputs: no named parameters. Returns: object

get_settings_infoB

Get information about the project settings.

Inputs: no named parameters. Returns: object

get_symbol_bodyA
Get the source code body of a specific symbol (function, method, or class).

This tool retrieves only the code for the specified symbol, enabling efficient
context usage by avoiding loading entire files.

Args:
    file_path: Path to the file containing the symbol
    symbol_name: Name of the symbol to retrieve (e.g., "process_data", "MyClass.my_method")

Returns:
    Dictionary containing:
    - status: "success" or "error"
    - symbol_name: Name of the symbol
    - type: Type of symbol (function, method, class)
    - line: Start line number
    - end_line: End line number
    - code: The actual source code
    - signature: Function/method signature (if available)
    - docstring: Documentation string (if available)
    - called_by: List of symbols that call this symbol

Inputs: file_path (required), symbol_name (required). Returns: object

refresh_indexA

Manually rebuild the project file index. Use after git operations or when index seems stale.

Inputs: no named parameters. Returns: result

refresh_search_toolsA

Manually re-detect the available command-line search tools on the system. This is useful if you have installed a new tool (like ripgrep) after starting the server.

Inputs: no named parameters. Returns: result

search_code_advancedA

Search for code pattern with pagination. Auto-selects best search tool (ugrep/ripgrep/ag/grep). Supports glob file_pattern (e.g., "*.py"), explicit regex mode, and fuzzy matching (ugrep only). Regex matching requires passing regex=True and may require an external search tool.

Inputs: pattern (required), case_sensitive, context_lines, file_pattern, +4 more. Returns: object

set_project_pathC

Set the base project path for indexing.

Inputs: path (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 14 tools

    Disambiguation5/5

    Each tool targets a distinct action: index building, file watching, settings management, searching, etc. Overlap is minimal and descriptions clarify the differences.

    Naming Consistency5/5

    All tool names use a consistent verb_noun snake_case pattern (e.g., build_deep_index, check_temp_directory, get_file_summary). No mixing of conventions.

    Tool Count5/5

    14 tools cover indexing, searching, file details, symbol retrieval, settings, and utilities. This is well-scoped for a code index server, neither sparse nor excessive.

    Completeness4/5

    Covers core operations: index build/refresh, file and code search, symbol body retrieval, settings, file watcher. Minor gaps like listing symbols or index statistics exist but do not hinder primary use.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers