Kotlin · tree-sitter · SQLite · MCP

Give agents the source,
not a list of pointers.

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.

Get started → View on GitHub
DEFINES EXPOSES CONTAINS GRAPH SQLite 📄 Kotlin 🗄️ SQL 📝 Docs 📕 PDF ⚙️ Config 🔌 MCP
11
MCP tools
8
languages parsed
FTS5
full-text search
0
cloud required
Capabilities

Everything in one graph.

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.

🌳
Scope-correct symbols

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.

🔌
One call, not ten

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.

🎯
Ranked by the question

Relevance is scored against the words actually asked about, down to the sub-words of compound identifiers, so a search for "auth" reaches refreshAuthToken.

🔒
100% local

The graph lives in .contextgraph/ as SQLite. No cloud, no accounts. Data never leaves your machine unless you say so.

🔗
Resolved call graph

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.

📍
Full provenance

Every node traces back to its source file and line number. Ask "where did this come from?" and get an exact answer.

MCP Server

Give AI agents structured project context.

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.

explore index_project search_nodes get_node expand_node find_path get_evidence impact_analysis related_files build_context generate_report
Quick Start

Up and running in minutes.

Requires Java 17+.

terminal
# 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
Full quick start guide →