# Rarefaction MCP server

> Provides AI coding agents with multi-hop call graphs, symbol context, and impact analysis using Language Server Protocol (LSP).

- Repository: https://github.com/ip2k/rarefaction
- Page: https://hostedmcp.org/servers/ip2k/rarefaction
- Transport: stdio
- Stars: 0
- License: GPL-3.0
- Latest version: 0.4.3

## Install

### Claude Code

```sh
claude mcp add rarefaction -- npx -y rarefaction-lsp-mcp
```

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

```json
{
  "mcpServers": {
    "rarefaction": {
      "command": "npx",
      "args": [
        "-y",
        "rarefaction-lsp-mcp"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "rarefaction": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "rarefaction-lsp-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"rarefaction","type":"stdio","command":"npx","args":["-y","rarefaction-lsp-mcp"]}'
```

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

```json
{
  "mcpServers": {
    "rarefaction": {
      "command": "npx",
      "args": [
        "-y",
        "rarefaction-lsp-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add rarefaction -- npx -y rarefaction-lsp-mcp
```

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

```toml
[mcp_servers.rarefaction]
command = "npx"
args = ["-y", "rarefaction-lsp-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user rarefaction npx -- -y rarefaction-lsp-mcp
```

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

```json
{
  "mcpServers": {
    "rarefaction": {
      "command": "npx",
      "args": [
        "-y",
        "rarefaction-lsp-mcp"
      ]
    }
  }
}
```

## Tools (3)

- `orient`
- `scope`
- `status`

## FAQ

### What information does the orient tool provide?

It returns a symbol's signature, documentation, body, callers (including tests), callees, implementations, and a list of files affected by changes.

### Which programming languages are supported?

The server supports Swift, Rust, C/C++, TypeScript/JavaScript, Python, and WebAssembly text (WAT).

### How does Rarefaction help reduce token usage?

It provides a single bounded answer containing necessary context instead of requiring the agent to read entire files and perform multiple searches.

### Does the server require a specific installation for Swift?

Yes, Swift requires macOS with Xcode or a Swift toolchain with sourcekit-lsp.
