# Vbj1808/retrieval-lens [Health: Active]

**Category:** 🧠 Knowledge & Memory  
**Repository:** https://github.com/Vbj1808/retrieval-lens  
**GitHub Stars:** 2  
**npm Downloads (last month):** 31  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/vbj1808-retrieval-lens

## Description
Black-box flight recorder for RAG retrieval inside MCP agents. Logs chunks, scores, sources and rankings so you can audit, replay and diff retrieval runs.

## Tools
Capabilities this server exposes over MCP:

- **retrieval_observe** — Log a retrieval run — query, chunks, scores, sources, rankings
- **retrieval_query** — Replay what the model saw before a specific answer
- **retrieval_diff** — Compare two retrieval runs — what changed, what score drifted
- **retrieval_stats** — Aggregate score distributions, top sources, runs over time

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "retrieval-lens": {
    "command": "npx",
    "args": ["-y","retrieval-lens"]
  }
}
```

## Documentation

## What Vbj1808/retrieval-lens MCP server does

Vbj1808/retrieval-lens MCP server records the inputs and results of retrieval steps inside a RAG pipeline. Each observed run can include the user query, retrieved chunk content, relevance scores, source identifiers, and result rankings. The recorded data provides a reference for investigating what an agent actually received before generating an answer.

The server focuses on retrieval rather than full application or model observability. It is suited to debugging cases where the answer is wrong but the cause is unclear: the retriever may have returned irrelevant material, scores may have shifted, or ranking may have changed after a pipeline update.

## How it works

A RAG application calls `retrieval_observe` after a retrieval step and supplies a run ID, query, chunks, scores, sources, and ranks. An optional pipeline tag can identify the application or retrieval pipeline.

After data has been recorded, `retrieval_query` can replay the material associated with an earlier answer or retrieval event. `retrieval_diff` compares two runs and reports changes such as different results or score drift. `retrieval_stats` summarizes retrieval behavior across runs, including score distributions, frequently appearing sources, and activity over time.

The repository also includes adapter examples for LangChain and LlamaIndex.

## Setup and configuration

Run Vbj1808/retrieval-lens MCP server directly with npx:

```bash
npx retrieval-lens
```

For Claude Code, the documented command is:

```bash
claude mcp add retrieval-lens npx retrieval-lens
```

Once configured, the RAG application must call `retrieval_observe` after each retrieval step. A run should include a unique `run_id`, the retrieval `query`, and a `chunks` list. Each chunk may contain its content, score, source, and rank. The example also uses `pipeline_tag` to label the pipeline.

Storage is described as local SQLite, and the project states that data does not leave the local machine.

## Tools and capabilities

- `retrieval_observe` records a retrieval run and its query, chunks, scores, sources, and rankings.
- `retrieval_query` replays what the model saw before a particular answer.
- `retrieval_diff` compares two retrieval runs to identify changed results and score movement.
- `retrieval_stats` aggregates score distributions, top sources, and runs over time.

The project is marked as being in active development. Its completed feature list covers the four tools above, but future behavior may change. The server is designed for retrieval inspection and does not claim to provide general LLM call tracing or a complete observability platform.

_Full upstream README: https://allmcps.com/mcp/vbj1808-retrieval-lens/readme_

