Lain MCP Server

LAIN builds a map of how all the code in your project connects — what calls what, what depends on what, which files tend to change together. Then it

Local serverstdioPython

What is the Lain MCP server?

LAIN builds a map of how all the code in your project connects — what calls what, what depends on what, which files tend to change together. Then it lets your AI coding assistant ask questions about that map. So instead of the AI just. That is what the lain mcp server brings to an AI assistant: the same capability, reachable through the Model Context Protocol rather than a separate app or dashboard.

The short version

Lain is a persistent code-intelligence MCP server. It builds a queryable knowledge graph of your codebase — symbols and their relationships extracted via LSP and tree-sitter, augmented with git co-change history and optional semantic embeddings — and exposes that graph through MCP tools. The value over LSP-only or RAG-based approaches is cross-file structural reasoning: blast radius for proposed changes, transitive dependency traces, anchor identification, co-change correlation, and contextual build failure decoration so agents can reason about callers rather than just the failing line. Written in Rust, persists

The tools it exposes

The server publishes 8 tools. What each one is for:

  • Requirement — Details
  • Rust — 1.75 or newer
  • Mode — Command
  • stdio — --transport stdio
  • both — --transport both --port 9999
  • Metric — with_lain
  • Homebrew — The Homebrew tool exposed by this server
  • Search — The Search tool exposed by this server

What it needs from you

Configuration is passed through the environment: LAIN_EMBEDDING_MODEL. Treat anything key-shaped as a real credential — scope it to the minimum the server needs, and rotate it if it ever lands in a shared config.

| Requirement | Details | |-------------|---------| | Rust | 1.75 or newer | | Git | Required for co-change analysis | | ONNX Model | Optional — for semantic search |

Getting it running

Setup follows the usual MCP pattern — install or clone the server, register it in your client's configuration file, restart the client.

How it compares

Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Lain's toolset — Requirement, Rust, Mode and 5 more — is a fair guide to whether it matches your workflow. It is maintained by spuentesp; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Lain's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

Available tools

ToolWhat it does
RequirementDetails
Rust1.75 or newer
ModeCommand
stdio--transport stdio
both--transport both --port 9999
Metricwith_lain
HomebrewThe Homebrew tool exposed by this server.
SearchThe Search tool exposed by this server.

Configuration

| Requirement | Details | |-------------|---------| | Rust | 1.75 or newer | | Git | Required for co-change analysis | | ONNX Model | Optional — for semantic search |

VariableDescriptionRequired
LAIN_EMBEDDING_MODELConfiguration value read at startup.Optional

Example prompts to try

  • Use Lain to Requirement.
  • Use Lain to Rust.
  • Use Lain to Mode.

Frequently asked questions

It connects Lain to MCP-compatible AI assistants such as Claude and Cursor, exposing 8 tools (Requirement, Rust, Mode, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Lain directly.