CodeGraphContext
An MCP server plus a CLI tool that indexes local code into a graph database to provide context to AI assistants.
CodeGraphContext is an MCP server and CLI toolkit that indexes local code repositories into a queryable graph database, enabling AI assistants to understand code structure and relationships. It parses source code using Tree-sitter and optional SCIP indexers to build comprehensive knowledge graphs of functions, classes, imports, calls, and inheritance across 23 programming languages. Developers can query the graph directly via CLI commands or connect it to AI assistants through MCP for natural-language code exploration. The tool supports multiple embedded and remote graph databases including FalkorDB Lite, KuzuDB, and Neo4j, making it suitable for both local development and enterprise-scale analysis.
Key Features
Use Cases
- 01Trace multi-layer call chains and understand execution flow from entry points to specific functions across large codebases
- 02Perform impact analysis by identifying all code affected by changes to a core function or class
- 03Enable AI assistants to answer natural-language questions about code structure, dependencies, and relationships
- 04Find dead code, detect unused imports, and identify high-complexity functions for refactoring
- 05Understand class hierarchies, interface implementations, and inheritance relationships in object-oriented projects
- 06Visualize code architecture and relationships through interactive, searchable knowledge graphs
Related MCP Servers
View moremarkitdown
Python tool for converting files and office documents to Markdown.
firecrawl
The context API to search, scrape, and interact with the web at scale. 🔥
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
langflow
Langflow is a powerful tool for building and deploying AI-powered agents and workflows.
CodeGraphContext — FAQ
What is CodeGraphContext?+
CodeGraphContext is an MCP server and CLI tool that parses local code repositories into a graph database, extracting relationships between functions, classes, calls, and imports. It enables both direct querying via CLI and AI assistant integration through the Model Context Protocol.
How do I install CodeGraphContext?+
Install via pip with 'pip install codegraphcontext', then run 'cgc index .' to index your first repository. For MCP server mode, run 'cgc mcp setup' to configure your AI client, then 'cgc mcp start' to launch the server.
Which AI clients work with CodeGraphContext?+
CodeGraphContext supports VS Code, Cursor, Windsurf, Zed, Claude Desktop, Gemini CLI, ChatGPT Codex, Cline, RooCode, Amazon Q Developer, Kiro, Goose, and OpenCode. The setup wizard can auto-configure most of these clients.
Do I need API keys or external services?+
No external services or API keys are required for basic operation. CodeGraphContext uses embedded databases (FalkorDB Lite or KuzuDB) by default. Optional SCIP indexing for C/C++ requires a compile_commands.json file but no API keys.
Is CodeGraphContext free to use?+
Yes, CodeGraphContext is open source under the MIT License and completely free to use. All core features work with embedded databases at no cost.
What programming languages are supported?+
CodeGraphContext supports 23 languages including Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, Dart, Scala, Haskell, Elixir, Solidity, and more. Each language parser extracts functions, classes, calls, and relationships.
How do I install CodeGraphContext?+
Open the source repository on GitHub and follow its README. CodeGraphContext is a mcp server — MCP Agents Market links you directly to the official repo.
Is CodeGraphContext free?+
CodeGraphContext is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.