A local-first code understanding engine. Builds a scope-correct graph of your codebase from tree-sitter ASTs, then answers a question in one MCP call — matched modules, relevant symbols with verbatim source, resolved call edges, and blast radius.
Source is parsed to an AST and resolved into a graph of symbols and the real edges between them — then the docs, schemas and configs around it land in the same store.
Tree-sitter grammars for Kotlin, Java, TypeScript, TSX, JavaScript, Python, Swift, Objective-C and Go. A close() on one type never collapses into a close() on another.
11 MCP tools for Claude, Cursor and anything MCP-compatible — led by explore, which answers a question with verbatim source instead of pointers the agent has to go read.
Relevance is scored against the words actually asked about, down to the sub-words of compound identifiers, so a search for "auth" reaches refreshAuthToken.
The graph lives in .contextgraph/ as SQLite. No cloud, no accounts. Data never leaves your machine unless you say so.
BFS expansion, shortest paths and blast-radius analysis over JGraphT. Every edge records which resolution rung produced it, so a certain call is distinguishable from a guess.
Every node traces back to its source file and line number. Ask "where did this come from?" and get an exact answer.
Run serve-mcp to expose the graph to any MCP-compatible agent — Claude, Cursor, Copilot. Start with explore: one natural-language question, one call, and the answer comes back carrying the source. The other ten are there for when you want one specific thing.
Requires Java 17+.
# Clone and build the launcher
git clone https://github.com/erenalpaslan/context-graph
cd context-graph && ./gradlew :modules:cli:installDist
export PATH="$PWD/modules/cli/build/install/contextgraph/bin:$PATH"
# Init + index your project
cd /path/to/your/project
contextgraph init
contextgraph index .
# Search
contextgraph search "authentication"
# Start MCP server for AI agents
contextgraph serve-mcp