Server facts
codegraphcontext MCP Server
GitHub stars
4,453
Last commit
Nov 20, 2026
Runtime
python
License
MIT
Project
- Author
- Shashankss1205
- Website
- cgc.codes
- License
- MIT
- Category
- Databases
Tech
- Runtime
- python
- Transports
- stdio
- Remote access
- No
- Authentication
- None (embedded local DB; optional Neo4j credentials)
Activity
- GitHub stars
- 4,453
- Last commit
- Data as of
Tags
- coding
- vibe
Overview
Plain text grep misses cross-file call chains while chunked RAG often loses symbol accuracy on large codebases. CodeGraphContext (CGC) solves that gap by parsing repositories with Tree-sitter—and optional SCIP indexers (`scip-clang` using `compile_commands.json` for C/C++ or `scip-dotnet` Roslyn for C#)—into a local or external graph database, exposing structural code intelligence through both a standalone CLI (`cgc`) and a local stdio MCP server (`codegraphcontext mcp start`). Out of the box, it runs offline on embedded FalkorDB Lite (Unix default on Python 3.12+), KuzuDB (cross-platform fallback), or LadybugDB with no remote service or API keys required, and scales to external Neo4j, Nornic DB, or remote FalkorDB servers when configured.
Install via `pip install codegraphcontext` (Python 3.10–3.14) or pull `codegraphcontext/codegraphcontext:latest` on Docker, then run `codegraphcontext mcp setup` to auto-configure popular AI editors and CLIs including Claude, Cursor, VS Code, Windsurf, Zed, OpenCode, Codex, Cline, RooCode, Kiro, Goose, Gemini CLI, ChatGPT, and Amazon Q Developer. Language coverage includes Python, TypeScript, JavaScript, TSX, Go, Rust, Java, C, C++, C#, Kotlin, Swift, Dart, Ruby, PHP, Scala, Haskell, Elixir, Lua, Perl, Emacs Lisp, HTML, CSS, Solidity, and Terraform HCL, alongside `cgc watch` live updates, pre-indexed `.cgc` bundles, browser `--viz` graph exports, and opt-in GCF output (`CGC_OUTPUT_FORMAT=gcf`) cutting tool payload tokens by 62%.
Install & configure
Requirements
- Python 3.10–3.14 with `pip` (or Docker using `codegraphcontext/codegraphcontext:latest` with no local Python required)
- Embedded graph DB installed automatically (FalkorDB Lite on Unix Python 3.12+, KuzuDB cross-platform fallback, or LadybugDB); Neo4j credentials only if using external Neo4j
- Optional `gcf-python` package for 62% token-reduced GCF responses, or external SCIP indexers (`scip-clang` / `scip-dotnet`) when `SCIP_INDEXER=true`
pip install codegraphcontextInstall with `pip install codegraphcontext`, run `codegraphcontext mcp setup` to auto-configure your AI IDE and store DB settings in `~/.codegraphcontext/.env`, then launch via `codegraphcontext mcp start`. Use `.cgcignore` (gitignore syntax) to skip build directories or vendor trees.
Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Config file · macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Use Settings → Developer → Edit Config when available. Do not assume a Linux configuration path; check the client documentation for your platform. Remote servers use the app’s connector flow when supported, not the local stdio file shown here. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"CodeGraphContext": {
"command": "codegraphcontext",
"args": [
"mcp",
"start"
]
}
}
}Config file · Project: .cursor/mcp.json
User: ~/.cursor/mcp.json
The project path is relative to the workspace root. The tilde denotes your user home directory. Use Cursor’s MCP settings to confirm which configuration and scope your installed version is reading. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"CodeGraphContext": {
"command": "codegraphcontext",
"args": [
"mcp",
"start"
]
}
}
}Config file · Workspace: .vscode/mcp.json
For user scope, use the “MCP: Open User Configuration” command if available. Do not guess a user configuration path across operating systems, profiles, containers, or remote workspaces; check the client documentation. Merge this example with existing settings; do not overwrite unrelated servers.
{
"servers": {
"CodeGraphContext": {
"type": "stdio",
"command": "codegraphcontext",
"args": [
"mcp",
"start"
]
}
}
}Config file · macOS/Linux: ~/.codeium/windsurf/mcp_config.json
Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json
Open the MCP configuration through Windsurf’s settings when possible to confirm the active file. Paths can differ in managed or future releases; check the client documentation if this location is not present. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"CodeGraphContext": {
"command": "codegraphcontext",
"args": [
"mcp",
"start"
]
}
}
}Config file · Project scope: .mcp.json at the repository root
The project file uses mcpServers. For user scope, use claude mcp add --scope user rather than assuming .mcp.json in your home directory is the user configuration. Check the client documentation for managed settings and storage details. Merge this example with existing settings; do not overwrite unrelated servers.
{
"mcpServers": {
"CodeGraphContext": {
"type": "stdio",
"command": "codegraphcontext",
"args": [
"mcp",
"start"
]
}
}
}Examples are translated from the published configuration. Supply your own credentials and verify requirements in the upstream README. Remote connectors are shown only where a supported configuration format is known.
Use cases
- Trace multi-hop callers, callees, and ripple impact across large repositories before refactoring shared functions or base classes.
- Detect unused symbols, cyclomatic complexity hotspots, and Kotlin/Android dead code (with decorator exclusions like `Composable` or `Test`).
- Keep an active workspace's code graph continuously synced via `cgc watch` while querying architecture from Cursor, Claude, VS Code, or Windsurf.
- Load pre-indexed `.cgc` bundles or generate standalone browser-viewable `--viz` dependency graphs for onboarding onto unfamiliar repos.
Strengths
- Works completely locally with zero-config embedded graph databases (FalkorDB Lite, KuzuDB, LadybugDB) and scales optionally to Neo4j or Nornic DB.
- Interactive `codegraphcontext mcp setup` wizard auto-configures major AI IDEs and CLIs including VS Code, Cursor, Claude, Windsurf, Zed, Codex, and OpenCode.
- Broad language support across backend, frontend, mobile, Solidity, and Terraform HCL, plus optional SCIP precision for C/C++ and C#.
- Opt-in GCF pipe-delimited output (`CGC_OUTPUT_FORMAT=gcf`) trims MCP tool payload tokens by 62%.
Limitations
- Requires an upfront indexing step (or downloading a `.cgc` bundle) before graph queries reflect a repository.
- Entity and relationship extraction depth varies by language and indexer (for instance, HCL emits declarations without function calls, and C/C++ SCIP requires `compile_commands.json`).
- Embedded KuzuDB/LadybugDB reserve a 4 GiB default buffer pool unless tuned via `CGC_EMBEDDED_BUFFER_POOL_MB`, and FalkorDB Lite is Unix-only.
codegraphcontext setup notes
- codegraphcontext's stdio example needs a client that launches local processes.