# Lain MCP server

> Provides a high-performance knowledge graph for AI coding agents to map dependencies, symbols, and call chains across repositories.

- Repository: https://github.com/spuentesp/lain
- Page: https://hostedmcp.org/servers/spuentesp/lain
- Transport: stdio
- Stars: 9
- License: MIT
- Latest version: 0.10.0

## Install

### Claude Code

```sh
claude mcp add lain -- npx -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"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"lain","type":"stdio","command":"npx","args":["-y","@spuentesp/lain-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

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

### Codex

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

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.lain]
command = "npx"
args = ["-y", "@spuentesp/lain-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user lain npx -- -y @spuentesp/lain-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

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

## FAQ

### What can Lain help an agent do before editing code?

An agent can inspect what depends on a function and how the rest of the code reaches it to understand the impact of changes.

### Does Lain require an embedding model for semantic search?

No, semantic search is optional and graph queries can function without an embedding model.

### How does Lain handle uncommitted code changes?

Lain follows commits rather than uncommitted edits; a re-index pass is required to bring the index current after a commit.

### Which programming languages are supported?

It includes built-in parsers for Rust, Python, TypeScript, JavaScript, Go, Java, C, C++, C#, Ruby, Swift, Kotlin, Scala, and PHP.
