Files
LEANN/packages/leann-mcp
2025-08-06 21:28:05 -07:00
..
2025-08-06 21:28:05 -07:00

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 projects
  • leann_search - Search code and documents with semantic queries
  • leann_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.

LEANN in Claude Code

How It Works

  • leann - Core CLI tool for indexing and searching (installed globally)
  • leann_mcp - MCP server that wraps leann commands for Claude Code integration
  • Claude Code calls leann_mcp, which executes leann commands 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