# Lain

> Lain is an open-source MCP server for developer tools. Code graph of callers, dependencies and Git co-changes for coding agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, self-hosted, macOS, Linux, Windows
- **Repository:** https://github.com/spuentesp/lain
- **MCP Registry name:** io.github.spuentesp/lain
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory)
- **Listing updated:** 2026-11-18

## About

Before an agent edits a function, Lain lets it ask what depends on that function and how the rest of the code reaches it, answering with symbol names and source paths from a local on-disk index. The index follows commits rather than uncommitted edits, a re-index pass brings it up to date, and answers that may miss recent work say so.

Parsers for Rust, Python, TypeScript, JavaScript, Go, Java, C, C++, C#, Ruby, Swift, Kotlin, Scala and PHP, plus Vue and Svelte script blocks, are built into the binary, and optional language servers add precision. Dynamic dispatch is handled openly: static analysis cannot prove calls through message buses or injection containers, so an explain tool combines static callers with convention matches, runtime traces and Git co-change evidence and returns insufficient evidence rather than declaring an edit safe.

Federation covers several repositories and organisation-wide search, with a local web dashboard on port 9999 by default, bound to localhost unless configured otherwise. Intents, presence and advisory file claims discourage several agents from editing the same code. One setup command registers it with Claude Code, Codex, Cursor, VS Code or Continue, and semantic search is optional.

## Features

- **Blast radius:** Shows what breaks if a symbol changes.
- **Call chains:** Traces how two functions connect.
- **Git co-change data:** Finds files that usually change together.
- **14 built-in languages:** Parses common languages with no extra install.
- **Multi-repo federation:** Searches and traces across several repositories.
- **Agent coordination:** Intents, presence and advisory claims reduce edit collisions.
- **Honest uncertainty:** Reports insufficient evidence instead of guessing for dynamic calls.

## Good for

- Check what depends on a function before changing it
- Trace how an entry point reaches a helper
- Find which files usually change with a given file
- See if another agent is editing the same code
- Search across an organisation's repositories

## Install

### Claude Code (Terminal)

```sh
claude mcp add lain -- npx -y @spuentesp/lain-mcp
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "lain": {
      "command": "npx",
      "args": [
        "-y",
        "@spuentesp/lain-mcp"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "lain": {
      "command": "npx",
      "args": [
        "-y",
        "@spuentesp/lain-mcp"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "lain": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@spuentesp/lain-mcp"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "lain": {
      "command": "npx",
      "args": [
        "-y",
        "@spuentesp/lain-mcp"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "lain": {
      "command": "npx",
      "args": [
        "-y",
        "@spuentesp/lain-mcp"
      ]
    }
  }
}
```

## Tools

- `get_blast_radius`: Shows what depends on a symbol
- `assess_change`: Assesses the impact of a change
- `get_call_chain`: Traces the call chain between two functions
- `find_anchors`: Finds architectural anchors
- `list_entry_points`: Lists entry points
- `find_symbol`: Finds a symbol by name
- `search_code`: Searches code by name or meaning
- `get_cross_repo_blast_radius`: Blast radius across repositories
- `search_org`: Searches across an organisation
- `explain_dispatch`: Explains dynamic dispatch using several evidence types

## FAQ

### Does it need an embedding model?

No. Graph queries work without one; semantic search is optional.

### Does it see uncommitted edits?

No. It follows commits, and a re-index brings it current.

### Which clients can it configure?

Claude Code, Codex, Cursor, VS Code and Continue through the setup command, or any host through a generic config.

### Where does the index live?

On disk in the repository, in a .lain folder.

### Is Lain free?

Yes. Lain is open source, so you can use and self-host it for free.

### How do I add Lain to Claude Code?

Run this command in your terminal: claude mcp add lain -- npx -y @spuentesp/lain-mcp

### What are the best alternatives to Lain?

The closest alternatives to Lain are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/lain
