# Rarefaction

> Rarefaction is an open-source MCP server for developer tools. Call graph, tests and affected files for one code symbol, via LSP. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, macOS, Linux
- **Repository:** https://github.com/ip2k/rarefaction
- **MCP Registry name:** io.github.ip2k/rarefaction-lsp-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

Instead of opening whole files and grepping, an agent asks about one function, method or type and gets a bounded answer: signature and doc, body, callers with tests marked, callees, implementations, the tests that reach it, and a short list of files a change can touch. Callers go two levels deep and callees one by default, and anything truncated is marked as such.

The answer comes from the project's own language server rather than text matching, and it includes a "run only these" command for the test runner. Ambiguous names come back as a list of exact positions rather than a guess, and stale indexes or servers without call hierarchy are reported in the answer. The author measured answers at a median of 6 to 7 percent of the bytes of reading the files they name, on 50 real commits in ripgrep and IronRDP, and says the saving over a whole session is not yet measured.

Profiles cover Swift, Rust, C/C++, TypeScript/JavaScript, Python and WebAssembly text. It needs Node 22.22.2 or later, is used on macOS and Linux and is untested on Windows. The first call pays a language-server cold start of 6 to 16 seconds on the projects tested.

## Features

- **One-call symbol context:** Signature, doc, body, callers, callees and implementations in a single answer.
- **Test selection:** Lists tests that reach the symbol with a command that runs only those.
- **Change scope:** Shows the short list of files a change to the symbol can affect.
- **Honest coverage notes:** Reports stale indexes, servers still indexing and missing call hierarchy support.
- **Multi-language profiles:** Swift, Rust, C/C++, TypeScript/JavaScript, Python and WAT.
- **Read-only tools:** status, orient and scope never modify the project.

## Good for

- Check what breaks before changing a function
- Pick which tests to run after a change
- Get oriented in an unfamiliar codebase without reading whole files
- Reduce the tokens an agent spends exploring code

## Install

### Claude Code (Terminal)

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

### Claude Desktop (claude_desktop_config.json)

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

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

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

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

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

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

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

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

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

## Tools

- `status`: Reports the project root and which language profiles are ready.
- `orient`: Returns the call graph and context for one symbol.
- `scope`: Shows the files a change to a symbol can affect, to check before editing.

## FAQ

### Which tools does it expose?

Three read-only tools: status, orient and scope.

### Which languages work?

Swift, Rust, C/C++, TypeScript/JavaScript, Python and WebAssembly text; TypeScript and Python servers are bundled and others must be on PATH.

### Does it work on Windows?

The README says it is used on macOS and Linux and is untested on Windows.

### How fast is it?

After indexing, the median call took 80 ms on ripgrep and 220 ms on an 800-file workspace; the cold start is 6 to 16 seconds once per session.

### How do I install it?

Run npx -y rarefaction-lsp-mcp through claude mcp add or codex mcp add, or install the plugin for Claude Code or Codex.

### Is Rarefaction free?

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

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

Run this command in your terminal: claude mcp add rarefaction-lsp-mcp -- npx -y rarefaction-lsp-mcp

### What are the best alternatives to Rarefaction?

The closest alternatives to Rarefaction 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/rarefaction
