What Are the 30 MCP Tools in code-review-graph? Complete Guide and Use Cases
The code-review-graph repository provides over 30 MCP (Model-Centric Programming) tools organized into Core, Flow, and Community categories that enable AI-assisted knowledge graph construction, execution path analysis, and architectural subsystem discovery.
The code-review-graph project implements a comprehensive suite of MCP tools that serve as the primary interface between large language models and codebase knowledge graphs. These tools, defined in docs/COMMANDS.md and implemented in code_review_graph/skills.py, enable automated graph traversal, impact analysis, and architectural visualization for AI-driven code review workflows.
The Three Categories of MCP Tools
The MCP tools in tirth8205/code-review-graph divide logically into three functional groups that cover the complete graph lifecycle. According to the project's command reference, these categories isolate concerns between graph construction, execution path analysis, and architectural discovery.
Core Tools: Graph Construction and Query
The Core Tools form the foundation for any AI-driven workflow, providing raw graph data, impact analysis, and minimal context extraction. These twelve tools manage the entire graph lifecycle from construction to deep querying:
build_or_update_graph_tool– Constructs or incrementally updates the knowledge graph from source code repositoriesrun_postprocess_tool– Executes post-processing routines to refine and optimize graph dataget_minimal_context_tool– Extracts the minimal necessary context for specific nodes to optimize token usageget_impact_radius_tool– Calculates the dependency impact radius for changed files, essential for pre-commit analysisquery_graph_tool– Provides a general-purpose graph query interface for custom investigationsget_review_context_tool– Gathers contextual information specifically optimized for code review scenariostraverse_graph_tool– Navigates graph edges and relationships programmatically for deep explorationsemantic_search_nodes_tool– Performs semantic similarity search across graph nodes using vector embeddingsembed_graph_tool– Generates and manages vector embeddings for graph entities to enable semantic operationslist_graph_stats_tool– Returns statistical summaries of graph composition and complexity metricsfind_large_functions_tool– Identifies overly complex or large functions within the graph that may require refactoringget_docs_section_tool– Retrieves specific documentation sections associated with graph nodes or communities
Flow Tools: Execution Path Analysis
Flow Tools operate on high-level execution paths extracted from the graph, such as request-handling pipelines or build pipelines. These three tools identify critical end-to-end paths that matter for specific changes:
list_flows_tool– Enumerates available execution flows with options to sort by criticality, frequency, or complexityget_flow_tool– Retrieves detailed information about a specific execution flow including participating nodes and edgesget_affected_flows_tool– Identifies which flows are impacted by specific file changes or modifications, crucial for regression testing
Community Tools: Architectural Discovery
Community Tools work with clusters of related nodes (functions, classes, tests) that form logical subsystems. These eight tools expose subsystem boundaries, architectural insights, and knowledge gaps:
list_communities_tool– Displays all detected communities or clusters identified within the graph structureget_community_tool– Retrieves detailed information about a specific community including size, cohesion, and member nodesget_architecture_overview_tool– Generates high-level architectural summaries with configurable detail levelsget_hub_nodes_tool– Identifies central connector nodes that serve as critical dependencies within communitiesget_bridge_nodes_tool– Locates nodes that connect disparate communities, revealing cross-cutting concernsget_knowledge_gaps_tool– Detects areas of the codebase with insufficient documentation, test coverage, or explicit relationshipsget_surprising_connections_tool– Reveals unexpected dependencies between seemingly unrelated components that may indicate architectural driftget_suggested_questions_tool– Generates intelligent questions to ask about the codebase based on graph topology and community structure
Practical Implementation Examples
The MCP server (code-review-graph serve) expects JSON payloads with tool names and arguments. Below are concrete implementations demonstrating each category.
Core Tool Example: Impact Radius Analysis
Use get_impact_radius_tool to determine which parts of the graph are affected by current changes:
import json, subprocess
payload = {
"tool": "get_impact_radius_tool",
"args": {
"changed_files": None, # auto-detect from VCS
"max_depth": 3,
"detail_level": "standard"
}
}
result = subprocess.run(
["code-review-graph", "mcp"],
input=json.dumps(payload).encode(),
capture_output=True,
text=True,
)
print(result.stdout) # → JSON with affected nodes and context-savings estimate
Flow Tool Example: Critical Flow Enumeration
Retrieve the most critical execution flows using list_flows_tool:
payload = {
"tool": "list_flows_tool",
"args": {"sort_by": "criticality", "limit": 10}
}
# Invoke via subprocess as shown above
Community Tool Example: Architecture Overview
Generate a minimal architecture overview with get_architecture_overview_tool:
payload = {
"tool": "get_architecture_overview_tool",
"args": {"detail_level": "minimal"}
}
# Invoke via subprocess as shown above
These examples can be adapted to any language capable of invoking the CLI, including bash scripts or Node.js applications.
Source Code Architecture
The MCP tools are implemented across several key files that define their signatures, behaviors, and test coverage:
docs/COMMANDS.md– Central catalog of all MCP tools with complete signatures, default parameters, and usage notescode_review_graph/skills.py– Implements the Python skill wrappers that expose the tools to the LLM server interfacetests/test_tools.py– Comprehensive test suite validating each tool's argument handling and output format consistencyREADME.md– High-level overview including installation instructions and server startup procedures
Summary
The code-review-graph repository delivers approximately 30 MCP tools across three strategic categories:
- Core Tools handle graph construction, semantic search, and impact analysis for foundational operations
- Flow Tools focus on end-to-end execution paths critical for understanding change propagation
- Community Tools reveal architectural boundaries, knowledge gaps, and subsystem relationships
Together, these tools enable AI systems to perform sophisticated codebase analysis through the standardized MCP interface defined in docs/COMMANDS.md.
Frequently Asked Questions
What distinguishes Flow Tools from Community Tools?
Flow Tools analyze dynamic execution paths such as request pipelines and data flows, while Community Tools examine static structural clusters that represent logical subsystems or modules. Use Flow Tools when tracing how changes propagate through runtime behavior, and Community Tools when assessing architectural organization and cohesion.
How do I invoke MCP tools from a custom Python script?
Submit a JSON payload containing the tool name and args dictionary to the code-review-graph mcp subprocess interface, as demonstrated in the implementation examples. The server returns structured JSON responses that can be parsed for downstream automation or LLM context windows.
Which tool should I use for analyzing pull request impact?
The get_impact_radius_tool in the Core category is specifically designed for this use case. Set changed_files to None for automatic VCS detection, or pass specific file paths to calculate affected nodes, dependency depth, and estimated context savings for review preparation.
Where are the MCP tool signatures and parameters documented?
All tool signatures, default values, and type definitions are cataloged in docs/COMMANDS.md at the repository root. The Python implementations in code_review_graph/skills.py provide the runtime wrappers that validate arguments against these specifications before executing graph operations.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →