CodeGraphContext/CodeGraphContext
An MCP server plus a CLI tool that indexes local code into a graph database to provide context to AI assistants.
What it solves
CodeGraphContext (CGC) addresses the limitation of plain text search and simple RAG (Retrieval-Augmented Generation) when analyzing large codebases. While grep or chunk-based retrieval can find strings, they often miss the structural relationships—such as call chains, class hierarchies, and module boundaries—that are essential for deep repository-wide reasoning.
How it works
CGC parses source code using Tree-sitter and optional SCIP indexers to extract symbols, functions, classes, and their relationships. It then stores this data in a graph database (supporting backends like FalkorDB, KuzuDB, or Neo4j). This structured knowledge graph can then be queried via a standalone CLI toolkit for developers or exposed to AI assistants through a Model Context Protocol (MCP) server, allowing AI agents to understand the actual connectivity of the code.
Who it’s for
It is designed for developers and AI agent creators who need to perform complex code analysis, such as tracing call chains across files, identifying dead code, or providing AI assistants with high-precision structural context of a repository.
Highlights
- Dual Mode: Operates as both a CLI toolkit for manual analysis and an MCP server for AI agents.
- Multi-Language Support: Supports 23 programming languages, including Python, JS/TS, Java, C++, Rust, and Solidity.
- Flexible Backends: Compatible with multiple graph databases, including embedded options for zero-config local setup.
- Live Watching: Automatically updates the graph in real-time as files change using
cgc watch. - Pre-indexed Bundles: Allows instant loading of famous repositories via
.cgcbundles without needing to re-index.
Related
- Project
- Project
- Project
- Project
- Project