OpenLore
Local code graph that gives coding agents task context and checks changes before they land
Local code graph that gives a coding assistant review context, blast radius and change risk.
By Tirth Kanani (individual) Python Local · stdio Developer toolsKnowledge and memory
103 popularity score ★ 33k ↓ 302k/mo
Opens the app, which asks before it adds the server.
claude mcp add code-review-graph -- uvx code-review-graph serve{
"mcpServers": {
"code-review-graph": {
"command": "uvx",
"args": [
"code-review-graph",
"serve"
]
}
}
}{
"mcpServers": {
"code-review-graph": {
"command": "uvx",
"args": [
"code-review-graph",
"serve"
]
}
}
}{
"servers": {
"code-review-graph": {
"type": "stdio",
"command": "uvx",
"args": [
"code-review-graph",
"serve"
]
}
}
}[mcp_servers.code-review-graph]
command = "uvx"
args = ["code-review-graph", "serve"]gemini mcp add --scope user code-review-graph uvx -- code-review-graph serveCRG_TOOLS |
Optional: Comma-separated list of tools to expose. The --tools flag wins over it, and all 30 are exposed when neither is set. |
|---|---|
CRG_DATA_DIR |
Optional: Folder for the graph database and generated files, used as given instead of .code-review-graph/ in the repository. |
CRG_REPO_ROOT |
Optional: Repository to serve, overriding detection from the working folder. |
CRG_TOOL_TIMEOUT |
Optional: Seconds before a read tool call is cut off. 0 means no limit. |
CRG_RECURSE_SUBMODULES |
Optional: Set to 1 to index git submodules too. |
CRG_EMBEDDING_MODEL |
Optional: Model for local embeddings (needs the embeddings extra). |
VOYAGE_API_KEY secret |
Optional: Key for Voyage embeddings. |
GOOGLE_API_KEY secret |
Optional: Key for Gemini embeddings (needs the google-embeddings extra). |
CRG_ACCEPT_CLOUD_EMBEDDINGS |
Optional: Set to 1 to silence the warning shown before code identifiers are sent to a cloud embeddings provider. |
| Set together: openai embeddings | |
CRG_OPENAI_API_KEY secret |
Optional: Key for an OpenAI-compatible embeddings endpoint. |
CRG_OPENAI_BASE_URL |
Optional: Base URL of the OpenAI-compatible embeddings endpoint. |
CRG_OPENAI_MODEL |
Optional: Embedding model name at that endpoint. |
code-review-graph parses a repository with Tree-sitter into a graph of functions, classes, imports, calls, inheritance and tests, and stores it in a SQLite file. A coding assistant then asks the graph what a change touches and reads just those files, so it does not have to scan the repository again for every review.
There are 30 MCP tools and 5 prompts. The day-to-day ones answer the review questions: who calls this and what tests cover it, or how far a change spreads and how risky it is. Others look at the codebase as a whole. They find clusters of related code, the symbols everything depends on, links between clusters nobody expected, and long functions. A refactoring pair previews a rename and then applies it to your files. You can also generate a Markdown wiki or search several registered repositories at once.
You install it from PyPI and run code-review-graph install, which detects the coding tools on your machine and writes its MCP entry and hooks into each one. The server itself is code-review-graph serve over stdio, or over HTTP on localhost:5555 with --http. Semantic search works without embeddings, but it matches by meaning only after you add a local model through the embeddings extra or point it at a cloud embeddings provider.
Read tools have no time limit unless you set CRG_TOOL_TIMEOUT, which is 0 by default in main.py. The project's default branch is staging, and its README runs ahead of the 2.3.9 release. The Codex Skill under $CODEX_HOME/skills, the post-checkout, post-merge and post-rewrite hooks, and the removal of CRG_HOOK_WORKTREES are not in that release yet.
| Runtime | Python 3.10+ |
|---|---|
| Runs on | macOS, Windows, Linux |
Install with pip install code-review-graph (or pipx), then run code-review-graph install in the project, or configure one client with --platform. The uvx launch command needs uv on PATH. Local semantic search needs pip install code-review-graph[embeddings], Gemini embeddings need the google-embeddings extra, and community detection uses the communities extra (igraph).
A fit for developers on medium or large repositories who review multi-file changes with an assistant and want it to see who calls the changed code before it reads code. Nothing leaves your machine unless you choose cloud embeddings. On small repositories or one-off questions the project itself says plain file reads are often enough. Note that the installer edits the config of every coding tool it detects, so pass --platform if you want to touch only one, and leave out apply_refactor_tool with CRG_TOOLS if the assistant should never edit files.
25 only read, 5 change things. A ? marks an optional parameter.
build_or_update_graph_tool changesfull_rebuild?: booleanrepo_root?: stringbase?: stringpostprocess?: stringrecurse_submodules?: booleanembedding_provider?: stringembedding_model?: stringrun_postprocess_tool changesflows?: booleancommunities?: booleanfts?: booleanrepo_root?: stringembedding_provider?: stringembedding_model?: stringget_minimal_context_tooltask?: stringchanged_files?: arrayrepo_root?: stringbase?: stringget_impact_radius_toolchanged_files?: arraymax_depth?: integermax_results?: integerrepo_root?: stringbase?: stringdetail_level?: stringresolution?: stringget_review_context_toolchanged_files?: arraymax_depth?: integerinclude_source?: booleanmax_lines_per_file?: integerrepo_root?: stringbase?: stringdetail_level?: stringmax_results?: integermax_files?: integerquery_graph_toolpattern: stringtarget: stringrepo_root?: stringdetail_level?: stringmax_results?: integerresolution?: stringtraverse_graph_toolquery: stringmode?: stringdepth?: integertoken_budget?: integerrepo_root?: stringsemantic_search_nodes_toolquery: stringkind?: stringlimit?: integerrepo_root?: stringmodel?: stringprovider?: stringdetail_level?: stringembed_graph_tool changesrepo_root?: stringmodel?: stringprovider?: stringlist_graph_stats_toolrepo_root?: stringget_docs_section_toolsection_name: stringrepo_root?: stringfind_large_functions_toolmin_lines?: integerkind?: stringfile_path_pattern?: stringlimit?: integerrepo_root?: stringlist_flows_toolsort_by?: stringlimit?: integerkind?: stringdetail_level?: stringrepo_root?: stringget_flow_toolflow_id?: integerflow_name?: stringinclude_source?: booleanrepo_root?: stringmax_steps?: integermax_source_lines?: integerget_affected_flows_toolchanged_files?: arraybase?: stringrepo_root?: stringdetail_level?: stringmax_flows?: integerlist_communities_toolsort_by?: stringmin_size?: integerdetail_level?: stringrepo_root?: stringmax_results?: integermax_members?: integerget_community_toolcommunity_name?: stringcommunity_id?: integerinclude_members?: booleanrepo_root?: stringmax_members?: integerget_architecture_overview_toolrepo_root?: stringdetail_level?: stringmax_results?: integermax_members?: integerdetect_changes_toolbase?: stringchanged_files?: arrayinclude_source?: booleanmax_depth?: integerrepo_root?: stringdetail_level?: stringmax_results?: integermax_flows?: integerget_hub_nodes_tooltop_n?: integerrepo_root?: stringdetail_level?: stringget_bridge_nodes_tooltop_n?: integerrepo_root?: stringdetail_level?: stringget_knowledge_gaps_toolrepo_root?: stringmax_per_category?: integerdetail_level?: stringget_surprising_connections_tooltop_n?: integerrepo_root?: stringdetail_level?: stringget_suggested_questions_toolrepo_root?: stringrefactor_toolmode?: stringold_name?: stringnew_name?: stringkind?: stringfile_pattern?: stringrepo_root?: stringmax_results?: integerdetail_level?: stringapply_refactor_tool changesrefactor_id: stringrepo_root?: stringdry_run?: booleanmax_diff_files?: integergenerate_wiki_tool changesrepo_root?: stringforce?: booleanget_wiki_page_toolcommunity_name: stringrepo_root?: stringmax_chars?: integerlist_repos_toolcross_repo_search_toolquery: stringkind?: stringlimit?: integermax_results?: integerrepos?: arrayreview_changesarchitecture_mapdebug_issueonboard_developerpre_merge_check