cg-mcp
Indexes Android (Kotlin) projects to build a dependency graph of entry points, calls and framework facts, enabling reachability, impact and affected-tests queries.
Indexes Astro projects (with exact call resolution via the TypeScript compiler API) so routes, components and their dependents can be traced in the code graph.
Indexes C/C++ modules, entry points, FFI boundaries and #if gates heuristically, with exact resolution available through scip-clang.
Maps Celery tasks and dispatch relationships, linking jobs to the functions that handle them and the tables they touch.
Exact Dart indexing via the Dart analyzer, mapping entry points, calls and dependencies for reachability and impact analysis.
Indexes Django projects (including DRF and django-ninja) to trace routes, views, signals and table reads/writes, with file:line evidence for every hop.
Indexes Express applications with exact call resolution, mapping routes and the handlers, functions and tables they reach.
Indexes FastAPI/Starlette apps to map HTTP routes to the functions, jobs and tables they reach, supporting impact and reachability queries.
Indexes Fastify applications with exact call resolution, tracing routes to their handlers and downstream dependencies.
Indexes Flask apps to map routes and views to the functions, tables and config keys they reach.
Indexes Flutter (Dart) apps using the Dart analyzer, exposing entry points, calls and dependencies in the code graph.
Indexes Hono applications with exact call resolution, mapping routes to handlers and their downstream dependencies.
Indexes iOS/SwiftPM projects heuristically, with exact resolution available through the Swift index store.
Indexes JavaScript projects with exact call resolution via the TypeScript compiler API, building a dependency graph of routes, calls and config.
Indexes Koa applications with exact call resolution, tracing routes to handlers and the tables they touch.
Indexes Kotlin code (Android, Kotlin Multiplatform, Spring) heuristically, with exact resolution via scip-java when opted in.
Indexes Laravel apps — routes, route attributes, middleware, queues, broadcasting and outbound HTTP — using nikic/php-parser, and can link client HTTP calls to server routes.
Indexes NestJS applications with exact call resolution, mapping controllers, routes and their downstream dependencies.
Indexes Next.js projects with exact call resolution, tracing routes, components and their dependents.
Indexes Nuxt/Vue applications with exact call resolution, and can link frontend HTTP calls to backend routes while checking request body keys.
Parses PHP with nikic/php-parser (PHP 8.2+) for exact call resolution, building the code graph for PHP/Laravel projects.
Parses Python with the stdlib ast module for exact call resolution across Django, FastAPI, Flask and Celery codebases.
Indexes React Router (and Remix) applications with exact call resolution, mapping routes and loaders to their dependencies.
Indexes Remix applications with exact call resolution, tracing routes and their handlers through the code graph.
Indexes Rust crates and modules, entry points, FFI and #[cfg] gates heuristically, with exact resolution available through rust-analyzer.
Indexes Spring applications — routes, guards, beans, tables and clients — heuristically, with exact resolution via scip-java when opted in.
Indexes Swift/iOS code heuristically, with exact resolution available through the Swift index store.
Indexes TypeScript projects with exact call resolution via the TypeScript compiler API across frameworks like NestJS, Next.js, Astro and Nuxt.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@cg-mcpshow me what depends on table:orders"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
code-graph
See everything a change affects before you make it: a local, deterministic dependency graph of routes, calls, tables and config, with file:line evidence for every hop.
For you and your AI agent (CLI + MCP). No LLM in the graph.
Docs · Quick start · CLI · MCP · Changelog

Quick start
pipx install cg-code-graph # or: uv tool install cg-code-graph
cg index . --db out/graph.db # prints starter queries for your repo
cg install --host cursor # or claude, codex, vscode, …: registers the MCP server and a "use cg first" agent rule
cg reaches table:orders --db out/graph.db # any table, connection or config keyTry it on a bundled sample, link a frontend to a backend, or connect an agent over MCP: Quick start guide. Other install options (install.sh, Windows, exact-mode toolchains): Install.
cg reaches table:store_books on the bundled Django sample:
dependents: 18 nodes (code: 6, entry points: 9, other: 3)
== RUNTIME (reached from http_route / ... / queue_job / listener): 5 functions/methods
catalog.api.create_book depth=1 conf=resolved http_route(1)
path: function:catalog.api.create_book
-WRITES_TABLE[resolved @ catalog/api.py:27]-> table:store_books
catalog.signals.review_saved depth=3 conf=resolved listener(1)
path: function:catalog.signals.review_saved
-DISPATCHES[exact @ catalog/signals.py:12]-> job:catalog.tasks.recompute_rating
-HANDLED_BY[exact @ catalog/tasks.py:13]-> function:catalog.tasks.recompute_rating
-READS_TABLE[resolved @ catalog/tasks.py:14]-> table:store_books
Related MCP server: Cordyceps Search
Supported languages
Language | Frameworks and facts | Calls | Docs |
Django (+ DRF, django-ninja), FastAPI / Starlette, Flask, Celery | exact (stdlib | ||
| Nuxt / Vue, NestJS, Next.js, Astro, Express, Fastify, Koa, Hono, Elysia, React Router / Remix | exact (TypeScript compiler API) | |
Laravel (routes, route attributes, middleware, queues, broadcasting, outbound HTTP) | exact (nikic/php-parser; needs PHP 8.2+) | ||
Flutter | exact (Dart analyzer; needs the Dart SDK) | ||
Android, Kotlin Multiplatform, Spring | heuristic; exact with scip-java (opt-in) | ||
Spring (routes, guards, beans, tables, clients) | heuristic; exact with scip-java (opt-in) | ||
iOS / SwiftPM | heuristic; exact with the Swift index store (opt-in) | ||
| crates / modules, entry points, FFI, | heuristic; exact with rust-analyzer / scip-clang |
Go and others: import a SCIP index with cg index --scip FILE. Run cg doctor to see exact / heuristic per language on your machine.
What you get
reaches,impact,path: every caller, route, job and page that reaches a table, config key or method.cg affected --base main: the tests and entry points a change reaches (--quietfeeds your test runner).Across repos:
cg linkmatches client HTTP calls (frontends and Laravel / Guzzle backends) to server routes, and checks request keys (Laravel FormRequest, Elysia schemas, Nuxt / TypeScript bodies).Route guards:
cg routes --writes --unguardedlists routes that write with no auth guard. Laravel checks inside the action count as inline guards unless--strict.Security views:
cg surfacelists the inbound / outbound attack surface and findings (hardcoded credentials, plaintext protocols, unverified webhooks, unguarded handlers, listeners on all interfaces, disabled TLS / SSH verification, plaintext gRPC, exposed IPC, outbound URLs built from request input) as text, JSON or SARIF, with--fail-onfor CI.MCP server (
cg-mcp) so agents query the graph instead of grepping. One server can serve many graphs (graphsplus an optionalgraphargument); a single--dbstays one graph. See MCP.Visual view (
cg serve) and plan checks (cg plan check) for planned changes.
Docs
Install · Quick start · CLI · MCP · Configuration · Architecture · Limitations
Changelog · Contributing · Security · MIT License
More recordings: docs/media.
Related MCP Connectors
Codebase graphs, caller impact analysis, and recorded project context for AI coding agents.
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Ask a codebase what calls what: search, blast radius, paths between symbols, and diffs.
Search indexed code, trace dependencies, assess change impact, and recall repository memory.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA graph-powered code intelligence engine that indexes codebases into a structural knowledge graph to provide AI agents with deep context on function calls, types, and execution flows. It offers local, zero-dependency tools for hybrid search, impact analysis, and dead code detection across Python, JavaScript, and TypeScript projects.885 PyPI814MIT
- FlicenseNot gradedqualityAmaintenanceEnables developer agents to perform semantic codebase search, dependency and impact analysis, cross-file refactoring, and full-stack API tracing through a unified query DSL over a high-performance graph engine.-
- AlicenseNot gradedqualityAmaintenanceTurns a codebase into a persistent knowledge graph so AI coding agents can answer structural questions about functions, call chains, routes, and cross-service links through graph queries instead of reading files one by one.MIT
- AlicenseAqualityBmaintenanceEnables AI coding assistants to query a read-only, locally indexed code graph for who-calls a function, what a function calls, call chains, and where configuration keys are defined or read, returning path:line citations with calibrated confidence and stale-index flags.9MIT