CodeGraphContext
About
An MCP server that indexes local code into a graph database to provide context to AI assistants.
Details
- Author
- shashankss1205
- Downloads
- 512
- Categories
- Developer Tools, Knowledge Base, Database, Other
Jump to
- 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.
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.
Turn code repositories into a queryable graph for AI agents.
- 🇬🇧English
- 🇨🇳中文
- 🇰🇷한국어
- 🇺🇦Українська
- 🇷🇺Русский
- 🇯🇵日本語
- 🇮🇳தமிழ்
- 🇪🇸 Español (Soon)
🌍Help translate CodeGraphContext to your language by raising an issue & PR onGitHub Issues!
Bridge the gap between deep code graphs and AI context.
[](https://pypi.org/project/codegraphcontext/)<<<[](https://pypi.org/project/codegraphcontext/)<<<[](https://github.com/Shashankss1205/CodeGraphContext/blob/HEAD/LICENSE)<<<
[](https://github.com/CodeGraphContext/CodeGraphContext/stargazers)<<<[](https://github.com/CodeGraphContext/CodeGraphContext/network/members)<<<[](https://github.com/CodeGraphContext/CodeGraphContext/issues)<<<[](https://github.com/CodeGraphContext/CodeGraphContext/pulls)<<<
[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/test.yml)<<<[](https://github.com/CodeGraphContext/CodeGraphContext/actions/workflows/e2e-tests.yml)<<<[](http://codegraphcontext.vercel.app/)<<<[](https://codegraphcontext.vercel.app/)<<<
A powerfulMCP serverandCLI toolkitthat indexes local code into a graph database to provide context to AI assistants and developers. Use it as a standalone CLI for comprehensive code analysis or connect it to your favorite AI IDE via MCP for AI-powered code understanding.
- 🚀 Quick Start
- 📋 Prerequisites
- 🏃 How to Run the Project Locally
- 🌐 Supported Programming Languages
- 🛠️ CLI Toolkit
- 🤖 MCP Server
- 🗄️ Database Options
- 🔬 SCIP indexing (optional)
Install in seconds with pip and unlock a powerful CLI for code graph analysis.
The CLI intelligently parses your tree-sitter nodes to build the graph.
Use natural language to query complex call-chains via MCP.
CodeGraphContext is built for the moment when plain text search stops being enough. It turns a repository into a graph of files, symbols, calls, inheritance, imports, and relationships so you can move from "where is this defined?" to "how does this actually connect?" without jumping between tools.
flowchart LR A[Source code] --> B[Tree-sitter and SCIP indexers] B --> C[Graph database] C --> D[CLI queries] C --> E[MCP server] D --> F[Direct analysis] E --> G[AI assistants with repo context]
- Trace call chains across files and packages.
- Understand class hierarchies, imports, and module boundaries.
- Find dead code, hotspots, and unexpected dependencies.
- Give an AI assistant the same structural context a maintainer would use.
- Do I need a remote service?No. CGC works locally with embedded backends or with external graph databases when you want them.
- Is it only for one language?No. It supports a broad mix of mainstream languages and keeps expanding.
- Can I use it with an AI assistant?Yes. That is one of the main reasons the MCP server exists.
- Version:0.5.1
- Authors:Shashank Shekhar Singhshashankshekharsingh1205@gmail.com
- License:MIT License (SeeLICENSEfor details)
- Website:CodeGraphContext
CodeGraphContextis created and actively maintained by:
- 📧 Email:shashankshekharsingh1205@gmail.com
- 🐙 GitHub:@Shashankss1205
- 🔗 LinkedIn:Shashank Shekhar Singh
- 🌐 Website:codegraphcontext.vercel.app
Contributions and feedback are always welcome! Feel free to reach out for questions, suggestions, or collaboration opportunities.
- Code Indexing:Analyzes code and builds a knowledge graph of its components.
- Relationship Analysis:Query for callers, callees, class hierarchies, call chains and more.
- Pre-indexed Bundles:Load famous repositories instantly with.cgcbundles - no indexing required! (Learn more)
- Live File Watching:Watch directories for changes and automatically update the graph in real-time (cgc watch).
- Interactive Setup:A user-friendly command-line wizard for easy setup.
- Dual Mode:Works as a standaloneCLI toolkitfor developers and as anMCP serverfor AI agents.
- Multi-Language Support:Full support for 23 programming languages.
- Flexible Database Backend:FalkorDB Lite (Default), KuzuDB, LadybugDB, FalkorDB Remote, Nornic DB, or Neo4j (all platforms via Docker/native).
CodeGraphContext transforms source code into a queryable knowledge graph that can be explored through the CLI or AI assistants via MCP.
flowchart TD A[Code Repository] --> B[Tree-sitter / SCIP Indexing] B --> C[Knowledge Graph] C --> D[Graph Database] D --> E[CLI Toolkit] D --> F[MCP Server] F --> G[AI Assistant]
- Source code is parsed using Tree-sitter or SCIP indexers.
- Relationships between functions, classes, imports, and calls are extracted.
- A knowledge graph is generated and stored in a graph database.
- Users can query the graph through the CLI or AI assistants using MCP.
CodeGraphContext parses your source code and builds a comprehensive knowledge graph. This graph can be queried directly via the CLI toolkit or exposed to AI assistants through the MCP server.
flowchart TD A[Code Repository] -->|Parsed by| B[Tree-sitter / SCIP Indexing] B -->|Generates| C[Knowledge Graph] C -->|Stored in| D[(Graph Database)] D -->|Queried via| E[CLI Toolkit] D -->|Served by| F[MCP Server] F -->|Provides context to| G[🤖 AI Assistant] classDef default fill:#1f2937,stroke:#8b5cf6,stroke-width:2px,color:#fff; classDef db fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#fff; classDef ai fill:#312e81,stroke:#a855f7,stroke-width:2px,color:#fff; D:::db G:::ai
CodeGraphContext parses your source code and builds a comprehensive knowledge graph. This graph can be queried directly via the CLI toolkit or exposed to AI assistants through the MCP server.
flowchart TD A[Code Repository] -->|Parsed by| B[Tree-sitter / SCIP Indexing] B -->|Generates| C[Knowledge Graph] C -->|Stored in| D[(Graph Database)] D -->|Queried via| E[CLI Toolkit] D -->|Served by| F[MCP Server] F -->|Provides context to| G[🤖 AI Assistant] classDef default fill:#1f2937,stroke:#8b5cf6,stroke-width:2px,color:#fff; classDef db fill:#0f172a,stroke:#3b82f6,stroke-width:2px,color:#fff; classDef ai fill:#312e81,stroke:#a855f7,stroke-width:2px,color:#fff; D:::db G:::ai
CodeGraphContext provides comprehensive parsing and analysis for the following languages:
…
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





