What is CodeGraphContext?
CodeGraphContext is an MCP server that indexes local source code into a Neo4j graph database to provide structured code context to AI assistants. It is designed for developers who want to enable their AI tools to understand code relationships, dependencies, and call chains across a codebase.
How to use CodeGraphContext?
Install with pip install codegraphcontext, then run cgc setup for an interactive wizard that configures the Neo4j database connection and optionally sets up supported IDEs (VS Code, Cursor, Claude, etc.). After setup, start the server with cgc start. The server is then ready to accept natural language commands from an MCP client (e.g., Claude, VS Code) to index, query, and analyze code.
Key features of CodeGraphContext
- Code Indexing: Analyzes code and builds a knowledge graph of its components.
- Relationship Analysis: Query for callers, callees, class hierarchies, and call chains.
- Live Updates: Watches local files for changes and automatically updates the graph.
- Interactive Setup: A user-friendly command-line wizard for easy configuration.
- File Ignoring: Supports
.cgcignore files to exclude specific files and directories.
Use cases of CodeGraphContext
- Static code analysis in AI assistants
- Graph-based visualization of projects
- Dead code and complexity detection
- Impact analysis before making code changes
- Debugging by tracing execution paths across hundreds of files
Comments