code-graph-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| VERBOSE | No | Enable verbose logging (true/false) | |
| PROJECT_ROOT | No | Root directory of the project (optional, defaults to current directory) | |
| NO_FILE_WATCHER | No | Disable file watcher (true/false) | |
| CODE_GRAPH_MCP_LOG_LEVEL | No | Set logging level (e.g., DEBUG, INFO, WARNING, ERROR) | |
| CODE_GRAPH_MCP_MAX_FILES | No | Maximum number of files to track (default 10000) | |
| CODE_GRAPH_MCP_CACHE_SIZE | No | Maximum cache size in entries (default 300000) | |
| CODE_GRAPH_MCP_FILE_WATCHER | No | Enable or disable file watcher (true/false) | |
| CODE_GRAPH_MCP_DEBOUNCE_DELAY | No | Debounce delay in seconds before re-analysis (default 2.0) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_usage_guideA | π Get comprehensive guidance on effectively using code analysis tools. π― PURPOSE: Provides detailed instructions, best practices, and workflow recommendations for optimal tool usage. π§ USAGE: Call this FIRST if you need guidance on tool selection, sequencing, or best practices. β‘ PERFORMANCE: Lightweight operation - provides strategic guidance without analysis overhead. π WORKFLOW: Use before starting complex analysis tasks to understand optimal tool orchestration. |
| analyze_codebaseA | π Perform comprehensive codebase analysis with metrics and structure overview. π― PURPOSE: Builds the foundational code graph and provides project-wide insights including file counts, language distribution, complexity metrics, and architectural overview. π§ USAGE: Run this FIRST before using other analysis tools - it builds the code graph that powers all subsequent operations. β‘ PERFORMANCE: Expensive operation (10-60s for large codebases) - results are cached for subsequent tool calls. Progress is shown during analysis. π WORKFLOW: analyze_codebase β specific analysis tools (find_definition, complexity_analysis, etc.) β insights and recommendations. π‘ TIP: Use rebuild_graph=true only if code has changed significantly since last analysis. |
| find_definitionA | π― Find the definition location of a symbol (function, class, variable, method). π― PURPOSE: Locates where a symbol is originally defined, providing file path, line number, and context. π§ USAGE: Use after analyze_codebase when you need to understand where a specific symbol is implemented. β‘ PERFORMANCE: Fast operation (sub-second) - leverages cached code graph for instant lookups. π WORKFLOW: analyze_codebase β find_definition β examine definition context β find_references/find_callers for usage patterns. π‘ TIP: Works with partial names - 'MyClass' will find 'MyClass', 'MyClassImpl', etc. Use exact names for precision. |
| find_referencesA | π Find all references to a symbol throughout the codebase. π― PURPOSE: Discovers everywhere a symbol is used, imported, or referenced, showing usage patterns and dependencies. π§ USAGE: Use after find_definition to understand how a symbol is used across the codebase. β‘ PERFORMANCE: Fast operation (1-3s) - efficiently searches the indexed code graph. π WORKFLOW: find_definition β find_references β analyze usage patterns β complexity_analysis for refactoring insights. π‘ TIP: Essential for impact analysis before refactoring - shows all code that would be affected by changes. |
| find_callersA | π Find all functions that call the specified function. π― PURPOSE: Identifies the call hierarchy - which functions depend on the target function, essential for understanding code dependencies. π§ USAGE: Use when analyzing function dependencies, planning refactoring, or understanding code flow patterns. β‘ PERFORMANCE: Fast operation (1-2s) - uses pre-built call graph for efficient traversal. π WORKFLOW: find_definition β find_callers β analyze call patterns β find_callees for complete dependency picture. π‘ TIP: Crucial for refactoring - shows all functions that would break if you change the target function's signature. |
| find_calleesA | π± Find all functions called by the specified function. π― PURPOSE: Maps function dependencies - what other functions does the target function rely on, revealing complexity and coupling. π§ USAGE: Use to understand function complexity, identify potential extraction opportunities, or analyze dependency chains. β‘ PERFORMANCE: Fast operation (1-2s) - leverages indexed call relationships for instant results. π WORKFLOW: find_definition β find_callees β complexity_analysis β identify refactoring opportunities. π‘ TIP: High callee count often indicates functions that are doing too much and could benefit from decomposition. |
| complexity_analysisA | π Analyze code complexity and identify refactoring opportunities. π― PURPOSE: Calculates cyclomatic complexity, identifies code smells, and suggests specific refactoring opportunities with priority rankings. π§ USAGE: Use after basic analysis to identify problematic code areas that need attention. Essential for code quality assessment. β‘ PERFORMANCE: Moderate operation (5-15s) - analyzes complexity metrics across the entire codebase. π WORKFLOW: analyze_codebase β complexity_analysis β examine high-complexity functions β find_callers/find_callees for refactoring impact. π‘ TIP: Start with threshold=15 for critical issues, lower to 10 for comprehensive analysis. Focus on functions with complexity >20 first. |
| dependency_analysisA | π Analyze module dependencies and import relationships. π― PURPOSE: Maps module interdependencies, identifies circular dependencies, and reveals architectural patterns and potential issues. π§ USAGE: Use for architectural analysis, identifying tightly coupled modules, or planning module restructuring. β‘ PERFORMANCE: Moderate operation (3-10s) - analyzes import relationships and builds dependency graph. π WORKFLOW: analyze_codebase β dependency_analysis β identify problematic dependencies β complexity_analysis for detailed insights. π‘ TIP: Look for circular dependencies and modules with high fan-in/fan-out ratios - these often indicate architectural problems. |
| project_statisticsA | π Get comprehensive project statistics and health metrics. π― PURPOSE: Provides high-level project overview including file counts, language distribution, complexity trends, and overall health score. π§ USAGE: Use for project assessment, progress tracking, or generating project reports. Great for understanding project scale and characteristics. β‘ PERFORMANCE: Fast operation (1-3s) - aggregates pre-calculated metrics from the code graph. π WORKFLOW: analyze_codebase β project_statistics β drill down with specific analysis tools based on findings. π‘ TIP: Use regularly to track code quality trends over time. Health score below 7/10 indicates areas needing attention. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 9 tools
Each tool targets a distinct aspect of code analysis: setup, stats, symbol lookup, references, callers/callees, complexity, and dependencies. There is no meaningful overlap that would cause an agent to confuse one tool for another.
Most tools follow a verb_noun pattern (find_definition, analyze_codebase, get_usage_guide), but a few use noun_analysis (complexity_analysis, dependency_analysis) or noun_noun (project_statistics). While the pattern is not perfectly uniform, the conventions are consistent within functional subgroups (find_* and *_analysis), keeping it readable and predictable.
With 9 tools, the server is well-scoped for its purpose of code graph analysis. Each tool serves a clear role, from graph construction to querying definitions, references, dependencies, and complexityβno redundancy or excessive granularity.
The tool set covers the full lifecycle of code analysis: building the graph (analyze_codebase), high-level stats (project_statistics), symbol navigation (find_definition, find_references), call hierarchy (find_callers, find_callees), and deeper analysis (complexity_analysis, dependency_analysis). There are no obvious missing operations for the stated domain.