MCP Server · Code Knowledge Graph · 100% Local

Stop burning tokens
on grep loops

CodeGraph builds a pre-indexed code knowledge graph for Claude Code, Cursor, and Codex. AI agents query the graph instead of scanning files — 94% fewer tool calls, no data leaves your machine.

94%
Fewer Tool Calls
77%
Faster Responses
19+
Languages Supported
0
Data Leaves Machine

From codebase to
knowledge graph in seconds

CodeGraph uses tree-sitter to parse your local code into a SQLite graph database, then runs as a local code graph MCP server that Claude Code, Cursor, and Codex connect to automatically.

01

Install & Initialize

Run the installer in your project. The interactive installer configures Claude Code, Cursor, and Codex automatically — no manual JSON editing.

02

CodeGraph Indexes Your Codebase

tree-sitter parses every file into an AST. Functions, classes, call chains, and import relationships are extracted and stored in a local code knowledge graph (SQLite). VS Code, Cursor, and Windsurf projects all supported.

03

MCP Server Connects to Your AI Agent

The local code graph MCP server starts automatically. Claude Code, Codex, and Cursor query the graph via MCP tools instead of spawning grep agents — giving precise code graph context in one call.

04

Graph Stays Fresh Automatically

Native OS file events (FSEvents / inotify) watch for saves. The code graph analysis updates incrementally with a 2-second debounce — zero config, always current.

Real numbers, real codebases

Tested with Claude Opus 4.6 across 6 production codebases. Each test compared Claude Code's Explore agent with and without CodeGraph MCP.

Codebase With CodeGraph Without CodeGraph Improvement
VS Code · TypeScript 3 calls · 17s 52 calls · 1m 37s 94% fewer · 82% faster
Excalidraw · TypeScript 3 calls · 29s 47 calls · 1m 45s 94% fewer · 72% faster
Claude Code · Python+Rust 3 calls · 39s 40 calls · 1m 8s 93% fewer · 43% faster
Alamofire · Swift 3 calls · 22s 32 calls · 1m 39s 91% fewer · 78% faster
Swift Compiler · 25,874 files 6 calls · 35s 37 calls · 2m 8s 84% fewer · 73% faster

Everything your AI agent needs
to understand code

🗺️

Code Knowledge Graph

Symbol relationships, call graphs, class inheritance, and import chains — all pre-indexed in a local SQLite database for instant lookup.

Code Graph MCP Server

Runs as a local MCP server. Claude Code, Cursor, Codex, and OpenCode connect automatically via the Model Context Protocol.

🔍

Code Graph RAG

Graph-based retrieval beats vector RAG for code. Relationship-aware queries return precise context — not similar text chunks.

📡

Real-time Watch Mode

Native OS file events keep the code graph in sync as you code. No polling, no manual re-index, always fresh.

🔒

100% Local · Zero Leaks

No API keys, no cloud upload, no GitHub OAuth. Your code stays on your machine. Private repos stay private.

🌐

19+ Languages

TypeScript, JavaScript, Python, Go, Rust, Java, C#, Swift, Kotlin, PHP, Ruby, C, C++, Dart, Svelte, and more.

8 tools for precise
code graph context

When running as a code graph MCP server, CodeGraph exposes these tools to Claude Code, Cursor, and any MCP-compatible agent.

codegraph_search Find symbols by name across the codebase
codegraph_context Build relevant code graph context for a task
codegraph_callers Find what calls a function
codegraph_callees Find what a function calls
codegraph_impact Analyze what code is affected by a change
codegraph_node Get details about a specific symbol
codegraph_files Get indexed file structure instantly
codegraph_status Check index health and statistics

Why graph beats vectors
for code understanding

Vector RAG finds similar text. Code graph RAG understands relationships. For codebases, structure matters more than similarity.

CodeGraph MCP Graph RAG

  • Traverses actual call chains and import graphs
  • Returns callers, callees, and impact radius
  • Cross-language dependency resolution
  • Zero token waste — precise subgraph per query
  • 100% local SQLite, no embedding API cost
  • Always current via file watcher

Vector RAG for Code

  • Similarity search, not relationship traversal
  • Misses cross-file dependency chains
  • High token cost returning whole file chunks
  • Requires embedding API (cloud dependency)
  • Stale until re-embedded
  • No impact analysis or call graph traversal

Works with your stack

CodeGraph's code knowledge graph supports 19+ languages via tree-sitter.

TypeScript JavaScript Python Go Rust Java C# Swift Kotlin PHP Ruby C C++ Dart Svelte Liquid Pascal / Delphi

Common questions

Vector RAG finds text that looks similar to your query. Code graph RAG traverses actual relationships — who calls this function, what does it import, what breaks if it changes. CodeGraph builds a true code knowledge graph using tree-sitter AST parsing, not embeddings. The result is precise, minimal context with zero token waste.
Yes. CodeGraph runs as a standard MCP server, so any MCP-compatible client works — Claude Code, Cursor, Codex CLI, OpenCode, Windsurf, and others. The code graph MCP server starts locally and each agent connects to it via stdio.
No. CodeGraph is 100% local. The code knowledge graph is stored in a SQLite file inside your project directory. No API keys required, no cloud upload, no external accounts needed. Your private code stays on your machine.
The MCP server uses native OS file events — FSEvents on macOS, inotify on Linux, ReadDirectoryChangesW on Windows — with a 2-second debounce. When you save a file, only the changed parts of the code graph are updated incrementally. No polling, no manual re-index.
CodeGraph has been tested on the Swift Compiler — 25,874 files, 272,898 graph nodes — which it indexed in under 4 minutes. The code knowledge graph database stays in the MB range even for very large repositories.

One command.
94% fewer tool calls.

Works with Claude Code, Cursor, Codex, and any MCP-compatible agent. 100% local — your code never leaves your machine.