Rarefaction
Call graph, tests and affected files for one code symbol, via LSP
- Pricing
- Open source
- Platforms
- CLI, macOS, Linux
- Runs
- Locally
- Version
- 0.4.3
- Listing updated
- today
Similar MCP servers
About Rarefaction
Rarefaction is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.
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.
Install
Run in a terminal
claude mcp add rarefaction-lsp-mcp -- npx -y rarefaction-lsp-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"rarefaction-lsp-mcp": {
"command": "npx",
"args": [
"-y",
"rarefaction-lsp-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"rarefaction-lsp-mcp": {
"command": "npx",
"args": [
"-y",
"rarefaction-lsp-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"rarefaction-lsp-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"rarefaction-lsp-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"rarefaction-lsp-mcp": {
"command": "npx",
"args": [
"-y",
"rarefaction-lsp-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"rarefaction-lsp-mcp": {
"command": "npx",
"args": [
"-y",
"rarefaction-lsp-mcp"
]
}
}
}Using several servers? Build one config file with the MCP config generator.
Tools this server provides (3)
Taken from the project documentation; the running server may differ.
- 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.
What it does
- 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
Pricing
Open source
Free npm package
Rarefaction 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.


