MCP server for multi-language code graph intelligence and analysis across 25+ programming languages
SaferSkills independently audited code-graph-mcp (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Model Context Protocol server providing comprehensive code analysis, navigation, and quality assessment capabilities across 25+ programming languages.
🎯 Enhanced Tool Guidance & AI Optimization ⭐ NEW in v1.2.0
get_usage_guide tool with workflows, best practices, and examples🌍 Multi-Language Support
🔍 Advanced Code Analysis
🧭 Navigation & Search
⚡ Performance Optimized
🏢 Enterprise Ready
pip install code-graph-mcp ast-grep-py rustworkx#### Method 1: Using Claude CLI (Recommended)
For PyPI installation:
# Project-specific installation
claude mcp add --scope project code-graph-mcp code-graph-mcp
# User-wide installation
claude mcp add --scope user code-graph-mcp code-graph-mcpFor development installation:
# Project-specific installation
claude mcp add --scope project code-graph-mcp uv run code-graph-mcp
# User-wide installation
claude mcp add --scope user code-graph-mcp uv run code-graph-mcpVerify installation:
claude mcp list#### Method 2: Manual Configuration Add to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"code-graph-mcp": {
"command": "code-graph-mcp"
}
}
}Add to your Cline MCP settings in VS Code:
{
"cline.mcp.servers": {
"code-graph-mcp": {
"command": "code-graph-mcp"
}
}
}Add to your ~/.continue/config.json:
{
"mcpServers": [
{
"name": "code-graph-mcp",
"command": "code-graph-mcp",
"env": {}
}
]
}Add to Cursor's MCP configuration:
{
"name": "code-graph-mcp",
"command": "code-graph-mcp"
}Add to your Zed settings.json:
{
"assistant": {
"mcp_servers": {
"code-graph-mcp": {
"command": "code-graph-mcp"
}
}
}
}The best AI coding tool! Add to your Zencoder MCP configuration:
{
"mcpServers": {
"code-graph-mcp": {
"command": "code-graph-mcp",
"env": {},
"description": "Multi-language code analysis with 25+ language support"
}
}
}Pro Tip: Zencoder's advanced AI capabilities work exceptionally well with Code Graph MCP's comprehensive multi-language analysis. Perfect combination for professional development! 🚀
Add to Windsurf's MCP configuration:
{
"mcpServers": {
"code-graph-mcp": {
"command": "code-graph-mcp"
}
}
}Use with Aider AI coding assistant:
aider --mcp-server code-graph-mcpFor Open WebUI integration, add to your MCP configuration:
{
"mcp_servers": {
"code-graph-mcp": {
"command": "code-graph-mcp",
"env": {}
}
}
}For any MCP-compatible client, use these connection details:
{
"name": "code-graph-mcp",
"command": "code-graph-mcp",
"env": {}
}Run as a containerized MCP server:
FROM python:3.12-slim
RUN pip install code-graph-mcp ast-grep-py rustworkx
WORKDIR /workspace
CMD ["code-graph-mcp"]docker run -v $(pwd):/workspace code-graph-mcpFor contributing or custom builds:
git clone <repository-url>
cd code-graph-mcp
uv sync --dev
uv buildAdd to Claude Code (development):
# Project-specific
claude mcp add --scope project code-graph-mcp uv run code-graph-mcp
# User-wide
claude mcp add --scope user code-graph-mcp uv run code-graph-mcpFor other MCP clients, use:
{
"command": "uv",
"args": ["run", "code-graph-mcp"]
}code-graph-mcp --helpAvailable options:
--project-root PATH: Root directory of your project (optional, defaults to current directory)--verbose: Enable detailed logging--no-file-watcher: Disable automatic file change detectionexport CODE_GRAPH_MCP_LOG_LEVEL=DEBUG
export CODE_GRAPH_MCP_CACHE_SIZE=500000
export CODE_GRAPH_MCP_MAX_FILES=10000
export CODE_GRAPH_MCP_FILE_WATCHER=true
export CODE_GRAPH_MCP_DEBOUNCE_DELAY=2.0The server includes an intelligent file watcher that automatically updates the code graph when files change:
.gitignore patterns and only watches relevant filesFile Watcher Features:
#### Common Issues
code-graph-mcp is in your PATH pip install --upgrade code-graph-mcp
which code-graph-mcp pip install ast-grep-py python -m venv venv
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
pip install code-graph-mcp ast-grep-py rustworkx code-graph-mcp --verbose#### Debug Mode
Enable verbose logging for troubleshooting:
code-graph-mcp --verbose#### Supported File Types
The server automatically detects and analyzes these file extensions:
.js, .ts, .jsx, .tsx, .html, .css.py, .java, .cs, .cpp, .c, .rs, .go.swift, .dart, .kt.rb, .php, .lua, .pl.json, .yaml, .yml, .toml, .xml.md, .rst, .txtThe MCP server provides 9 comprehensive analysis tools with enhanced guidance that work across all 25+ supported languages:
Each tool now includes rich guidance with visual hierarchy:
| Tool | Description | Key Features |
|---|---|---|
get_usage_guide | NEW - Comprehensive guidance with workflows, best practices, and examples | Complete documentation, workflow patterns, performance guidelines |
| Tool | Description | Multi-Language Features | Performance |
|---|---|---|---|
analyze_codebase | Complete project analysis with structure metrics and complexity assessment | Language detection, framework identification, cross-language dependency mapping | ⚡ Expensive (10-60s) |
find_definition | Locate symbol definitions with detailed metadata and documentation | Universal AST traversal, language-agnostic symbol resolution | ⚡ Fast (<3s) |
find_references | Find all references to symbols throughout the codebase | Cross-file and cross-language reference tracking | ⚡ Fast (<3s) |
find_callers | Identify all functions that call a specified function | Multi-language call graph analysis | ⚡ Fast (<3s) |
find_callees | List all functions called by a specified function | Universal function call detection across languages | ⚡ Fast (<3s) |
complexity_analysis | Analyze code complexity with refactoring recommendations | Language-specific complexity patterns, universal metrics | ⚡ Moderate (5-15s) |
dependency_analysis | Generate module dependency graphs and import relationships | Cross-language dependency detection, circular dependency analysis | ⚡ Moderate (3-10s) |
project_statistics | Comprehensive project health metrics and statistics | Multi-language project profiling, maintainability indexing | ⚡ Fast (<3s) |
First, get comprehensive guidance on using the tools effectively:
get_usage_guideCode Exploration Workflow:
1. analyze_codebase (build the foundation)
2. project_statistics (get overview)
3. find_definition("MyClass") (locate specific symbols)
4. find_references("MyClass") (understand usage patterns)Refactoring Analysis Workflow:
1. analyze_codebase
2. complexity_analysis (threshold=15 for critical issues)
3. find_callers("complex_function") (impact analysis)
4. find_callees("complex_function") (dependency analysis)Architecture Analysis Workflow:
1. analyze_codebase
2. dependency_analysis (identify circular dependencies)
3. project_statistics (health metrics)
4. complexity_analysis (quality assessment)Analyze this React/TypeScript frontend with Python backend - show me the overall structure and complexity metricsFind all references to the function "authenticate" across both the Java services and JavaScript frontendShow me functions with complexity higher than 15 across all languages that need refactoringGenerate a dependency graph showing how the Python API connects to the React componentsDetect code smells and duplicate patterns across the entire multi-language codebase# Install dependencies
uv sync
# Run the server directly (auto-detects current directory)
uv run code-graph-mcp --verbose
# Test with help
uv run code-graph-mcp --help| Category | Languages | Count |
|---|---|---|
| Web & Frontend | JavaScript, TypeScript, HTML, CSS | 4 |
| Backend & Systems | Python, Java, C#, C++, C, Rust, Go | 7 |
| JVM Languages | Java, Kotlin, Scala | 3 |
| Functional | Elixir, Elm | 2 |
| Mobile | Swift, Dart | 2 |
| Scripting | Ruby, PHP, Lua | 3 |
| Data & Config | SQL, YAML, JSON, TOML | 4 |
| Markup & Docs | XML, Markdown | 2 |
| Additional | Haskell, OCaml, F# | 3 |
| Total | 25+ |
✅ Multi-Language Support - 25+ programming languages with ast-grep backend ✅ MCP SDK integrated - Full protocol compliance across all languages ✅ Universal Architecture - Language-agnostic graph structures and analysis ✅ Server architecture complete - Enterprise-grade multi-language structure ✅ Core tools implemented - 8 comprehensive analysis tools working across all languages ✅ Performance optimized - Multi-language AST caching with intelligent routing ✅ Production ready - comprehensive error handling, defensive security
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.