Labsco
MCP SERVER

Rag Rat

by cq27-dev

Ask a repository why the code is the way it is — callers, history, prior decisions — not just where a string appears.

Code Intelligence & Repository Indexing
Summary
The layer grep cannot give you: why this code exists, anchored to the code itself.

Every harness already has grep and file reads. What is missing is rationale — the decision that produced a function, the invariant it holds, the issue thread that explains the odd branch. rag-rat stores those as typed notes bound to symbols, and every answer carries a confidence label and coverage warnings so a partial index reads as exactly that.

What it is

A local Rust index and MCP server over one checkout. It builds a tree-sitter call graph, reads git and GitHub history, and stores typed source-anchored notes, then answers with provenance on every result. Source files stay read-only; it writes only its own SQLite database.

What you get
  • 47 tools in nine groups, covering search, the call graph, clones, history, index health and repo memories
  • semantic_search, symbol_lookup and docs_for_symbol for finding your way in
  • find_callers, trace_callees, impact_surface and check_library_usage — what calls this, what it calls, and what breaks if you change it
  • find_clones and clones_for_symbol — exact and near-duplicate functions already in the repo
  • git_history_for_symbol, git_blame_chunk, commit_search and the papertrail tools — the issues, PRs and reviews behind a line
  • memory_create and the memory_* family — typed notes (Invariant, Decision, Risk, BugPattern and more) anchored to a symbol, path or call path, retrievable later with evidence
  • dream and dream_review — a maintenance pass over accumulated memories
  • Results encoded as TOON rather than JSON, which is denser for the uniform result rows
Requirements

Install the plugin for Claude Code, Codex or opencode, which registers the server and installs a matching binary; or install the CLI from npm as @rag-rat/bin, or build it with cargo. The registry entry is io.github.cq27-dev/rag-rat over stdio. The server starts dormant until the repo is indexed.

Setup effort

One command — rag-rat mcp