How james-chahwan/repo-graph works
repo-graph is an MCP server that gives AI coding assistants a structural map of a codebase. The main workflow is: an agent asks for orientation, search, impact, trace, source reading, or refresh; the server delegates graph operations to the glia engine through a thin graph wrapper and returns navigable results. The graph is cached and can be refreshed on edits. A separate installer wires the server into coding agents, with optional Git-hook support. The README documents the tool capabilities; unsampled server logic limits detail on individual tool-to-engine calls.
Main entry points: server.py MCP tools · core.py Install orchestration · targets.py Agent targets · githook.py Pre-commit hook
Components 15
MCP navigation
- MCP tools
repo_graph/server.py - Graph wrapper
repo_graph/graph.py
Graph engine
- glia engine
- Graph cache
Graph freshness
- File watcher
repo_graph/watcher.py - Cache exclusion
repo_graph/gitexclude.py - Graph initializer
repo_graph/init.py
Agent installation
- Install orchestration
repo_graph/installer/core.py - Agent targets
repo_graph/installer/targets.py - Config file I/O
repo_graph/installer/fileio.py - Instruction markers
repo_graph/installer/markers.py - Pre-commit hook
repo_graph/installer/githook.py
Other components
- Coding assistant
- Target codebase
- Git metadata
Connections 16
- Coding assistant → MCP tools: requests tools
README.md - MCP tools → Graph wrapper: delegates graph work
repo_graph/server.py - Graph wrapper → glia engine: forwards lookups
repo_graph/graph.py - Target codebase → glia engine: builds graph from
README.md - glia engine → Graph cache: stores graph
README.md - MCP tools → File watcher: starts watcher
repo_graph/server.py - File watcher → MCP tools: triggers rebuild callback
repo_graph/watcher.py - MCP tools → Cache exclusion: excludes cache
repo_graph/server.py - Coding assistant → Install orchestration: runs install
README.md - Install orchestration → Agent targets: runs target actions
repo_graph/installer/core.py - Agent targets → Config file I/O: writes configuration
repo_graph/installer/targets.py - Agent targets → Instruction markers: updates instructions
repo_graph/installer/targets.py - Install orchestration → Pre-commit hook: installs optional hook
repo_graph/installer/core.py - Pre-commit hook → Graph initializer: runs graph initializer
repo_graph/installer/githook.py - Pre-commit hook → Cache exclusion: uses hook marker
repo_graph/installer/githook.py - Cache exclusion → Git metadata: updates local exclusion
repo_graph/gitexclude.py