CodeGraphContext
An MCP server and CLI toolkit that indexes local code into a graph database to give AI assistants and developers queryable repository context.
At a Glance
CLI toolkit and MCP server released under the MIT License; free to use, copy, modify and distribute.
Engagement
Available On
Alternatives
Listed Nov 2026
About CodeGraphContext
CodeGraphContext (CGC) is an open-source MCP server and CLI toolkit created by Shashank Shekhar Singh. It parses source code into a graph of files, symbols, calls, inheritance and imports, then exposes that graph to developers through the command line and to AI assistants through the Model Context Protocol. It is installed with pip and released under the MIT License.
What It Is
CGC indexes a local repository with Tree-sitter (and optional SCIP indexers for more accurate calls and inheritance in some languages) and stores the result in a graph database. You can query it directly with commands such as cgc index, cgc list and cgc analyze, or start the MCP server so an AI assistant can ask structural questions in plain English, such as who calls a function or what a class inherits from.
How the Workflow Works
After pip install codegraphcontext, cgc index . builds the graph for the current project. Analysis commands cover callers, call chains, class hierarchies, dead code and cyclomatic complexity. cgc watch keeps the graph updated as files change, and a .cgcignore file (gitignore syntax) excludes paths. Graphs can be visualized as interactive standalone HTML explorers, and a web explorer on the project site can scan a public GitHub or GitLab repository.
MCP Server Mode
cgc mcp setup is a wizard that configures supported clients, including VS Code, Cursor, Windsurf, Zed, Claude, Gemini CLI, ChatGPT Codex, Cline, RooCode, Amazon Q Developer, Kiro, Goose and OpenCode. cgc mcp start then launches the server. An opt-in GCF output format is documented as reducing tool response tokens.
Databases, Languages and Bundles
FalkorDB Lite is the default backend on Unix with Python 3.12+; KuzuDB, LadybugDB, remote FalkorDB, Nornic DB and Neo4j are also supported. The README lists 23 supported languages, including Python, JavaScript, TypeScript, Java, C/C++, C#, Go, Rust and HCL. Pre-indexed .cgc bundles for popular repositories can be loaded without re-indexing. A Docker image is available for running without a local Python install.
Community Discussions
Be the first to start a conversation about CodeGraphContext
Share your experience with CodeGraphContext, ask questions, or help others learn from your insights.
Pricing
Open Source (MIT)
CLI toolkit and MCP server released under the MIT License; free to use, copy, modify and distribute.
- MIT License
- CLI toolkit and MCP server
- Indexes local code into a graph database (FalkorDB Lite default on Unix/WSL; KuzuDB, LadybugDB, Neo4j also supported)
- Live file watching updates
- Self-hosted; installed via pip install codegraphcontext
Capabilities
Key Features
- Code indexing into a knowledge graph via Tree-sitter and optional SCIP
- Caller, callee, class hierarchy and call-chain analysis
- Dead code and cyclomatic complexity detection
- Live file watching with automatic graph updates
- MCP server for AI assistants
- Interactive graph visualization
- Pre-indexed .cgc bundles
- Support for 23 programming languages
- Multiple graph database backends
- Interactive setup wizard
- Docker image
- Optional token-optimized GCF output format
- Ignore files via .cgcignore
Integrations
Demo Video

