# rag-rat

> rag-rat is an open-source MCP server for knowledge and memory. Local repo index with call graphs, git history and durable memory for coding agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, vscode, self-hosted
- **Website:** https://rag-rat.cq27.dev
- **Repository:** https://github.com/cq27-dev/rag-rat
- **MCP Registry name:** io.github.cq27-dev/rag-rat
- **Categories:** knowledge and memory, developer tools
- **Listing updated:** 2026-11-15

## About

Grep and file reads tell an agent what the code says; this server adds the rationale around it. It parses a repository with tree-sitter, embeds it locally and stores everything in one SQLite database, leaving your source read-only. Callers, callees, imports and type references become a graph across Rust, TypeScript/TSX, Kotlin, C/C++, Python, Swift and Go, and every edge is labelled Exact, Syntactic, Name-only or Ambiguous so a guess reads as a guess. An optional SCIP oracle and live language servers can raise edges to compiler-grade.

On top sit 47 tools for search, graph, history and memory. impact_surface gathers callers, callees, tests and notes around a symbol, important_symbols ranks load-bearing code by PageRank, and rationale_search reaches GitHub and GitLab issue, PR and review history, with closed issues distilled into typed decision records. Memories such as invariants, decisions and risks are anchored to symbols, not line numbers, and survive refactors.

Hooks warn when a file being written duplicates existing functions, and worktrees of one repo share a single index and memory store. It installs via npx @rag-rat/bin or as a Claude Code, Codex or OpenCode plugin.

## Features

- **Labelled code graph:** Every edge says how it was resolved.
- **Impact surface:** Shows callers, tests and notes around a symbol before a change.
- **Papertrail history:** Mirrors issue, PR and review rationale locally.
- **Source-anchored memory:** Notes attach to symbols and outlive refactors.
- **Clone warnings:** A hook flags near-duplicates of existing code.
- **Shared worktree index:** Parallel agents reuse one index and memory store.

## Good for

- See what a change to a function will break
- Find why a piece of code was written this way
- Stop an agent re-implementing an existing helper
- Carry decisions between agent sessions
- Run several agents in git worktrees on one index

## Install

### Claude Code (Terminal)

```sh
claude mcp add rag-rat -- npx -y @rag-rat/bin
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "rag-rat": {
      "command": "npx",
      "args": [
        "-y",
        "@rag-rat/bin"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "rag-rat": {
      "command": "npx",
      "args": [
        "-y",
        "@rag-rat/bin"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "rag-rat": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@rag-rat/bin"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "rag-rat": {
      "command": "npx",
      "args": [
        "-y",
        "@rag-rat/bin"
      ]
    }
  }
}
```

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

```json
{
  "mcpServers": {
    "rag-rat": {
      "command": "npx",
      "args": [
        "-y",
        "@rag-rat/bin"
      ]
    }
  }
}
```

## Tools

- `impact_surface`: Gather callers, callees, tests and memories around a symbol.
- `important_symbols`: Rank load-bearing symbols by PageRank over the graph.
- `rationale_search`: Search issue and review rationale across GitHub and GitLab.
- `symbol_lookup`: Look up a symbol with surfaced memories.

## FAQ

### Does it modify my source?

No. Source stays read-only and it writes only its own SQLite database.

### Which languages are supported?

Rust, TypeScript/TSX, Kotlin, C/C++, Python, Swift and Go.

### How many tools are there?

47, also available as CLI commands.

### How do I install it?

Run npx @rag-rat/bin or install the Claude Code, Codex or OpenCode plugin.

### Is rag-rat free?

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

### How do I add rag-rat to Claude Code?

Run this command in your terminal: claude mcp add rag-rat -- npx -y @rag-rat/bin

### What are the best alternatives to rag-rat?

The closest alternatives to rag-rat are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [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.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Nautilus Compass Memory](https://ai-powered.com/mcp/nautilus-compass-memory): Nautilus Compass Memory is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/rag-rat
