spuentesp avatar

Lain

spuentesp/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 tools

Public 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:


View the full README on GitHub

Details

Repository
github.com/spuentesp/lain
Categories
Documents & Knowledge, Search & Web Crawling
Package
@spuentesp/lain-mcp
Transport
STDIO
Registry
MCP registry, active

Related Documents & Knowledge MCP servers

View all
1chengjiale150 avatarJupyter Mcp Serverchengjiale150/jupyter-mcp-serverA powerful MCP server for AI-driven Jupyter Notebook management and execution8stars
2rohan-protocol avatarRohan Protocol MCProhan-protocol/sdkStateless zero-knowledge trust gateway and WebMCP shield for AI agents on Midnight.0stars
3rahulk644 avatarAppFlowy MCP Serverrahulk644/appflowy-mcp-serverAppFlowy MCP server: edit Markdown, manage typed database rows, search and import/export.8stars
4bighippoman avatarInterceptbighippoman/intercept-mcpGive your AI the ability to read the web. Fetches URLs as clean markdown with multi-tier fallback.7stars
5causa-prima-ai avatarScribocausa-prima-ai/scribo-mcpEN 16931-compliant e-invoices: XRechnung, ZUGFeRD, Factur-X, Peppol BIS, Facturae or US PDF. Free.7stars
6theastraway avatarMINDtheastraway/mind-mcp-serverMIND knowledge-graph memory for agents. 44 tools: CRM, Life, MoneyMIND, Budget, Sheets, Email, Sign.7stars