# rag-rat

A local repository index for coding agents, connecting source code with its graph, history, and stored repository decisions.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 24
- Author: cq27-dev
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/cq27-dev/rag-rat
- Updated: 2026-10-09
- HTML: https://affpapa.org/en/nevibecode/mcp/rag-rat

## What it does

rag-rat runs as a local repository index and MCP server. It answers questions about callers, callees, imports, tests, Git and GitHub history, and repository notes tied to source locations. Results include evidence, confidence, and coverage details, so an agent can distinguish a confirmed edge from a partial index.

The server combines a code graph, a SQLite database, history data, and durable repository memories. Its graph covers Rust, TypeScript and TSX, Kotlin, C/C++, Python, Swift, and Go; configured toolchains can add SCIP-based edges. The plugin also provides a grep-augmentation hook and checks written or edited functions for exact or near-duplicate code.

Source files stay read-only: rag-rat writes only to its own SQLite database. That makes the server unsuitable for agents expected to modify code through this integration. After repository setup, reconnect the MCP server so it starts against the new index.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add rag-rat -- npx -y @rag-rat/bin
```

### Codex

**Platform CLI**
```bash
codex mcp add rag-rat -- npx -y @rag-rat/bin
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "rag-rat": {
            "command": "npx",
            "args": [
                "-y",
                "@rag-rat/bin"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "rag-rat": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@rag-rat/bin"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add rag-rat npx -y @rag-rat/bin
```

## When to use it
- trace callers and callees for a symbol
- connect code to Git and GitHub history
- record a repository decision or invariant
- spot duplicate code before editing a function

## Example prompts
- Show the callers of `parseConfig` and include the source evidence.
- Explain the history behind `PaymentService` and find related repository decisions.
- Record the decision about `rag-rat.toml` as a source-linked repository memory.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
