LEANN Claude Code Integration
Intelligent code assistance using LEANN's vector search directly in Claude Code.
Prerequisites
First, install LEANN CLI globally:
uv tool install leann-core
This makes the leann command available system-wide, which leann_mcp requires.
Quick Setup
Add the LEANN MCP server to Claude Code:
claude mcp add leann-server -- leann_mcp
Available Tools
leann_list- List available indexes across all projectsleann_search- Search code and documents with semantic queriesleann_ask- Ask questions and get AI-powered answers from your codebase
Quick Start
# Build an index for your project
leann build my-project
# Start Claude Code
claude
Then in Claude Code:
Help me understand this codebase. List available indexes and search for authentication patterns.
How It Works
leann- Core CLI tool for indexing and searching (installed globally)leann_mcp- MCP server that wrapsleanncommands for Claude Code integration- Claude Code calls
leann_mcp, which executesleanncommands and returns results
File Support
Python, JavaScript, TypeScript, Java, Go, Rust, SQL, YAML, JSON, and 30+ more file types.
Storage
- Project indexes in
.leann/directory (like.git) - Global project registry at
~/.leann/projects.json - Multi-project support built-in
Removing
claude mcp remove leann-server
