GitHub
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
作者による説明(英語の原文)
Structural codebase indexer with 17 query tools. 87% token reduction. Zero dependencies.
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
]
}
}
}ターミナルでこれを実行します
claude mcp add codebase-index -- uvx mcp-codebase-indexプロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"codebase-index": {
"command": "uvx",
"args": [
"mcp-codebase-index"
]
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"codebase-index": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-codebase-index"
]
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月6日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント MikeRecognex で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
レジストリには必須のキーは載っていません。ただし、最初に使うときにサインインを求めるサーバーもあります。
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(0.2.2)がレジストリに届いたのは9 か月前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにPython (uv)も必要です。
同じカテゴリには:GitHub, Desktop Commander, Cloudflare MCP
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
A structural codebase indexer with an MCP server for AI-assisted development. Zero runtime dependencies — uses Python's ast module for Python analysis and regex-based parsing for TypeScript/JS, Go, Rust, and C#. Requires Python 3.11+.
Indexes codebases by parsing source files into structural metadata -- functions, classes, imports, dependency graphs, and cross-file call chains -- then exposes 18 query tools via the Model Context Protocol, enabling Claude Code and other MCP clients to navigate codebases efficiently without reading entire files.
Automatic incremental re-indexing: In git repositories, the index stays up to date automatically. Before every query, the server checks git diff and git status (~1-2ms). If files changed, only those files are re-parsed and the dependency graph is rebuilt. No need to manually call reindex after edits, branch switches, or pulls.
Persistent disk cache: The index is saved to a pickle cache file (.codebase-index-cache.pkl) after every build. On subsequent server starts, the cache is loaded and validated against the current git HEAD — if the ref matches, startup is instant. If a small number of files changed (≤20), the cached index is loaded and incrementally updated instead of rebuilt from scratch. This eliminates the cold-start penalty when restarting Claude Code sessions, restarting the MCP server, or resuming work after context compaction.
| Language | Method | Extracts |
|---|---|---|
Python (.py) | AST parsing | Functions, classes, methods, imports, dependency graph |
TypeScript/JS (.ts, .tsx, .js, .jsx) | Regex-based | Functions, arrow functions, classes, interfaces, type aliases, imports |
Go (.go) | Regex-based | Functions, methods (receiver-based), structs, interfaces, type aliases, imports, doc comments |
Rust (.rs) | Regex-based | Functions (pub/async/const/unsafe), structs, enums, traits, impl blocks, use statements, attributes, doc comments, macro_rules |
C# (.cs) | Regex-based | Classes, interfaces, structs, enums, records, methods, constructors, using directives, [Attributes], /// XML doc comments |
Markdown/Text (.md, .txt, .rst) | Heading detection | Sections (# headings, underlines, numbered, ALL-CAPS) |
| Other | Generic | Line counts only |
pip install "mcp-codebase-index[mcp]"
The [mcp] extra includes the MCP server dependency. Omit it if you only need the programmatic API.
For development (from a local clone):
pip install -e ".[dev,mcp]"
# As a console script
PROJECT_ROOT=/path/to/project mcp-codebase-index
PROJECT_ROOT=/path/to/project python -m mcp_codebase_index.server
PROJECT_ROOT specifies which directory to index. Defaults to the current working directory.
In git repositories, the server automatically caches the index to .codebase-index-cache.pkl in the project root. On startup:
Add .codebase-index-cache.pkl to your .gitignore — it's a local-only build artifact.
Install the package on the machine where OpenClaw is running:
# Local install
pip install "mcp-codebase-index[mcp]"
docker exec -it openclaw bash pip install "mcp-codebase-index[mcp]"
Add the MCP server to your OpenClaw agent config (openclaw.json):
{
"agents": { "list": [{ "id": "main", "mcp": { "servers": [ { "name": "codebase-index", "command": "mcp-codebase-index", "env": { "PROJECT_ROOT": "/path/to/project" } } ] } }] } }
Restart OpenClaw and verify the connection:
openclaw mcp list
All 18 tools will be available to your agent.
Performance note: The server automatically detects file changes via git diff before every query (~1-2ms) and incrementally re-indexes only what changed. However, OpenClaw's default MCP integration via mcporter spawns a fresh server process per tool call, which discards the in-memory index and forces a full rebuild each time (~1-2s for small projects, longer for large ones). With persistent caching, these cold starts are now significantly faster — the server loads from the disk cache instead of re-parsing the entire codebase. For persistent connections (avoiding even the cache load overhead), use the openclaw-mcp-adapter plugin, which connects once at startup and keeps the server running:
pip install openclaw-mcp-adapter
Add to your project's .mcp.json:
{
"mcpServers": { "codebase-index": { "command": "mcp-codebase-index", "env": { "PROJECT_ROOT": "/path/to/project" } } } }
Or using the Python module directly (useful if installed in a virtualenv):
{
"mcpServers": { "codebase-index": { "command": "/path/to/.venv/bin/python3", "args": ["-m", "mcp_codebase_index.server"], "env": { "PROJECT_ROOT": "/path/to/project" } } } }
Claude Code tends to default to built-in Glob/Grep/Read tools even when codebase-index is available. In addition to CLAUDE.md instructions (see below), you can add hooks that fire on every prompt to reinforce the behavior. Add this to .claude/settings.local.json:
{
"hooks": { "SessionStart": [ { "hooks": [ { "type": "command", "command": "echo 'CRITICAL REMINDER: Use codebase-index MCP tools FIRST for ALL code navigation (find_symbol, get_function_source, search_codebase, get_dependencies, etc). Only fall back to Glob/Grep/Read for non-code files.'" } ] } ], "UserPromptSubmit": [ { "hooks": [ { "type": "command", "command": "echo 'Use codebase-index MCP tools first for code navigation.'" } ] } ] } }
Hook stdout is injected as context Claude sees before responding. SessionStart fires on startup, resume, and context compaction. UserPromptSubmit fires on every turn.
By default, AI assistants will ignore the indexed tools and fall back to reading entire files with Glob/Grep/Read. Soft language like "prefer" gets rationalized away. Add this to your project's CLAUDE.md (or equivalent instructions file) with mandatory language:
## Codebase Navigation — MANDATORY
You MUST use codebase-index MCP tools FIRST when exploring or navigating the codebase. This is not optional.
The word "prefer" is too weak — models treat it as a suggestion and default to familiar tools. Mandatory language with explicit fallback criteria is what actually changes behavior.
| Tool | Description |
|---|---|
get_project_summary | File count, packages, top classes/functions |
list_files | List indexed files with optional glob filter |
get_structure_summary | Structure of a file or the whole project |
get_functions | List functions with name, lines, params |
get_classes | List classes with name, lines, methods, bases |
get_imports | List imports with module, names, line |
get_function_source | Full source of a function/method |
get_class_source | Full source of a class |
find_symbol | Find where a symbol is defined (file, line, type) |
get_dependencies | What a symbol calls/uses |
get_dependents | What calls/uses a symbol |
get_change_impact | Direct + transitive dependents |
get_call_chain | Shortest dependency path (BFS) |
get_file_dependencies | Files imported by a given file |
get_file_dependents | Files that import from a given file |
search_codebase | Regex search across all files (max 100 results) |
reindex | Force full re-index (rarely needed — incremental updates happen automatically in git repos) |
get_usage_stats | Session efficiency stats: tool calls, characters returned vs total source, estimated token savings |
Tested across four real-world projects on an M-series MacBook Pro, from a small project to CPython itself (1.1 million lines):
| Project | Files | Lines | Functions | Classes | Index Time | Peak Memory |
|---|---|---|---|---|---|---|
| RMLPlus | 36 | 7,762 | 237 | 55 | 0.9s | 2.4 MB |
| FastAPI | 2,556 | 332,160 | 4,139 | 617 | 5.7s | 55 MB |
| Django | 3,714 | 707,493 | 29,995 | 7,371 | 36.2s | 126 MB |
| CPython | 2,464 | 1,115,334 | 59,620 | 9,037 | 55.9s | 197 MB |
With persistent caching, subsequent startups bypass the full build entirely. Cache load time is negligible compared to parsing — a cache hit on CPython restores the full index in under a second instead of 56s.
Querying CPython — 41 million characters of source code:
| Query | Response | Total Source | Reduction |
|---|---|---|---|
find_symbol("TestCase") | 67 chars | 41,077,561 chars | 99.9998% |
get_dependencies("compile") | 115 chars | 41,077,561 chars | 99.9997% |
get_change_impact("TestCase") | 16,812 chars | 41,077,561 chars | 99.96% |
get_function_source("compile") | 4,531 chars | 41,077,561 chars | 99.99% |
get_function_source("run_unittest") | 439 chars | 41,077,561 chars | 99.999% |
find_symbol returns 54-67 characters regardless of whether the project is 7K lines or 1.1M lines. Response size scales with the answer, not the codebase.
get_change_impact("TestCase") on CPython found 154 direct dependents and 492 transitive dependents in 0.45ms — the kind of query that's impossible without a dependency graph. Use max_direct and max_transitive to cap output to your token budget.
All targeted queries return in sub-millisecond time, even on CPython's 1.1M lines:
| Query | RMLPlus | FastAPI |
冒頭だけを表示しています。続きはリポジトリで読めます