Kotlin · SQLite · MCP · LiteLLM

Understand any project
as a knowledge graph.

A local-first engine that indexes code, docs, PDFs, and schemas into a queryable graph — then exposes structured context to AI agents through an MCP server.

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

Everything in one graph.

ContextGraph extracts structure and semantics from every file type and stitches them into a single connected store.

📁
Multi-format ingestion

Index Kotlin, Java, Python, JS, Markdown, SQL, PDFs, and YAML in one pass. Incremental re-indexing skips unchanged files via checksums.

🔌
MCP server

Expose 10 graph tools to Claude, Cursor, and any MCP-compatible agent. Agents search, traverse, and build context without reading every file.

🧠
Semantic extraction

Route files through any LiteLLM-compatible model to extract concepts, decisions, and relationships that static analysis can't see.

🔒
100% local

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

🔗
Graph traversal

BFS expansion, shortest-path queries, and reverse dependency analysis — powered by JGraphT on top of SQLite FTS5.

📍
Full provenance

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

MCP Server

Give AI agents structured project context.

Run serve-mcp to expose the knowledge graph to any MCP-compatible agent — Claude, Cursor, Copilot. Agents navigate relationships and build context bundles without reading every file.

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
git clone https://github.com/erenalpaslan/context-graph
cd context-graph && ./gradlew build

# Init + index your project
./gradlew :modules:cli:run --args="init"
./gradlew :modules:cli:run --args="index /path/to/your/project"

# Search
./gradlew :modules:cli:run --args='search "authentication"'

# Start MCP server for AI agents
./gradlew :modules:cli:run --args="serve-mcp"
Full quick start guide →