About Code Review Graph
Code Review Graph is an MCP server published by tirth8205 in the RAG category: local-first code intelligence graph for MCP and CLI. Builds a persistent map of your codebase so AI coding tools read only what matters, with benchmarked context reductions on reviews and large-repo workflows. Conduid read 30 tools from its source: apply_refactor_tool, build_or_update_graph_tool, cross_repo_search_tool, detect_changes_tool, embed_graph_tool, find_large_functions_tool and 24 more. It is published to PyPI as code-review-graph and runs with uvx.
The repository has 33K stars and 3.0K forks, is licensed MIT, and its last commit was on 16 Nov 2026. The latest release is v2.4.0 (11 Nov 2026): Two new platforms, MiMo Code and DeepSeek Harness, so install now supports 18. It follows v2.3.9 (18 Sep 2026), and the 5 most recent releases go back to v2.3.6 (10 Jun 2026). It passes 4 of the 5 static checks Conduid ran on the repository; it does not pass No dynamic code execution. Its topics include ai-coding, code-review, graphrag, incremental, knowledge-graph and static-analysis.
Install
uvx code-review-graphpip install code-review-graphgit clone https://github.com/tirth8205/code-review-graphTools (30)
apply_refactor_toolApply a previously previewed refactoring| Parameter | Type | Description |
|---|---|---|
| dry_run | boolean | If True, return a unified diff of what would change without touching any files. The refactor_id remains valid so the same preview can be applied in a follow-up call without dry_run. Use this for a human-in-the-loop review before committing changes to disk. See: #176 |
| max_diff_files | integer | Maximum per-file diffs to include in a dry run. would_modify still lists every file. Default: 25. |
| refactor_id * | string | The refactor ID from refactor_tool's response. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
build_or_update_graph_toolBuild or incrementally update the graph| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref to diff against for incremental updates. When omitted, resolves automatically to the commit the graph was last built at, so one update catches everything since the last sync (not just the latest commit). Pass an explicit ref to override. |
| embedding_model | string | Exact model for an explicit post-build embedding refresh. Must be supplied with embedding_provider. Default: disabled. |
| embedding_provider | string | Exact provider for an explicit post-build embedding refresh. Must be supplied with embedding_model. Default: disabled. Refreshes an existing index only: on a graph with no embeddings the result sets embeddings_refresh_skipped; run embed_graph_tool first. |
| full_rebuild | boolean | If True, re-parse all files. Default: False (incremental). |
| postprocess | string | Post-processing level: "full" (default), "minimal" (signatures+FTS only), or "none" (skip all post-processing). Use "minimal" for faster builds. |
| recurse_submodules | boolean | If True, include files from git submodules. When None (default), falls back to CRG_RECURSE_SUBMODULES env var. |
| repo_root | string | Repository root path. Auto-detected from current directory if omitted. |
cross_repo_search_toolSearch registered repositories; `repos` limits the search to a subset| Parameter | Type | Description |
|---|---|---|
| kind | string | Optional filter: File, Class, Function, Type, Test, YamlPath, DocSection, or JsonPath. |
| limit | integer | Maximum results per repo. Default: 20. |
| max_results | integer | Maximum merged results across searched repos; total reports the untruncated merged count. Default: 50. |
| query * | string | Search string to match against node names. |
| repos | array | Optional repo aliases or folder names to search. Default: every registered repo. Use it when the registry spans unrelated products and only some of them can answer the question. Matching is exact and case-sensitive, and paths are not accepted. Names matching no registry entry come back in ``unknown``; a name matching several entries selects all of them and is listed in ``ambiguous``. |
detect_changes_toolRisk-scored change impact analysis| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref to diff against. Default: HEAD~1. |
| changed_files | array | List of changed file paths (relative to repo root). Auto-detected if omitted. |
| detail_level | string | "standard" for full output, "minimal" for token-efficient summary. Default: standard. |
| include_source | boolean | Include source code snippets for changed functions. Default: False. |
| max_depth | integer | Impact radius depth for BFS traversal. Default: 2. |
| max_flows | integer | Maximum affected flows to embed. Embedded flows carry per-flow metadata only — use get_affected_flows_tool for step detail. Default: 20. |
| max_results | integer | Maximum changed functions, YAML paths, test gaps, and changed files to return; the matching *_total fields report the full counts. Default: 25. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
embed_graph_toolCompute vector embeddings for semantic search| Parameter | Type | Description |
|---|---|---|
| model | string | Embedding model. Local: a HuggingFace ID or path (default all-MiniLM-L6-v2); openai / google / voyage: that provider's model ID. Falls back to CRG_EMBEDDING_MODEL, CRG_OPENAI_MODEL or CRG_VOYAGE_MODEL. |
| provider | string | "local" (default), "openai", "google", "minimax", or "voyage". "openai" accepts any OpenAI-compatible endpoint and needs CRG_OPENAI_BASE_URL + CRG_OPENAI_API_KEY; "voyage" needs VOYAGE_API_KEY. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
find_large_functions_toolFunctions, classes or files above a line-count threshold| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full rows, "minimal" for fewer, smaller rows. Default: standard. |
| file_path_pattern | string | Filter by file path substring (e.g. "components/"). |
| kind | string | Optional filter: Function, Class, File, Test, YamlPath, DocSection, or JsonPath. |
| limit | integer | Maximum results. Default: 50. At most 100, or 25 with detail_level "minimal". ``total`` always counts every match. |
| min_lines | integer | Minimum line count to flag. Default: 50. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
generate_wiki_toolMarkdown wiki from communities| Parameter | Type | Description |
|---|---|---|
| force | boolean | If True, regenerate all pages even if content unchanged. Default: False. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_affected_flows_toolFlows affected by changed files| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref for auto-detecting changes. Default: HEAD~1. |
| changed_files | array | List of changed file paths (relative to repo root). Auto-detected if omitted. |
| detail_level | string | "standard" for full step details, "minimal" for per-flow metadata only. Default: standard. |
| max_flows | integer | Maximum flows to return; total reports the full count. Default: 50. Pass 0 for no caller limit. Standard mode additionally caps visible flows at 25 and minimal mode at 500, because a standard flow costs ~980 tokens against ~18 minimal. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_architecture_overview_toolArchitecture overview from community structure| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "minimal" (default) drops community member lists and aggregates cross-community edges to one row per community pair (typical reduction: 600KB -> <5KB); "standard" returns full per-edge detail. |
| max_members | integer | Maximum member names per community in standard mode. Default: 10. |
| max_results | integer | Maximum cross-community rows and warnings to return; cross_community_edges_total reports the full count. Default: 100. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_bridge_nodes_toolChokepoints by betweenness centrality| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full node data, "minimal" for name, kind, and betweenness only. Default: standard. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| top_n | integer | Number of top bridges to return (capped at 100). Default: 10. |
get_community_toolOne community| Parameter | Type | Description |
|---|---|---|
| community_id | integer | Database ID of the community. |
| community_name | string | Name to search for (partial match). Ignored if community_id given. |
| include_members | boolean | Include full member node details. Default: False. |
| max_members | integer | Maximum member entries to include; the community's size still reports its true member count and members_truncated marks the cut. Default: 25. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_docs_section_toolRetrieve documentation sections| Parameter | Type | Description |
|---|---|---|
| repo_root | string | Repository root path. Auto-detected if omitted. |
| section_name * | string | The section to retrieve (e.g. "review-delta", "usage"). |
get_flow_toolOne execution flow| Parameter | Type | Description |
|---|---|---|
| flow_id | integer | Database ID of the flow. |
| flow_name | string | Name to search for (partial match). Ignored if flow_id given. |
| include_source | boolean | Include source code snippets for each step. Default: False. |
| max_source_lines | integer | Total source lines across all steps when include_source is set. Default: 400. |
| max_steps | integer | Maximum steps to return; flow.total_steps reports the full count. Default: 50. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_hub_nodes_toolMost-connected nodes| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full node data, "minimal" for name, kind, and total_degree only. Default: standard. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| top_n | integer | Number of top hubs to return (capped at 100). Default: 10. |
get_impact_radius_toolBlast radius of changed files; `detail_level="compact"` gives ranked file paths| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref for auto-detecting changes. Default: HEAD~1. |
| changed_files | array | List of changed file paths (relative to repo root). Auto-detected if omitted. |
| detail_level | string | "standard" for graph records, "minimal" for a summary, "compact" for ranked repo-relative file paths without node/edge records. |
| max_depth | integer | Number of hops to traverse in the dependency graph. Default: 2. |
| max_files | integer | File display limit in compact mode (default 25, maximum 200). Does not reduce the graph traversal budget set by max_results. |
| max_results | integer | How many impacted nodes to traverse to. Default: the CRG_MAX_IMPACT_NODES setting, or 500. Each list in the response also has a fixed ceiling (100 nodes, 150 edges, 200 files) so the response size does not grow with the repository; the omitted counts report the rest. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| resolution | string | "all" (default) or "direct" to traverse only calls bound to an indexed node. |
get_knowledge_gaps_toolStructural weaknesses, untested hotspots and import cycles| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full gap records, "minimal" to drop file paths. Default: standard. |
| max_per_category | integer | Maximum entries per gap category; summary and total_gaps still report the untruncated counts. Default: 15. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_minimal_context_toolCompact context (~100 tokens); call this first| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref for diff comparison. Default: HEAD~1. |
| changed_files | array | Explicit list of changed files. Auto-detected if omitted. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| task | string | What you are doing (e.g. "review PR #42", "debug login timeout"). |
get_review_context_toolReview context with structural summary| Parameter | Type | Description |
|---|---|---|
| base | string | Git ref for change detection. Default: HEAD~1. |
| changed_files | array | Files to review. Auto-detected from git diff if omitted. |
| detail_level | string | "standard" for full output, "minimal" for token-efficient summary. Default: standard. |
| include_source | boolean | Include source code snippets. Default: True. |
| max_depth | integer | Impact radius depth. Default: 2. |
| max_files | integer | Maximum files listed and given source snippets. Default: 25. Snippets share an 800-line budget. |
| max_lines_per_file | integer | Max source lines per file. Default: 200. |
| max_results | integer | Maximum graph nodes per list and edges to return. Default: 50. Each list reports its untruncated ``*_total``. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_suggested_questions_toolReview questions generated from the analysis| Parameter | Type | Description |
|---|---|---|
| repo_root | string | Repository root path. Auto-detected if omitted. |
get_surprising_connections_toolUnexpected cross-community coupling| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full edge records, "minimal" for source, target, kind, and score only. Default: standard. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| top_n | integer | Number of top surprises to return (capped at 100). Default: 15. |
get_wiki_page_toolOne wiki page| Parameter | Type | Description |
|---|---|---|
| community_name * | string | Community name to look up. |
| max_chars | integer | Maximum characters of page content to return; total_chars reports the real length. Default: 20000. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
list_communities_toolDetected code communities| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" (default) returns full community data; "minimal" returns only name, size, and cohesion per community. |
| max_members | integer | Maximum member names listed per community in standard mode. Each community's size still reports its true member count. Default: 10. |
| max_results | integer | Maximum communities to return; total reports the full count. Default: 50. |
| min_size | integer | Minimum community size to include. Default: 0. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| sort_by | string | Sort column: size, cohesion, or name. |
list_flows_toolExecution flows sorted by criticality| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" (default) returns full flow data; "minimal" returns only name, criticality, and node_count per flow. |
| kind | string | Optional filter by entry point kind (e.g. "Test", "Function"). |
| limit | integer | Maximum flows to return. Default: 50. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| sort_by | string | Sort column: criticality, depth, node_count, file_count, or name. |
list_graph_stats_toolGraph size and health| Parameter | Type | Description |
|---|---|---|
| repo_root | string | Repository root path. Auto-detected if omitted. |
list_repos_toolRegistered repositoriesquery_graph_toolCallers, callees, tests, imports, inheritance, and `path_to` between two symbols| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full output, "minimal" for compact summary. Default: standard. |
| max_results | integer | Maximum results to return. Default: 100. |
| pattern * | string | Query pattern name (see above). |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| resolution | string | "all" (default), "direct" for only calls bound to an indexed node, or "unresolved" for only the bare-name matches. |
| target * | string | Node name, qualified name, or file path to query. A full name that one non-test symbol has resolves to it; otherwise the answer is "ambiguous" and lists qualified names to choose from. |
| to | string | For path_to, the node name, qualified name, or file path to reach. |
refactor_toolRename preview, dead code detection, suggestions| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full records, "minimal" for identifying fields only. Default: standard. |
| file_pattern | string | (dead_code) Filter by file path substring. |
| kind | string | (dead_code) Optional filter: Function or Class. |
| max_results | integer | Maximum edits/symbols/suggestions in the response; total reports the full count. The stored rename preview keeps every edit, so apply_refactor_tool still applies them all. Default: 50. |
| mode | string | Operation mode: "rename", "dead_code", or "suggest". |
| new_name | string | (rename) Desired new name for the symbol. |
| old_name | string | (rename) Current symbol name to rename. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
run_postprocess_toolRe-run flow detection, community detection and FTS indexing| Parameter | Type | Description |
|---|---|---|
| communities | boolean | Run community detection. Default: True. |
| embedding_model | string | Exact model for an explicit embedding refresh. Must be supplied with embedding_provider. Default: disabled. |
| embedding_provider | string | Exact provider for an explicit embedding refresh. Must be supplied with embedding_model. Default: disabled. Refreshes an existing index only: on a graph with no embeddings the result sets embeddings_refresh_skipped; run embed_graph_tool first. |
| flows | boolean | Run flow detection. Default: True. |
| fts | boolean | Rebuild FTS index. Default: True. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
semantic_search_nodes_toolSearch code entities by name or meaning| Parameter | Type | Description |
|---|---|---|
| detail_level | string | "standard" for full output, "minimal" for compact summary. Default: standard. |
| expand_neighbors | boolean | With include_source, also return each top hit's direct callers and callees with their source, so one call answers "how does X work". Default: False. |
| include_source | boolean | Return the source of each hit alongside its location, so you can answer without opening the files. Costs tokens; leave off when you only need locations. Ignored when detail_level is "minimal". Default: False. |
| kind | string | Optional filter: File, Class, Function, Type, Test, YamlPath, DocSection, Variable, Output, or JsonPath. Liquid Output nodes are found only by asking for that kind. |
| limit | integer | Maximum results. Default: 20. At most 100, or 5 with detail_level "minimal". ``total`` counts the matches ranked. |
| max_source_lines | integer | With include_source, the most lines per snippet (1-60). Default: 60. |
| model | string | Embedding model for query vectors. Must match the model used during embed_graph. Falls back to CRG_EMBEDDING_MODEL env var (local), CRG_OPENAI_MODEL (openai), or CRG_VOYAGE_MODEL (voyage). |
| provider | string | Embedding provider: "local" (default), "openai", "google", "minimax", or "voyage". Must match the provider used during embed_graph. |
| query * | string | Search string to match against node names. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
traverse_graph_toolBFS/DFS traversal from any node with a token budget| Parameter | Type | Description |
|---|---|---|
| depth | integer | Max traversal depth (1-6). Default: 3. |
| mode | string | Traversal mode: "bfs" (breadth-first) or "dfs" (depth-first). Default: bfs. |
| query * | string | Search string to find the starting node. |
| repo_root | string | Repository root path. Auto-detected if omitted. |
| token_budget | integer | Approximate token limit for results, at most 10000. The walk stops when it runs out. Default: 2000. |
Security checks
Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 7.7K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by uv.lock and code-review-graph-vscode/package-lock.json.
- !No dynamic code executionScanned 104 source files and found 1 call to eval or shell execution, in code-review-graph-vscode/src/backend/cli.ts:221. Review how tool inputs reach them before granting credentials.
1 check has not been run yet.
What the source scan found
- Transport
- stdio and Streamable HTTPcode_review_graph/main.py:1725, code_review_graph/main.py:1736
- Starts other programs
- 37 callscode_review_graph/changes.py:156, code_review_graph/changes.py:196, code_review_graph/changes.py:260
- Outbound network calls
- 3 callscode_review_graph/embeddings.py:323, code_review_graph/embeddings.py:485, code_review_graph/embeddings.py:720
- Writes or deletes files
- 67 callscode_review_graph/cli.py:2935, code_review_graph/codex_skill.py:124, code_review_graph/context_history.py:162
- Lockfile
- uv.lock and code-review-graph-vscode/package-lock.json
Pattern matches on the source text of 104 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 7.7K words, fetched 7 days ago. The original in the repository is authoritative.
Read full README