
Lain
Builds a persistent knowledge graph of your codebase using LSP and tree-sitter, then exposes it through MCP tools so agents can answer structural questions like "what breaks if I change this function?" Runs as a background server with stdio or HTTP transport, watches files to keep the graph fresh, and layers git co-change history on top of the static analysis. Exposes operations like query_graph for traversals, get_blast_radius for impact analysis, find_anchors to identify architectural pillars, and semantic_search if you point it at a local ONNX embedding model. Also wraps build commands (run_build, run_tests, run_clippy) and decorates failures with caller context. Reach for this when your agent needs to reason about cross-file dependencies and architectural structure, not just grep through isolated files.
- GitHub stars
- 9
- tools
- 10
- transport
- STDIO
- last updated
- Oct 14, 2026
Tools
10 toolsPublic tool metadata for what this MCP can expose to an agent.
get_blast_radiusSee callers before changing a symbol
See callers before changing a symbol
No parameter schema in public metadata yet.
assess_changeSee callers before changing a symbol
See callers before changing a symbol
No parameter schema in public metadata yet.
get_call_chainTrace how two functions connect
Trace how two functions connect
No parameter schema in public metadata yet.
find_anchorsFind architectural entry points
Find architectural entry points
No parameter schema in public metadata yet.
list_entry_pointsFind architectural entry points
Find architectural entry points
No parameter schema in public metadata yet.
find_symbolSearch by name or meaning
Search by name or meaning
No parameter schema in public metadata yet.
search_codeSearch by name or meaning
Search by name or meaning
No parameter schema in public metadata yet.
get_cross_repo_blast_radiusFollow a symbol across repositories
Follow a symbol across repositories
No parameter schema in public metadata yet.
search_orgFollow a symbol across repositories
Follow a symbol across repositories
No parameter schema in public metadata yet.
explain_dispatchExplains dynamic dispatch by combining static callers with convention matches, runtime traces, and Git co-change evidence
Explains dynamic dispatch by combining static callers with convention matches, runtime traces, and Git co-change evidence
No parameter schema in public metadata yet.
Sponsors
Readme
Lain
A code graph for coding agents. Lain maps callers, dependencies, symbols, and Git co-changes, then exposes them through the Model Context Protocol (MCP). Before an agent edits a function, it can inspect what depends on it and how the rest of the code reaches it.
Lain Command Center demo
The demo traces a symbol across the bytes and tokio repositories. Agents
query the same graph through MCP; the browser shows what Lain indexed and where
an answer came from.
Ask your agent:
If I change validate_token, what breaks?
Show me the call chain from entry to helper_a.
Which files usually change with auth.rs?
Is another agent already editing this code?
Lain answers with symbol names and source paths from a local index. The index
stays on disk between runs and can cover more than one repository. It follows
commits, not uncommitted edits: after committing, a re-index pass (lain reindex or a fresh session) brings it current — and answers that may miss
recent work say so instead of going quiet. Semantic search is optional; graph
queries work without an embedding model.
Install
Using the release installer:
Details
- Repository
- github.com/spuentesp/lain
- Categories
- Documents & Knowledge, Search & Web Crawling
- Package
@spuentesp/lain-mcp- Transport
- STDIO
- Registry
- MCP registry, active