lain — Claude Code MCP server: what it does, how to install
lain gives coding agents a local code graph with callers, dependencies, symbols, and Git co-change data. Use it before changing connected code.
claude mcp add lain -- npx -y @spuentesp/lain-mcpWhat lain does
lain indexes symbols, call relationships, dependencies, and patterns of files changing together in Git. Through MCP, an agent can inspect a change’s blast radius, trace a route between functions, locate entry points, and check advisory claims from other agents.
The index is kept locally and can span multiple repositories. Graph lookups do not require an embedding model; semantic search is an optional layer. Built-in parsers cover Rust, Python, TypeScript, JavaScript, Go, Java, C, C++, C#, Ruby, Swift, Kotlin, Scala, PHP, plus <script> blocks in Vue and Svelte components.
The graph follows commits, so run lain reindex or start a fresh session after committing. Otherwise recent changes may not appear in answers. Add it to Claude Code with claude mcp add lain -- npx -y @spuentesp/lain-mcp, then restart the agent.
What it helps with
- inspect a symbol’s change impact
- trace a call path between functions
- locate architectural entry points
- find files that change together in Git
- check whether agents claim the same code
Example prompts for the agent
- Use Lain to show the blast radius of
validate_token. - Trace the call chain from the entry point to
helper_a. - Which files tend to change alongside
auth.rs?
How to install lain
Platform CLI
claude mcp add lain -- npx -y @spuentesp/lain-mcpPlatform CLI
codex mcp add lain -- npx -y @spuentesp/lain-mcpConfig file
{
"mcpServers": {
"lain": {
"command": "npx",
"args": [
"-y",
"@spuentesp/lain-mcp"
]
}
}
}Config file
{
"servers": {
"lain": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@spuentesp/lain-mcp"
]
}
}
}Platform CLI
gemini mcp add lain npx -y @spuentesp/lain-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about lain
How do I install lain in Claude Code?
Run claude mcp add lain -- npx -y @spuentesp/lain-mcp, then restart Claude Code.
What does lain do?
lain builds a local graph of symbols, calls, dependencies, and Git co-change patterns, then exposes it to coding agents through MCP.
Does the graph update after a commit?
Run lain reindex or open a fresh session after committing. Otherwise answers can lag behind the latest committed work.