codeindex
codeindex
AIコーディングエージェント向けにMCPサーバーとして動作する、構造的なコードインテリジェンスエンジンです。
tree-sitter(40以上の言語)でコードベースをインデックス化し、トライグラム全文インデックス、転置ワードインデックス、依存関係グラフを構築して、16のMCPツールとして公開します。
┌─────────────┐ MCP (stdio) ┌──────────────┐
│ AI Agent │ ◄─────────────────────► │ codeindex │
│ (Claude, │ 16 tools, JSON-RPC │ (Zig binary) │
│ Cursor…) │ │ │
└─────────────┘ └──────┬───────┘
│
tree-sitter parse (40+ langs)
trigram + word index
dependency graph
snapshot persistenceなぜ
AIコーディングエージェントは、ファイル全体を読むためにトークンを消費します。codeindexは、シンボルの概要、定義、呼び出し元、影響範囲、依存関係チェーンといった構造的な質問に、数千トークンではなく数百トークンで答えます。
plan_changeを1回呼び出すだけで、シンボルが定義されている場所、すべての呼び出し箇所、ファイルのアーキテクチャ上の役割(神モジュール / 安定コア / アイランド / ドライバー)、確認すべきハードコードされたリテラル、ファイルが変更された場合の完全な推移的影響範囲が返ります。
Related MCP server: OpenCodeHub MCP Server
クイックスタート
# Install (prebuilt binary or build from source)
curl -fsSL https://raw.githubusercontent.com/munhq/codeindex/main/install.sh | bash
# Or build manually:
cd zig && ./fetch-vendor.sh && zig build -Doptimize=ReleaseFastAIエージェントに登録してください:
# Claude Code — the plugin is the one-step path. It ships the skill, the hook
# and the MCP server together, and its launcher finds or fetches the binary.
claude plugin marketplace add munhq/codeindex
claude plugin install codeindex@codeindex
# Without the plugin (or for a different MCP client), register the binary
# directly. Do not do both: two registrations mean two servers, two copies of
# every tool schema, and two writers on one snapshot. install.sh detects the
# plugin and skips this step when it is present.
claude mcp add -s user codeindex -- ~/.local/bin/codeindex --mcp
# Cursor / other MCP clients: add to your config
{
"mcpServers": {
"codeindex": {
"command": "~/.local/bin/codeindex",
"args": ["--mcp"]
}
}
}次回エージェントを起動すると、codeindexがプロジェクトをバックグラウンドでインデックス化し、構造的なクエリに応答します。
MCPツール
ツール | 説明 |
| インデックスの統計: ファイル数、シンボル数、インデックス状態、トークン節約率(%) |
| インデックス化されたすべてのファイルに対する、トライグラムによる高速全文検索 |
| 名前によるシンボル定義(関数、構造体、クラスなど)の検索 |
| 転置ワードインデックスによる完全一致の単語/識別子の検索 |
| シンボルの近似呼び出し元(ヒューリスティック、完全な名前解決なし) |
| ファイルの構造的な概要(シンボル、行数) |
| ファイルメタデータ付きのディレクトリツリー |
| 指定されたファイルがインポート/依存しているファイル |
| 逆依存関係 — このファイルをインポートしているファイル |
| 推移的な影響範囲: ファイルが変更された場合に壊れるもの |
| シンボルまたはファイルの完全なリファクタリング計画 — 定義、呼び出し元、ファイルの役割、リテラル、影響範囲 |
| 最近変更されたファイルを新しい順に並べたもの |
| オプションの行範囲指定付きでファイル内容を読取る |
| シンボルのソースコードだけを読取る(オプションのコンテキスト行付き) |
| ワークスペースディレクトリのインデックス化または再インデックス化 |
| 16のコード解析のいずれかを実行(下記参照) |
解析(analyzeツール)
解析 | 検出内容 |
| ハードコードされたシークレット、SQLインジェクションパターン、unsafeブロック、evalの使用 |
| 参照されていないファイルとシンボル |
|
|
| テストカバレッジのないファイル |
| アーキテクチャ上の問題 — 神モジュール、循環依存、アイランド |
| ファイル間のシンボル参照 |
| モジュール間の型シグネチャの不一致 |
| マイグレーションとコード間のデータベーススキーマのドリフト |
| スキーマ変更に対するマイグレーションの欠落 |
| package.json / Caro.toml / go.mod のコンプライアンス問題 |
| ハードコードされたURL、IP、ポート、絶対パス、TODO |
| モジュール結合度のメトリクス |
| 循環依存の検出 |
| 再発明されたフリー関数 — 同じ処理が2回書かれている |
| 名前と空白を無視した、コピー&ペーストされた関数本体 |
| 上記の解析を1つのインデックス健全性レポートにまとめたもの |
対応言語
tree-sitter経由で40以上の言語に対応: Rust、Python、TypeScript/TSX、Go、Zig、C、C++、Java、Ruby、Bash、C#、Kotlin、Lua、Scala、Elixir、R、Swift、Dart、Haskeel、TOML、JSON、YAML、HTML、CSS、SCSS、SQL、HCL、Dockerfile、Markdown、Nix、Make、その他。
設定
codeindex --mcp # Run as MCP server (stdio)
codeindex --workspace ./my-project # Index a specific directory
codeindex --project-id my-project # Project identifier
codeindex -v # Print version
codeindex -h # Print help
# Environment variables
CODEINDEX_WORKSPACE=/path/to/project # Same as --workspace
CODEINDEX_PROJECT_ID=my-project # Same as --project-idcodeindexは、作業ディレクトリから上方向に.git、package.json、Cargo.toml、go.mod、build.zig、pyproject.tomlなどを探しながら遡ることで、プロジェクトルートを自動検出します。
ホームディレクトリ全体やファイルシステムのルートのインデックス化は拒否します — 明示的に--workspaceを指定してください。
アーキテクチャ
Parser: 40以上の文法を持つtree-sitterで、単一バイナリにコンパイルされます
インデックス: あいまいテキスト検索用のトライグラムインデックス + 完全一致の識別子検索用の転置ワードインデックス
依存関係グラフ: 順方向と逆方向のエッジを持つファイルレベルのインポート解決
バージョンストア: 増分更新のためのシーケンス番号でファイル変更を追跡
ライブウォッチャー: ファイルの作成/変更/削除時に再インデックス化(MCPモードではバックグラウンドスレッド)。Linuxではinotify、macOSとWindowsではポーリング方式の走査で、数秒ごとにmtimeとサイズを比較します。
statusはどちらのバックエンドが稼働中かをwatcher_backendとして報告します。スナップショット: 完全なインデックスを
.codeindex.jsonに永続化し、再起動時には再インデックス化ではなくスナップショットを読み込みますMCPサーバ: stdio上のJSON-RPCで、MCP 2024-11-05プロトコルを実装
プラットフォームサポート
注記がある場合を除き、各行はCIでビルドされ、そのプラットフォーム上でテストが実行されます。statusが稼働中のウォッチャーバックエンドを報告するため、推測する必要はありません。
バイナリ | CIでのテスト実行 | ウォッチャー | install.sh | プラグイン | |
Linux x86_64 | はい | はい | inotify | はい | はい |
Linux aarch64 | はい | クロスコンパイル | inotify | はい | はい |
macOS aarch64 | はい | はい | ポーリング | はい | はい |
macOS x86_64 | はい | クロスコンパイル | ポーリング | はい | はい |
Windows x86_64 | はい | はい | ポーリング | シェルが必要 | 下記参照 |
Windows aarch64 | はい | クロスコンパイル | ポーリング | シェルが必要 | 下記参照 |
Windowsでは、install.shとプラグインのランチャーはシェルスクリプトであるため、Git Bash、MSYS2、またはCygwinが必要です — スクリプトはシェルを検出して、正しい.exeアセットを解決します。プラグインはそのランチャーを通じてサーバーを登録するため、シェルのないネイティブWindows版Claude Codeはバイナリを直接登録する必要があります:
claude mcp add -s user codeindex -- C:\path\to\codeindex.exe --mcpここにあるものはすべて、署名も公証もされていません。macOSでは、curlで取得したバイナリはGatekeeperのプロンプトなしで実行されます。ブラウザ経由でダウンロードしたバイナリは検疫されるため、xattr -d com.apple.quarantine codeindexで解除できます。
ソースからのビルド
Zig 0.16.0が必要です。
cd zig
./fetch-vendor.sh # Clone tree-sitter + 40 grammar repos
zig build -Doptimize=ReleaseFast
# Binary: zig/zig-out/bin/codeindexテストを実行:
cd zig && zig build test-bin && ./zig-out/bin/testzig build testは、ビルドランナーのIPCプロトコルを介してstdoutに結果を送りますが、リンクされているtree-sitterのCソースがデバッグ用のprintfパスを通じてこれを破損させます。テストバイナリをビルドして直接実行するのは、そのプロトコルが邪魔をしない同じテストです。
他ツールとの比較
codeindex | ast-grep | ctags | LSIF | Sourcegraph | |
MCPネイティブ | はい | いいえ | いいえ | いいえ | いいえ |
トークン効率 | はい(概要であり、ファイル全体ではない) | いいえ | 部分的 | はい | はい |
単一バイナリ | はい | はい | はい | いいえ | いいえ(サーバー) |
ライブウォッチャー | はい(inotify / ポーリング) | いいえ | いいえ | いいえ | いいえ |
依存関係グラフ | はい | いいえ | いいえ | はい | はい |
影響範囲 | はい(推移的) | いいえ | いいえ | いいえ | 部分的 |
リファクタリングプランナー | はい( | いいえ | いいえ | いいえ | いいえ |
対応言語 | 40以上 | 20以上 | 50以上 | 場合による | 場合による |
chat-recallと組み合わせて使用
codeindexは、目の前にあるコードについての質問に答えます。**chat-recall**は、あなたがすでに行った作業についての質問に答えます — Claude Code、Gemini CLI、Codex、OpenCode、Antigravityのセッションを1つの検索可能な履歴にインデックス化し、それをMCPでも公開します。
この2つは、エージェントが忘れることの両方をカバーします: codeindexは、概要点化できたはずのファイルを読み直すのを防ぎ、chat-recallは、すでに完了した作業をやり直すのを防ぎます。chat-recallはPATH上のcodeindexバイナリを検出し、見つけた場合は追加のコードインテリジェンスツールを4つ登録します — どちらも相手を必要としません。
ライセンス
MIT。 LICENSEを参照。
This server cannot be installed
Maintenance
Related MCP Connectors
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Codebase intelligence for agents: 152 structured artifacts across 21 programs, one call.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search code by meaning, explore codebase structure, store and query knowledge with temporal facts, and read source code through a set of MCP tools.4817MIT
- AlicenseNot gradedqualityAmaintenanceProvides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.3Apache 2.0
- FlicenseNot gradedqualityCmaintenanceProvides structural code intelligence via 26 MCP tools, enabling AI assistants to query code symbols, dependencies, and call graphs accurately without file-pasting.
- AlicenseAqualityAmaintenanceEnables AI coding agents to efficiently explore codebases by providing structural outlines, module digests, symbol bodies, and AST-aware grep via MCP.4171MIT
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/munhq/codeindex'
If you have feedback or need assistance with the MCP directory API, please join our Discord server