LeanKG for MCP
Leankg: A Rust-Powered Local-First Code Knowledge Graph for AI Agents
- Free
- 4.8
- V v0.28.1
Leankg: A Rust-Powered Local-First Code Knowledge Graph for AI Agents
Leankg, developed by Freepeak, is a Rust-built MCP server tool designed as a local-first code knowledge graph. Operating on the mcp platform, it falls under the mcps category. This program serves AI host applications by pre-indexing code repositories and providing precise subgraphs. It aims to enhance AI coding agent interactions by reducing token usage and offering blast-radius awareness. Leankg supports various AI clients and deployment methods, offering a foundational component for advanced code analysis and development workflows.
What does Leankg connect to?
Leankg functions as a local-first code knowledge graph, connecting to AI host applications that support the Model Context Protocol (MCP). For backend storage, the official GitHub repository specifies a PostgreSQL database with pgvector as required and the only storage engine. However, the Leankg website also lists SQLite or RocksDB as backend options. This discrepancy means PostgreSQL is the only confirmed storage requirement based on the GitHub repository's explicit statement. It processes code repositories to generate knowledge graphs.
Core features and tools
Leankg exposes over 85 callable tools for AI agents. These cover search, impact analysis, call graphs, ontology, and architecture visualization. Key tools for agent interaction include mcp_status, get_overview_context, concept_search, semantic_search, and search_code. It also offers get_impact_radius, get_dependencies, get_dependents, and get_tested_by for analysis. Ontology management is supported by add_ontology_concept, add_ontology_workflow, add_knowledge, search_knowledge, and delete_ontology_concept. The kg_trace_workflow tool aids ontology updates.
Who is it for?
Leankg is primarily for AI coding agents and developers working in teams who use AI coding tools. It suits those needing to provide targeted code context to AI, perform impact analysis, or conduct advanced code searches. Developers seeking to reduce AI token usage and improve accuracy in AI-assisted development will find it valuable. This program is also for teams requiring a structured way to manage and query code knowledge. Skip this if your workflow does not involve AI coding agents or requires a local-first code knowledge graph.
How to get started
No credentials are required for connecting AI clients to the Leankg MCP server. It supports MCP stdio for editor agents and MCP HTTP for Docker and team deployments, running as an HTTP server on port 9699 or over stdio.
Use cases
- Providing targeted context for AI agents: Pre-indexes code repositories and serves precise subgraphs over MCP, reducing token usage and offering blast-radius awareness.
- Impact analysis and dependency mapping: Computes the "blast radius" of changes with confidence ratings and builds call graphs with various edge types.
- Semantic and keyword code search with ontology: Finds code by intent, not just syntax, using keyword search, HNSW embeddings, cross-encoder reranking, and ontology-based search.
Leankg provides a critical layer for AI-driven code understanding and interaction, built in Rust for performance. Its ability to serve precise code context via MCP to various AI clients makes it a key asset for modern development teams. The toolset for search, impact analysis, and ontology management empowers more effective AI agent use. Start by exploring its semantic search capabilities to find code by intent.
Pros
- Reduces AI token usage for code context.
- Provides detailed impact analysis for changes.
- Supports multiple AI client integrations.
- Enables semantic and keyword code search.
Cons
- Storage requirements conflict between sources.
- Requires a running PostgreSQL database.
- Initial project setup involves several steps.
LeanKG for MCP
- Free
- 4.8
- V v0.28.1
Discover more programs

gsearch-mcp
- 4.3
- Free
gsearch-mcp: Local MCP server providing live web citations

subcog
- 4.5
- Free
Efficient AI Memory Management Tool

hister
- 4.4
- Free
Hister: A Privacy-Focused Search Engine

devrag
- 4
- Free
Efficient RAG System for Developers

Search Cli
- 4.5
- Free
Fast MCP Search CLI for Agent-Driven Web Retrieval and Integration

anilist-mcp
- 4.7
- Free
Comprehensive AniList MCP Server Overview

Context Harness
- 4.9
- Free
Context Harness: Local Context for AI Agents and Offline RAG

obsidian-mcp-plugin
- 4.1
- Free
Obsidian MCP Plugin Integrates AI Assistants with Your Vault
graphrag-toolkit
- 4.3
- Free
Graphrag Toolkit: Building Graph-Enhanced Generative AI Applications

codesearch
- 4.9
- Free
Codesearch: A Multi-Repository Semantic Code Search Server for AI Agents
open-ontologies
- 4.1
- Free
High-performance MCP server and desktop suite for ontology engineering