Leankg
@FreePeak
About Leankg
A local, Rust-based Knowledge Graph MCP server. Cuts AI coding token usage by up to 98% by intelligently querying your codebase instead of sending full files.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"leankg": {
"command": "leankg",
"args": [
"start",
"--mcp"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is LeanKG?
LeanKG is a local Knowledge Graph powered by Rust and Tree-sitter that indexes your codebase and uses the Model Context Protocol (MCP) to feed your AI assistant only the exact structural context it needs. It is built for developers who want to drastically reduce token usage (up to 98% drop) and avoid sending entire files or repositories to cloud-based AI tools.
How to use LeanKG?
Visit the LeanKG GitHub repository for full installation instructions, benchmarks, and supported languages. After installation, the MCP server exposes tools that your AI assistant can invoke — no additional configuration steps beyond connecting it to an MCP-compatible host (e.g., Claude Desktop, Cursor, Windsurf, OpenCode).
Key features of LeanKG
- Reduces token usage by up to 98% (from ~10,000+ to ~40 tokens per query).
- 100% local execution — runs securely on your machine with Rust and CozoDB.
- Deep code understanding via Graph RAG, including call graphs and circular dependencies.
- Universal MCP support for any MCP-compatible AI host.
- Provides tools like
analyze_dependenciesandextract_signatures.
Use cases of LeanKG
- Slash API costs when interacting with large codebases in Claude or Cursor.
- Quickly understand call graphs and dependencies without reading entire files.
- Extract precise function signatures and types for documentation or refactoring.
- Avoid leaking proprietary code by keeping indexing entirely local.
FAQ from LeanKG
How does LeanKG reduce token usage?
It uses Graph RAG to extract precise function signatures, dependencies, and variables instead of sending entire files or repositories.
Is my code ever uploaded to an external server?
No. LeanKG runs entirely on your local machine; your repository is never blindly uploaded.
Which AI tools are compatible with LeanKG?
LeanKG supports any MCP-compatible host, including Claude Desktop, Cursor, Windsurf, and OpenCode.
Frequently asked questions
How does LeanKG reduce token usage?
It uses Graph RAG to extract precise function signatures, dependencies, and variables instead of sending entire files or repositories.
Is my code ever uploaded to an external server?
No. LeanKG runs entirely on your local machine; your repository is never blindly uploaded.
Which AI tools are compatible with LeanKG?
LeanKG supports any MCP-compatible host, including Claude Desktop, Cursor, Windsurf, and OpenCode.
Basic information
More Other MCP servers
Maestro
mobile-dev-incPainless E2E Automation for Mobile and Web

YOUB
Connect your AI assistant to your own YOUB endurance training account. Read recorded activities with full analysis, planned sessions, race goals, wellness (HRV, sleep, resting HR) and your athletic profile. Create or mov
Unity MCP ✨
justinpbarnettUnity MCP acts as a bridge between AI assistants and your Unity Editor. Give your LLM tools to manage assets, control scenes, edit scripts, and automate tasks within Unity.
AutoBrowser MCP
autobrowser-aiBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
XcodeBuildMCP
cameroncookeA Model Context Protocol (MCP) server and CLI that provides tools for agent use when working on iOS and macOS projects.
Comments