CodeGraphContext
@Shashankss1205
About CodeGraphContext
An MCP server that indexes local code into a graph database to provide context to AI assistants.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"CodeGraphContext": {
"command": "cgc",
"args": [
"start"
],
"env": {
"NEO4J_URI": "YOUR_NEO4J_URI",
"NEO4J_USERNAME": "YOUR_NEO4J_USERNAME",
"NEO4J_PASSWORD": "YOUR_NEO4J_PASSWORD"
},
"tools": {
"alwaysAllow": [
"add_code_to_graph",
"add_package_to_graph",
"check_job_status",
"list_jobs",
"find_code",
"analyze_code_relationships",
"watch_directory",
"find_dead_code",
"execute_cypher_query",
"calculate_cyclomatic_complexity",
"find_most_complex_functions",
"list_indexed_repositories",
"delete_repository",
"visualize_graph_query",
"list_watched_paths",
"unwatch_directory"
],
"disabled": false
},
"disabled": false,
"alwaysAllow": []
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
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
.cgcignorefiles 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
FAQ from CodeGraphContext
What dependencies does CodeGraphContext require?
The server requires Python packages including neo4j, watchdog, tree-sitter, tree-sitter-languages, typer, rich, and others. It also needs a running Neo4j database (local via Docker, Linux binary, or remote hosted instance).
How do I ignore certain files or directories?
Create a .cgcignore file in the root of your project using the same syntax as .gitignore. Example: /build/, /node_modules/, *.log.
Does the server support live file watching?
Yes. When you tell the AI assistant to watch a directory, the server performs an initial full index and then continuously monitors the directory for changes, automatically updating the graph.
What transports or authentication does it use?
The server communicates via the MCP (Model Context Protocol) using Neo4j credentials (URI, username, password) stored in ~/.codegraphcontext/.env. It does not expose other transports or authentication methods.
What are the known limitations?
The README does not list explicit limitations, but it notes that the cgc setup command may fail on some systems requiring a PATH fix script, and that the tool requires a working Neo4j instance.
Frequently asked questions
What dependencies does CodeGraphContext require?
The server requires Python packages including neo4j, watchdog, tree-sitter, tree-sitter-languages, typer, rich, and others. It also needs a running Neo4j database (local via Docker, Linux binary, or remote hosted instance).
How do I ignore certain files or directories?
Create a `.cgcignore` file in the root of your project using the same syntax as `.gitignore`. Example: `/build/`, `/node_modules/`, `*.log`.
Does the server support live file watching?
Yes. When you tell the AI assistant to watch a directory, the server performs an initial full index and then continuously monitors the directory for changes, automatically updating the graph.
What transports or authentication does it use?
The server communicates via the MCP (Model Context Protocol) using Neo4j credentials (URI, username, password) stored in `~/.codegraphcontext/.env`. It does not expose other transports or authentication methods.
What are the known limitations?
The README does not list explicit limitations, but it notes that the `cgc setup` command may fail on some systems requiring a PATH fix script, and that the tool requires a working Neo4j instance.
Basic information
More Other MCP servers
Awesome Mlops
visengerA curated list of references for MLOps
Production-ready MCP integrations for AI applications
Klavis-AIKlavis AI: MCP integration platforms that let AI agents use tools reliably at any scale
Blender
ahujasidOpen-source MCP to use Blender with any LLM
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
Nginx UI
0xJackyYet another WebUI for Nginx
Comments