Skip to main content
Glama

codegraph-mcp

GitHub リポジトリ向けナレッジグラフ MCP サーバー。あらゆる GitHub リポジトリのコードを Neo4j グラフ(Repository / File / Function ノード、CONTAINS / DEFINES / IMPORTS / CALLS エッジ)に取り込み、そのグラフを読み取り専用の MCP ツールとして任意の MCP ホスト(Claude Desktop、opencode、Cursor、または Model Context Protocol に対応した任意のクライアント)に公開します。

ステータス

v0.1 — stdio トランスポート、Neo4j 5.x バックエンド、Python ast + tree-sitter(JS/TS/TSX)によるパース。

Related MCP server: revibe-mcp

クイックスタート

git clone <codegraph-mcp> && cd codegraph-mcp
uv sync --extra dev              # all deps pinned via uv.lock
docker compose up -d             # Neo4j on bolt://localhost:7687
cp .env.example .env
uv run pytest -m "not slow and not integration"

リポジトリを取り込む

uv run codegraph ingest https://github.com/<owner>/<name>
# → {"graph_id": "owner/name", "files": 142, "functions": 880, ...}

MCP ホストに接続する

Claude Desktop(claude_desktop_config.json)

{
  "mcpServers": {
    "codegraph": {
      "command": "uv",
      "args": ["run", "--directory", "C:\\path\\to\\codegraph-mcp", "codegraph", "serve"]
    }
  }
}

opencode(opencode.json 内)

{
  "mcp": {
    "codegraph": {
      "type": "local",
      "command": ["uv", "run", "--directory", "/path/to/codegraph-mcp", "codegraph", "serve"]
    }
  }
}

Cursor(~/.cursor/mcp.json)

{
  "mcpServers": {
    "codegraph": {
      "command": "uv",
      "args": ["run", "--directory", "/path/to/codegraph-mcp", "codegraph", "serve"]
    }
  }
}

MCP Inspector(MCP ホストを使わないテスト用)

uv run mcp dev src/codegraph/server.py

CLI

コマンド

目的

codegraph ingest <url> [--branch main] [--force]

リポジトリをクローンして解析し、Neo4j へ読み込む

codegraph serve

MCP サーバー(stdio)を実行する — MCP ホストから起動される

codegraph reset --graph-id <owner/name>

Neo4j から 1 つのリポジトリを完全に消去する(破壊的操作)

codegraph ls

取り込み済みリポジトリを一覧表示する

ツール

ツール

目的

list_repos

取り込み済みリポジトリを一覧表示する

init_repository_node

リポジトリのグラフの存在を確認し、ファイル/関数の件数を返す

get_repo_structure

指定パス配下の階層ツリービュー

find_file_dependencies

目玉機能: あるファイルに依存する(または依存される)ファイル/関数を調べる

search_nodes

名前で関数/ファイルを検索する

get_node_detail

1 つのノードの詳細情報(行範囲、種別)

技術スタック

Python 3.11+、mcp>=1.27,<2(安定版 v1.x FastMCP)、Neo4j 5.x、pydantic v2、tree-sitter、GitPython、pytest、ruff、mypy、uv。

アーキテクチャ、規約、テスト戦略については CONTRIBUTING.md を参照してください。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    AI-native code intelligence graph that builds a persistent knowledge graph of your codebase in Neo4j and exposes it to AI assistants via MCP, enabling contextual code analysis, impact analysis, and dependency tracking.
    23
    -
  • A
    license
    A
    quality
    D
    maintenance
    Enables analysis of any GitHub repository to get architecture, file roles, execution flows, system design Q\&A, and structured agent context. Works with MCP-compatible clients like Claude Desktop, Cursor, and Windsurf.
    6
    39 npm
    1
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Provides 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.
    3
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Embeds your codebase into a local vector and graph database and exposes it as an MCP tool, enabling AI assistants to perform fast semantic search over your code using Graph RAG.
    4
    MIT