codegraph is a local-first code context engine and MCP server that builds a persistent knowledge graph of your source repositories in SQLite. It gives AI coding assistants deep structural awareness — symbols, call graphs, dependencies, and semantic search — without sending a single byte to the cloud.
codegraph is a local-first code context engine and MCP server for repositories. It incrementally indexes source code into a lightweight SQLite graph, then exposes high-signal tools for symbol lookup, call graph traversal, impact analysis, related test discovery, and semantic search. Built in Go with a single-binary workflow, it is designed to work
ดาว
4
เครื่องมือ
—
อัปไทม์
—
Single binary. Zero config. No external databases. No API keys.
Why codegraph?
AI coding assistants are powerful, but they spend most of their token budget discovering what to change — grepping files, reading code, reconstructing call graphs from partial evidence.
codegraph shifts that cost. One call to context_for_task returns the exact files, symbols, and relationships an agent needs. One call to agentic_query gets a synthesized answer backed by graph traversal and semantic search.
❌ Without codegraph
AI reads files one by one → greps for patterns → burns tokens on context-gathering
✅ With codegraph
AI calls context_for_task("add retry logic to HTTP client")
→ instantly gets relevant files, functions, callers, callees, and tests
codegraph index . walks your repo, parses every file with tree-sitter, resolves imports using four strategies (exact, name, suffix, method-receiver), and writes a fully-linked symbol graph into a local codegraph.sqlite. The MCP server then exposes that graph to any compatible AI assistant via 29 structured tools — no cloud, no Docker, no API keys.
Features
🔍 Parsing & Indexing
Tree-sitter parsing for all 12 supported languages — robust AST extraction, not regex
4-strategy import resolution — exact, name, suffix, and method-receiver matching
Cross-language linking — connects symbols across language boundaries
Incremental updates — only re-indexes changed files; fast on large repos
Cycle detection — find circular dependencies at the file level
Interactive visualization — D3.js force-directed graph with search and zoom
🛠 Developer Experience
Single Go binary — no runtime dependencies, cross-platform
Zero-config SQLite — no Docker, no external databases
codegraph install — auto-detects and configures Claude Code, Cursor, Windsurf, Gemini CLI
File watching — automatic re-indexing on changes
100% local — no data leaves your machine
Supported Languages
All languages use tree-sitter for AST parsing:
Language
Extensions
Go
.go
Python
.py
TypeScript
.ts, .tsx
JavaScript
.js, .jsx, .mjs
Java
.java
Kotlin
.kt, .kts
Rust
.rs
C#
.cs
Ruby
.rb
Swift
.swift
PHP
.php
C / C++
.c, .h, .cpp, .hpp, .cc
Node.js repos are supported; full tree-sitter node support is still in progress.
Quick Start
1. Install
go install github.com/isink17/codegraph/cmd/codegraph@latest
Requires Go 1.23+ and a C compiler (for tree-sitter CGo bindings).
Build from source
git clone https://github.com/isink17/codegraph
cd codegraph
go build ./cmd/codegraph
go test ./...
Requires Go 1.23+ and a C compiler (for tree-sitter CGo bindings).
Clean rebuild
cd your-project
codegraph index . --rebuild
Use this after parser or indexer changes when you need a true full reindex from scratch.
codegraph index . --rebuild needs exclusive access to the repo database.
If rebuild fails because the DB is in use, stop codegraph serve or other codegraph processes and retry.
Use codegraph clean . for database maintenance tasks like WAL checkpointing, VACUUM, FTS optimize, ANALYZE, and incremental vacuum.
Version
codegraph --version
codegraph version
Prints the installed local version only. It does not contact GitHub.
Normal commands check GitHub Releases at most once every 24 hours. Set
DO_NOT_TRACK or CODEGRAPH_NO_UPDATE_CHECK to a non-empty value other than
0 or false to disable the check. This also prevents creation or update of
the local version-check state file.
2. Auto-configure your AI tool
codegraph install
Detects Claude Code, Cursor, Windsurf, and Gemini CLI and writes the MCP config automatically.
3. Index your project
cd your-project
codegraph index .
4. Start the MCP server
codegraph serve
Repo root is auto-detected from git (or falls back to your current working directory).
That's it. Your AI assistant now has deep structural code understanding.
git clone https://github.com/isink17/codegraph
cd codegraph
go build ./cmd/codegraph
go test ./...
Requires Go 1.23+ and a C compiler for the tree-sitter CGo bindings.
For a clean rebuild after parser/indexer changes:
codegraph index . --rebuild
This rebuild path needs exclusive access to the repo database. If it fails because another codegraph process is holding the DB, stop that process and retry.
License
This project is licensed under the Functional Source License, Version 1.1, MIT Future License (FSL-1.1-MIT).
On the second anniversary of each version's release, that version converts to the MIT License. See LICENSE for full terms.
C
Codegraph
isink17·4 ดาว·
codegraph is a local-first code context engine and MCP server for repositories. It incrementally indexes source code into a lightweight SQLite graph, then exposes high-signal tools for symbol lookup,
codegraph is a local-first code context engine and MCP server for repositories. It incrementally indexes source code into a lightweight SQLite graph, then exposes high-signal tools for symbol lookup, call graph traversal, impact analysis, related test discovery, and semantic search. Built in Go with a single-binary workflow, it is designed to work
ตรวจสอบล่าสุดเมื่อ 2026-10-28 codegraph is a local-first code context engine and MCP server for repositories. It incrementally indexes source code into a lightweight SQLite graph, then exposes high-signal tools for symbol lookup, call graph traversal, impact analysis, related test discovery, and semantic search. Built in Go with a single-binary workflow, it is designed to work