# lain

lain gives coding agents a local code graph with callers, dependencies, symbols, and Git co-change data. Use it before changing connected code.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: spuentesp
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/spuentesp/lain
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/lain

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add lain -- npx -y @spuentesp/lain-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add lain -- npx -y @spuentesp/lain-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "lain": {
            "command": "npx",
            "args": [
                "-y",
                "@spuentesp/lain-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "lain": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@spuentesp/lain-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add lain npx -y @spuentesp/lain-mcp
```

## When to use it
- 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
- 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`?

## Similar
- [review-pr](https://affpapa.org/en/nevibecode/skills/tirth8205-review-pr.md) — skill · 1200 installs
- [rag-rat](https://affpapa.org/en/nevibecode/mcp/rag-rat.md) — MCP server · ★ 24
- [graph-evolution](https://affpapa.org/en/nevibecode/skills/graph-evolution.md) — skill · 3900 installs
- [marm-mcp-server](https://affpapa.org/en/nevibecode/mcp/marm-mcp-server.md) — MCP server · ★ 424
- [Repository Intelligence](https://affpapa.org/en/nevibecode/mcp/repository-intelligence.md) — MCP server · ★ 29
- [agent-knowledge](https://affpapa.org/en/nevibecode/mcp/agent-knowledge.md) — MCP server · ★ 19

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
