code-graph-rag
The ultimate RAG for your monorepo. Query, understand, and edit multi-language codebases with the power of AI and knowledge graphs
claude mcp add --transport stdio vitali87-code-graph-rag uvx vitali87/code-graph-rag sync \ --env UVX_HOST="http://localhost" \ --env UVX_PORT="11434" \ --env UVX_LOG_LEVEL="info"
How to use
Code-Graph-RAG exposes a retrieval-augmented generation workflow for codebases. Once running through the MCP interface, you can query the codebase knowledge graph, fetch relevant functions, classes, and modules, and even edit code using AST-aware operations. The system supports multiple languages via Tree-sitter parsing and stores data in Memgraph, enabling natural language questions like 'show me all functions related to authentication' or 'update the error handling pattern in login flow' and returning both high-level results and exact code snippets. In addition, you can execute shell-like tasks, generate Cypher queries for graph exploration, and leverage AI-assisted code optimizations or refactors. The MCP integration with Claude Code lets you issue natural language commands to inspect or modify the repository, then apply surgical changes with previews.
How to install
Prerequisites:
- Python 3.12+ and uv (Python package manager) installed
- Git installed
- Optional: Docker and Docker Compose for Memgraph-based setups
- Clone the repository and enter the project:
git clone https://github.com/vitali87/code-graph-rag.git
cd code-graph-rag
- Install dependencies for Python/uv workflow (basic Python support):
uv sync
- For full multi-language support (recommended):
uv sync --extra treesitter-full
- Install development tools (optional but recommended):
make dev
- Copy and configure environment variables:
cp .env.example .env
Edit .env with the appropriate settings (endpoints, model providers, API keys, etc.).
- Run the MCP-enabled server via uvx (as described in the MCP config):
uvx vitali87/code-graph-rag sync
- Verify the server is running and accessible on the configured port, then connect via Claude Code or your MCP client to start querying and editing codebases.
Additional notes
Tips and notes:
- Ensure Python 3.12+ is installed and that uv is available in your PATH.
- If you plan to use cloud models (OpenAI/Google Gemini), provide the necessary API keys in the environment (.env) as documented in the config section of the repository.
- For locally hosted models, you need Ollama or equivalent as per the project prerequisites.
- Docker-based Memgraph setups require Docker and Docker Compose; ensure the Memgraph service is up before starting queries.
- The environment variables in the MCP config example provide sensible defaults; adjust LOG level, host, and port as needed.
- When running in development, you can rely on the provided Makefile targets for pre-commit hooks and tests.
- If you encounter synchronization issues with Tree-sitter grammars, re-run the sync step or use uv sync --extra treesitter-full to ensure full grammars are installed.
Related MCP Servers
claude-code-plugins-plus-skills
270+ Claude Code plugins with 739 agent skills. Production orchestration patterns, interactive tutorials (11 Jupyter notebooks), and CCPI package manager. 4.13.0
claude-code-open
Open source AI coding platform with Web IDE, multi-agent system, 37+ tools, MCP protocol. MIT licensed.
CodeMCP
Code intelligence for AI assistants - MCP server, CLI, and HTTP API with symbol navigation, impact analysis, and architecture mapping
MegaMemory
Persistent project knowledge graph for coding agents. MCP server with semantic search, in-process embeddings, and web explorer.
ummon
The semantic layer for software engineering: Connect code to meaning, build on understanding
mie
Persistent memory graph for AI agents. Facts, decisions, entities, and relationships that survive across sessions, tools, and providers. MCP server — works with Claude, Cursor, ChatGPT, and any MCP client.