Skip to main content
Glama

codegraph-mcp

Knowledge-Graph MCP Server für GitHub-Repositories. Nimmt den Code jedes GitHub-Repos in einen Neo4j-Graphen auf (Knoten für Repository / Datei / Funktion; Kanten CONTAINS / DEFINES / IMPORTS / CALLS) und stellt diesen Graphen als schreibgeschützte MCP-Tools für jeden MCP-Host bereit – Claude Desktop, opencode, Cursor oder jeden Client, der das Model Context Protocol unterstützt.

Status

v0.1 – stdio-Transport, Neo4j 5.x-Backend, Python ast + tree-sitter (JS/TS/TSX)-Parsing.

Related MCP server: revibe-mcp

Schnellstart

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"

Ein Repository erfassen

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

Einen MCP-Host verbinden

Claude Desktop (claude_desktop_config.json)

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

opencode (in 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 (zum Testen ohne MCP-Host)

uv run mcp dev src/codegraph/server.py

CLI

Befehl

Zweck

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

Repo klonen, parsen und in Neo4j laden

codegraph serve

MCP-Server ausführen (stdio) – vom MCP-Host gestartet

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

Ein Repo aus Neo4j hart löschen (destruktiv)

codegraph ls

Erfasste Repos auflisten

Tools

Tool

Zweck

list_repos

Erfasste Repos auflisten

init_repository_node

Bestätigen, dass der Graph eines Repos existiert; Datei-/Funktionszahlen zurückgeben

get_repo_structure

Gestufte Baumansicht unter einem Pfad

find_file_dependencies

Flaggschiff: Welche Dateien/Funktionen von einer Datei abhängen (oder von ihr abhängig sind)

search_nodes

Funktionen/Dateien nach Namen suchen

get_node_detail

Detaillierte Informationen zu einem Knoten (Zeilenbereich, Art)

Technologiestack

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

Siehe CONTRIBUTING.md für Architektur, Konventionen und Teststrategie.

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