Code Graph RAG▌
by er77
Code Graph RAG enables advanced code analysis with graph traversal, semantic search, and multi-language support for smar
Provides advanced code graph analysis through specialized agents for parsing, indexing, querying, and semantic search across codebases with Tree-sitter parsing for multiple languages, SQLite vector storage, and hybrid search combining structural graph traversal with semantic similarity for code review workflows, refactoring analysis, and natural language codebase understanding.
Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.
best for
- / Code review and refactoring analysis
- / Understanding large unfamiliar codebases
- / Developer onboarding and documentation
- / Codebase exploration and dependency analysis
capabilities
- / Parse and index codebases in 11+ programming languages
- / Query code structure using natural language
- / Search for functions, classes, and dependencies semantically
- / Analyze code relationships and call graphs
- / Generate graph visualizations of codebase architecture
- / Perform hybrid search combining structural and semantic matching
what it does
Analyzes codebases across 11 programming languages using Tree-sitter parsing and creates a semantic knowledge graph stored in SQLite. Enables natural language queries about code structure, relationships, and functionality with hybrid search combining graph traversal and vector similarity.
about
Code Graph RAG is a community-built MCP server published by er77 that provides AI assistants with tools and capabilities via the Model Context Protocol. Code Graph RAG enables advanced code analysis with graph traversal, semantic search, and multi-language support for smar It is categorized under developer tools.
how to install
You can install Code Graph RAG in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
Code Graph RAG is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
Code Graph RAG MCP Server
Sponsor https://accelerator.slider-ai.ru/
Advanced Multi-Language Code Analysis with Semantic Intelligence
A powerful Model Context Protocol server that creates intelligent graph representations of your codebase with comprehensive semantic analysis capabilities.
🌟 11 Languages Supported | ⚡ 5.5x Faster | 🔍 Semantic Search | 📊 26 MCP Methods
🚀 Quick Start
Installation
LATEST VERSION ONLY FROM GitHub Realeases
do not use npm repository any more
# Install globally
npm install -g ./er77-code-graph-rag-mcp-2.7.12.tgz
code-graph-rag-mcp --version
Claude Desktop Integration
# Quick setup (recommended)
npx @modelcontextprotocol/inspector add code-graph-rag \
--command "npx" \
--args "@er77/code-graph-rag-mcp /path/to/your/codebase"
or
#
claude mcp add-json code-graph-rag ' {
"command": "npx",
"args": ["@er77/code-graph-rag-mcp", "/_work_fodler"],
"env": {
"MCP_TIMEOUT": "80000"
}
}
Manual setup: Add to Claude Desktop config → See detailed instructions
Gemini CLI Integration
# Example
gemini mcp add-json code-graph-rag '{
"command": "npx",
"args": ["@er77/code-graph-rag-mcp", "/path/to/your/codebase"]
}'
Codex CLI Integration
# Recommended: add a *global* MCP server entry (works from any project folder)
codex mcp remove code-graph-rag # optional cleanup
codex mcp add code-graph-rag -- code-graph-rag-mcp
# Or point Codex directly at a local dev build (no npm/npx required)
codex mcp remove code-graph-rag # optional cleanup
codex mcp add code-graph-rag -- node /absolute/path/to/code-graph-rag-mcp/dist/index.js
Multi-codebase support: Analyze multiple projects simultaneously → Multi-Codebase Setup Guide
Installation Guide (All Clients)
- NPM:
npm install -g @er77/code-graph-rag-mcp - Run server locally:
code-graph-rag-mcp [directory] - Claude: use Inspector (above) or see Quick Start
- Gemini: configure via
gemini mcp add-json ...(above) - Codex: configure via
codex mcp add ...(above)
🏆 Performance
5.5x faster than Native Claude tools with comprehensive testing results:
| Metric | Native Claude | MCP CodeGraph | Improvement |
|---|---|---|---|
| Execution Time | 55.84s | <10s | 5.5x faster |
| Memory Usage | Process-heavy | 65MB | Optimized |
| Features | Basic patterns | 26 methods | Comprehensive |
| Accuracy | Pattern-based | Semantic | Superior |
🔍 Key Features
🔬 Advanced Analysis Tools (26 MCP Methods)
| Feature | Description | Use Case |
|---|---|---|
| Semantic Search | Natural language code search | "Find authentication functions" |
| Code Similarity | Duplicate & clone detection | Identify refactoring opportunities |
| JSCPD Clone Scan | JSCPD-based copy/paste detection without embeddings | Targeted duplicate sweeps |
| Impact Analysis | Change impact prediction | Assess modification risks |
| AI Refactoring | Intelligent code suggestions | Improve code quality |
| Hotspot Analysis | Complexity & coupling metrics | Find problem areas |
| Cross-Language | Multi-language relationships | Polyglot codebases |
| Graph Health | Database diagnostics | get_graph_health |
| Version Info | Server version & runtime details | get_version |
| Safe Reset | Clean reindexing | reset_graph, clean_index |
| Batched Indexing | Resumable indexing with progress (Codex-safe for big repos) | batch_index |
| Agent Telemetry | Runtime metrics across agents | get_agent_metrics |
| Bus Diagnostics | Inspect/clear knowledge bus topics | get_bus_stats, clear_bus_topic |
| Lerna Project Graph | Workspace dependency DAG export, optional ingest, cached refresh control | lerna_project_graph (requires Lerna config) |
| Semantic Warmup | Configurable cache priming for embeddings | mcp.semantic.cacheWarmupLimit |
⚡ High-Performance Architecture
| Metric | Capability | Details |
|---|---|---|
| Parsing Speed | 100+ files/second | Tree-sitter based |
| Query Response | <100ms | Optimized SQLite + vector search |
| Agent System | Multi-agent coordination | Resource-managed execution |
| Vector Search | Hardware-accelerated (optional) | Automatic embedding ingestion |
| AST Analysis | Precise code snippets | Semantic context extraction |
🌐 Multi-Language Support (11 Languages)
| Language | Features | Support Level |
|---|---|---|
| Python | Async/await, decorators, magic methods (40+), dataclasses | ✅ Advanced (95%) |
| TypeScript/JavaScript | Full ES6+, JSX, TSX, React patterns | ✅ Complete (100%) |
| C/C++ | Functions, structs/unions/enums, classes, namespaces, templates | ✅ Advanced (90%) |
| C# | Classes, interfaces, enums, properties, LINQ, async/await | ✅ Advanced (90%) |
| Rust | Functions, structs, enums, traits, impls, modules, use | ✅ Advanced (90%) |
| Go | Packages, functions, structs, interfaces, goroutines, channels | ✅ Advanced (90%) |
| Java | Classes, interfaces, enums, records (Java 14+), generics, lambdas | ✅ Advanced (90%) |
| Kotlin | Packages/imports, classes/objects, functions/properties, relationships | ✅ Implemented |
| VBA | Modules, subs, functions, properties, user-defined types | ✅ Regex-based (80%) |
🛠️ Usage Examples
# Single project analysis
code-graph-rag-mcp
code-graph-rag-mcp /path/to/your/project
# CLI helpers
code-graph-rag-mcp --help
code-graph-rag-mcp --version
# Multi-project setup (see Multi-Codebase Setup Guide)
# Configure multiple projects in Claude Desktop config
# Check installation
code-graph-rag-mcp --help
# Health & maintenance
# Health check (totals + sample)
get_graph_health
# Reset graph data safely
reset_graph
# Clean reindex (reset + full index)
clean_index
# Batched index with progress (recommended for strict clients/timeouts)
batch_index
# Lerna workspace graph (ingest into storage)
lerna_project_graph --args '{"ingest": true}'
# Force refresh graph and re-ingest (bypass cache)
lerna_project_graph --args '{"ingest": true, "force": true}'
# Cached runs return `cached: true`; use `force` to break the 30s debounce when configs change.
# Agent telemetry snapshot
get_agent_metrics
# Knowledge bus diagnostics
get_bus_stats
clear_bus_topic --args '{"topic": "semantic:search"}'
# One-shot index from the CLI (debug mode)
node dist/index.js /home/er77/tt '{"jsonrpc":"2.0","id":"index-1","method":"tools/call","params":{"name":"index","arguments":{"directory":"/home/er77/tt","incremental":false,"fullScan":true,"reset":true}}}'
# Relationships for an entity name
list_entity_relationships (entityName: "YourEntity", relationshipTypes: ["imports"])
# Adjust semantic warmup (optional)
export MCP_SEMANTIC_WARMUP_LIMIT=25
# Note: when an agent is saturated, `AgentBusyError` responses include `retryAfterMs` hints.
With Claude Desktop:
- "What entities are in my codebase?"
- "Find similar code to this function"
- "Analyze the impact of changing this class"
- "Suggest refactoring for this file"
Multi-Project Queries:
- "Analyze the frontend-app codebase structure"
- "Find authentication functions in backend-api"
- "Compare user management across all projects"
🧰 Troubleshooting
-
Codex/VSCode MCP stdio fails to start
Codex is strict about stdio:stdoutmust be JSON-RPC only. As of v2.7.12, console stdout logs are redirected tostderrduring MCP runs, and heavy initialization is deferred until after handshake / first tool call.
Recommended Codex config: omit the directory argument and let the server use the workspace root viaroots/list:[mcp_servers.code-graph-rag] command = "code-graph-rag-mcp" args = []If
index/clean_indextime out on large repos and the transport closes, preferbatch_indexwith a smallmaxFilesPerBatchand keep calling it with the returnedsessionIduntildone:true. If you must see logs on stdout for local debugging, setMCP_STDIO_ALLOW_STDOUT_LOGS=1(not recommended for strict clients). If startup still fails, check the global tmp log mirror:/tmp/code-graph-rag-mcp/mcp-server-YYYY-MM-DD.log(Linux/macOS; usesos.tmpdir()). -
batch_indexfails withagent_busy/memory_limit
Increase the coordinator/conductor limits (these gate task routing in-process): setCOORDINATOR_MEMORY_LIMIT/CONDUCTOR_MEMORY_LIMITandCOORDINATOR_MAX_MEMORY_MB/CONDUCTOR_MAX_MEMORY_MB, or editconfig/default.yaml.
If you see a real Node.js OOM, also start the server with a larger heap, e.g.NODE_OPTIONS="--max-old-space-size=4096" code-graph-rag-mcp. -
Database location / multi-repo isolation By default, the server stores its SQLite DB under
./.code-graph-rag/vectors.db(per repo). Add/.code-graph-rag/to your project’s.gitignore. -
Native module mismatch (
better-sqlite3)
Since v2.6.4 the server automatically rebuilds the native binary when it detects aNODE_MODULE_VERSIONmismatch. If the automatic rebuild fails (for example due to file permissions), run:npm rebuild better-sqlite3in the installation directory (globally this is commonly
/usr/lib/node_modules/@er77/code-graph-rag-mcp). -
Legacy database missing new columns
Older installations might lack the latest `embe
FAQ
- What is the Code Graph RAG MCP server?
- Code Graph RAG is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for Code Graph RAG?
- This profile displays 28 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.6 out of 5—verify behavior in your own environment before production use.
Use Cases▌
Extended AI Capabilities
Add new capabilities to Claude beyond text generation
Example
Access external data sources, execute code, interact with tools and services
Transform Claude from chatbot to action-taking agent
Context Enhancement
Provide Claude with access to relevant context and data
Example
Load project documentation, access knowledge bases, query databases
Get more accurate, context-aware responses
Workflow Automation
Automate multi-step workflows combining AI and external tools
Example
Research → Summarize → Create document → Send notification
Complete complex tasks end-to-end without manual steps
Implementation Guide▌
Prerequisites
- ›Claude Desktop 0.7.0+ or Cursor IDE with MCP support
- ›Basic understanding of MCP architecture and capabilities
- ›Access credentials for integrated services (if required)
- ›Willingness to experiment and iterate on configuration
Time Estimate
15-60 minutes depending on server complexity
Installation Steps
- 1.Install MCP server: npm install -g [package-name] or via GitHub
- 2.Add server configuration to ~/.claude/mcp.json
- 3.Provide required credentials and configuration
- 4.Restart Claude Desktop to load new server
- 5.Test basic functionality with simple prompts
- 6.Explore capabilities and experiment with use cases
- 7.Document successful patterns for reuse
Troubleshooting
- ⚠MCP server not loading: Check config syntax, verify installation
- ⚠Connection errors: Check network, firewall, credentials
- ⚠Feature not working: Read server docs, check required parameters
- ⚠Performance issues: Monitor resource usage, check for network latency
- ⚠Conflicts with other servers: Check port assignments, namespace collisions
Best Practices▌
✓ Do
- +Read server documentation thoroughly before setup
- +Start with simple use cases to validate functionality
- +Test in non-production environment first
- +Monitor resource usage and performance
- +Keep servers updated for bug fixes and new features
- +Document configuration for team members
- +Use environment variables for sensitive configuration
✗ Don't
- −Don't grant overly permissive access to MCP servers
- −Don't skip reading security considerations in docs
- −Don't expose sensitive data without proper controls
- −Don't run untrusted MCP servers without code review
- −Don't ignore error messages—investigate root cause
💡 Pro Tips
- ★Combine multiple MCP servers for powerful workflows
- ★Create custom MCP servers for your specific needs
- ★Share successful configurations with team
- ★Use MCP inspector for debugging
- ★Join MCP community for tips and troubleshooting
Technical Details▌
Architecture
Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.
Protocols
- Model Context Protocol (MCP)
- JSON-RPC 2.0
- stdio or HTTP transport
Compatibility
- Claude Desktop
- Cursor IDE
- Custom MCP clients
When to Use This▌
✓ Use When
Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.
✗ Avoid When
Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.
Integration▌
- →Tool composition: Chain multiple MCP tools in workflows
- →Context augmentation: Provide AI with relevant external data
- →Action delegation: Let AI execute tasks on external systems
- →Bidirectional sync: Keep AI context and external systems in sync
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
List & Promote Your MCP Server
Share your MCP server with the developer community
Ratings
4.6★★★★★28 reviews- ★★★★★Daniel Garcia· Dec 16, 2024
We evaluated Code Graph RAG against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★Layla Martin· Nov 7, 2024
Code Graph RAG has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Arya Shah· Oct 26, 2024
Code Graph RAG is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Oshnikdeep· Sep 17, 2024
Code Graph RAG is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.
- ★★★★★Kaira Okafor· Sep 9, 2024
We evaluated Code Graph RAG against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★Aditi Sanchez· Sep 5, 2024
I recommend Code Graph RAG for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Kaira Tandon· Aug 28, 2024
We wired Code Graph RAG into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Yusuf Thomas· Aug 24, 2024
According to our notes, Code Graph RAG benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Ganesh Mohane· Aug 8, 2024
Code Graph RAG has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Rahul Santra· Jul 27, 2024
We evaluated Code Graph RAG against two servers with overlapping tools; this profile had the clearer scope statement.
showing 1-10 of 28