
CodeRAG
An MCP server that transforms codebases into knowledge graphs using Neo4J, enabling AI assistants to understand code structure, relationships, and metrics for more context-aware assistance.
README
CodeRAG - Graph-Powered Code Analysis
Transform your codebase into an intelligent knowledge graph for AI-powered insights
CodeRAG is a revolutionary tool that builds a comprehensive graph database of your code structure using Neo4J. By mapping classes, methods, relationships, and dependencies, it enables AI assistants to understand your codebase at a deeper level and provide more accurate, context-aware assistance.
What CodeRAG Does
🔍 Smart Code Scanning - Automatically analyzes your codebase and builds a detailed graph of all classes, methods, interfaces, and their relationships
📊 Quality Insights - Calculates industry-standard metrics (CK metrics, package coupling, architectural patterns) to identify code smells and improvement opportunities
🤖 AI Integration - Connects seamlessly with AI coding assistants through the Model Context Protocol (MCP), giving them deep understanding of your code structure
🏗️ Architecture Analysis - Visualizes inheritance hierarchies, dependency chains, and architectural patterns to help you understand complex codebases
Perfect For
- Code Reviews - Get AI assistance that understands your entire codebase context
- Onboarding - Help new team members quickly understand large, complex projects
- Refactoring - Identify tightly coupled code, circular dependencies, and architectural issues
- Documentation - Generate insights about code relationships and design patterns
- Legacy Analysis - Map and understand inherited codebases with complex structures
Supported Languages
- TypeScript & JavaScript
- Java
- Python
- C# (coming soon)
Quick Start
Get up and running in 5 minutes:
-
Clone and Install
git clone https://github.com/JonnoC/CodeRAG.git cd CodeRAG npm install
-
Setup Neo4J Database (see our detailed guide for help)
# Using Docker (easiest) docker run --name neo4j-coderag -p 7474:7474 -p 7687:7687 -d \ --env NEO4J_AUTH=neo4j/your_password neo4j:5.12
-
Configure Environment
cp .env.example .env # Edit .env with your Neo4J credentials
-
Scan Your First Project
npm run build npm run scan /path/to/your/project
-
Connect to Your AI Assistant
Add to your AI tool's MCP configuration:
{ "mcpServers": { "coderag": { "command": "node", "args": ["/path/to/CodeRAG/build/index.js"] } } }
📖 Read the Complete User Guide for detailed setup instructions, AI tool integrations, and advanced usage.
Key Features
- 🔧 Automated Scanning - Parses TypeScript, JavaScript, Java, and Python projects
- 🎯 Smart Analysis - Identifies classes, methods, interfaces, inheritance, and dependencies
- 📈 Quality Metrics - CK metrics, package coupling, architectural issue detection
- 🤖 AI-Ready - Integrates with Claude Code, Windsurf, Cursor, VS Code Continue, and more
- 💡 Guided Prompts - Interactive workflows for code analysis and exploration
- 🔄 Dual Modes - STDIO for direct AI integration, HTTP for web-based tools
Example Use Cases
🕵️ Code Investigation
"Show me all the classes that call the authenticate
method"
Use find_classes_calling_method with method_name="authenticate"
🏗️ Architecture Review
"What are the architectural issues in this codebase?"
Use find_architectural_issues to detect circular dependencies, god classes, and high coupling
📊 Quality Assessment
"How complex is my UserService class?"
Use calculate_ck_metrics for class_id="com.example.UserService"
🔍 Dependency Analysis
"What does this class depend on and what depends on it?"
Use the find_dependencies prompt for interactive guidance
Common Commands
# Quick project scan
npm run scan /path/to/project
# Start for AI assistant integration
npm start
# Run quality analysis
npm run scan /path/to/project -- --analyze
# Start web server for HTTP access
npm start -- --sse --port 3000
Documentation
📚 Complete User Guide - Detailed setup, integrations, and workflows
Contributing
Contributions welcome! Please read our contributing guidelines and submit pull requests to help improve CodeRAG.
License
MIT - see LICENSE for details.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.