
LeanKG
Supports UIby FreePeak
Lightweight local knowledge graph for AI coding tools to reduce token usage and provide accurate codebase context.
What it does
LeanKG connects AI coding assistants to a local-first knowledge graph of your codebase. It indexes code, builds dependency graphs, and allows AI tools to query targeted subgraphs instead of scanning entire files, significantly reducing token consumption and increasing accuracy.
Tools
index: Indexes the codebase to build the knowledge graph.impact: Calculates the blast radius of changes.trace: Shows feature-to-code traceability.detect-clusters: Identifies functional code communities.export: Exports the graph as Mermaid, DOT, or JSON.metrics: Tracks token savings and indexing efficiency.
Installation
{
"mcpServers": {
"leankg": {
"command": "leankg",
"args": ["mcp"]
}
}
}
Supported hosts
Claude Desktop, Cursor, OpenCode, Kilo Code, Gemini CLI, Google Antigravity, Codex.
Quick install
curl -fsSL https://raw.githubusercontent.com/FreePeak/LeanKG/main/scripts/install.sh | bash -s -- cursorInformation
- Pricing
- free
- Published
- 4/27/2026
- stars






