repo-graph
Fetches and parses GitHub repositories, including private repos via GITHUB_TOKEN, to build a code-structure graph. Uses commit-SHA caching and falls back to git clone when GitHub rate limits are hit.
Optionally writes the generated code-structure graph into a Neo4j database when NEO4J_* environment variables are configured, preserving labels and properties for existing Cypher queries.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
repo-graph-mcp
Share a repository with Claude and get its code-structure graph back in the chat: folders, files, classes, functions and API endpoints, with the calls, imports, tests and HTTP requests between them. You can pan, search, filter and click through it right in the conversation.
It's the graph half of Read-Code-Structure, packaged as a Claude plugin / MCP server. It makes no LLM summaries and no embeddings, so a typical repo is graphed in a second or two instead of minutes, and it needs no API keys.

What it does
Read-Code-Structure backend | repo-graph-mcp | |
File categorising | Mistral call per folder | Deterministic rules (same categories) |
Structure | tree-sitter (Python) | tree-sitter (Python, JavaScript, TypeScript, JSX/TSX) |
Summaries | LLM per function/file | First line of the docstring/JSDoc |
Vectors | Pinecone embeddings | none |
Storage | Neo4j (required) | in-memory + disk cache per commit; Neo4j optional |
Output | your web UI | interactive view inside Claude, plus a summary for the model |
The graph uses the same labels and relationships as the backend's Neo4j schema, so it can be pushed into the same database. It adds a few that are free to compute:
Nodes | |
| every folder that contains a kept file |
| files, classified by rules (configs, lock files, binaries, generated and vendored code are skipped) |
| classes, with their bases |
| functions and methods ( |
| FastAPI / Flask / Starlette decorators (incl. |
Relationships | |
| containment: function → class → file → folder |
| file → file, incl. relative imports, |
| resolved statically: local names, imports, |
| class → base class |
| test file → functions and endpoints it exercises ( |
| client code ( |
Related MCP server: code-grapher
Tools
Tool | Shown to | What it does |
| model + view | Fetch and parse a repo, render the interactive graph, return a summary and a |
| model + view | Focused view around one node: callers, callees, imports, tests ( |
| model | Find nodes by name/path/docstring |
| view only | Lets the view load the whole graph from an explore result |
| model | Only when |
The graph itself goes to the view as structuredContent, which MCP Apps hosts keep out of the model's
context. Claude gets a compact summary instead (layout, endpoints and who calls them, most-called
functions, most-imported files, test reach) and uses explore_graph/search_graph to dig further.
In the view you can:
click a node for its details and relationships; every entry is clickable;
double-click a file to show its functions, or a folder to fold or unfold it;
search with
/, zoom with ctrl/⌘ + scroll (plain scroll once you've clicked into the map), and fit with0;toggle node and link kinds in the legend;
use "Ask Claude about this" to send the selection back to the chat.
Large repos open as an overview: functions and docs hidden, deep folders folded. The status line says what was folded and how to open it.
Install
You need uv (or Python ≥ 3.10 and pip). Set GITHUB_TOKEN for private
repos and higher GitHub rate limits; without it the server uses anonymous access and falls back to
git clone when rate-limited.
Claude Code / Claude plugin
/plugin marketplace add rikharigaurav/repo-graph-mcp
/plugin install repo-graph@repo-graph-mcpThis adds the MCP server and a graph-repo skill. Then share a repo with Claude and ask for its graph, or
run /graph-repo https://github.com/owner/repo. In a terminal you get the text summary and exploration
tools. Apps that render MCP Apps, such as Claude on desktop and web, also show the interactive view.
Claude Desktop (local server)
Add to claude_desktop_config.json:
{
"mcpServers": {
"repo-graph": {
"command": "uvx",
"args": ["--from", "git+https://github.com/rikharigaurav/repo-graph-mcp", "repo-graph-mcp"],
"env": { "GITHUB_TOKEN": "ghp_…" }
}
}
}A local server can also graph folders on your machine: pass an absolute path as the repo.
claude.ai (web and mobile): host it as a custom connector
Run the HTTP server somewhere public, for example on your own site:
docker build -t repo-graph-mcp .
docker run -d -p 8000:8000 -v repo-graph-cache:/data \
-e GITHUB_TOKEN=ghp_… \
-e REPO_GRAPH_AUTH_TOKEN="$(openssl rand -hex 24)" \
-e REPO_GRAPH_ALLOWED_HOSTS=graph.your-site.com \
repo-graph-mcpPut it behind HTTPS, then in Claude go to Settings → Connectors → Add custom connector and use
https://graph.your-site.com/mcp?key=<REPO_GRAPH_AUTH_TOKEN>. Without Docker:
pip install . && repo-graph-mcp --http --host 0.0.0.0 --port 8000.
Hosted mode never reads paths on the server's own disk unless you set REPO_GRAPH_ALLOW_LOCAL_PATHS=1.
Configuration
Variable | Default | |
| – | Private repos, higher rate limits ( |
| system temp | Where downloads are unpacked and graphs are cached (gzipped JSON per commit) |
|
| Files graphed per repo (shallowest first) |
|
| Larger files are skipped |
|
| Archive size limit |
|
| Nodes sent to the view (most structural first) |
|
| Parallel builds in hosted mode |
| – | HTTP mode: require |
| – | HTTP mode: enable DNS-rebinding protection for these hostnames |
|
| Allow graphing directories on the server |
| – | Enables |
Using it with the existing Neo4j explorer
With NEO4J_* set, ask Claude to "save this graph to Neo4j". Nodes keep the backend's labels and property
names (file_name, function_name, endpoint_name, http_method, …) plus repo, so existing Cypher
keeps working. Scope it to one repo with MATCH (n {repo: 'owner/name'}). Re-pushing replaces only that
repo's nodes.
How it works
Fetch: resolve the commit SHA (one small GitHub API call); on a cache hit, stop there. Otherwise download the tarball and extract it while skipping
node_modules, build output, VCS folders and oversized files. Other git hosts usegit clone --depth 1.Classify: the rules from the backend's LLM prompt, applied deterministically.
Parse: tree-sitter for Python, JS, TS, JSX and TSX; one pass per file collects symbols, imports, call sites, routes and HTTP client calls.
Resolve: module index (Python packages, relative imports, tsconfig paths), then calls, inheritance, tests and HTTP links. An edge is only added when its target is actually defined in the repo; there is no fuzzy name matching.
Deliver: summary to the model, graph to the view, cached by commit.
Limits: only Python and JS/TS are parsed into symbols (other languages show as files). Dynamic dispatch, dependency injection and reflection aren't followed. Route matching is static, so routes built at runtime won't appear.
Development
python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]"
pytest -q
# the in-chat view (TypeScript, bundled into one HTML file inside the Python package)
cd ui-src && npm ci && npm run build # writes src/repo_graph_mcp/ui/graph-view.htmlThe view talks to the host using the MCP Apps protocol (ui/initialize, ui/notifications/tool-result,
tools/call, ui/open-link, ui/message, ui/update-model-context) through a small built-in bridge.
That keeps the bundle around 65 KB, where the official SDK would add about 650 KB. To try it outside Claude,
run repo-graph-mcp --http --port 3001 and open it in the
MCP Apps basic-host.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables seamless interaction with public or private code graphs from DeepGraph and CodeGPT to perform semantic searches and dependency analysis. It allows developers to explore architectural relationships, retrieve source code, and analyze repository structures across multiple AI assistants.549 npm402MIT
- FlicenseNot gradedqualityDmaintenanceEnables Claude to intelligently analyze and query codebases using knowledge graphs, supporting natural language code search, relationship discovery, and incremental updates.11-
- AlicenseAqualityDmaintenanceProvides a graph-based code analysis to coding agents, enabling tools to trace call dependencies, assess change impact, and identify hotspots using tree-sitter and Neo4j.103 npmMIT
- AlicenseNot gradedqualityBmaintenanceIngests any GitHub repository's code into a Neo4j knowledge graph and exposes it as read-only MCP tools, enabling users to query repo structure, dependencies, and function details via natural language.MIT