recall mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
recall
Local, bilingual semantic search over a library of technical books, built for a coding assistant (Claude Code and Claude Desktop). Ask in Spanish or English; recall finds the right passage in English books and hands it to the assistant with its citation (book, chapter, page).
It works in two ways: a hook that quietly adds the relevant passages to a prompt when — and only when — they clear a similarity threshold, and an MCP tool the assistant calls when it wants to search on its own.
Local retrieval. Indexing and search never touch the network: the embedding model runs from a local snapshot on your GPU,
HF_HUB_OFFLINE=1is set on import, andhuggingface-hubis not even installed. The search service listens only on127.0.0.1behind a random token. The passages recall injects do become part of your prompt, so they reach whatever provider runs your assistant — index only documents you are willing to share with it.Bring your own books. The repository contains no book content — only the code, bibliographic metadata and the evaluation queries. You index your own Markdown-converted library.
New here? Start with the User Manual: setup, indexing, connecting Claude Code and Desktop, configuration and troubleshooting. The study behind the current configuration is in the paper.
Contents
Related MCP server: pergamos
Why
A coding assistant answers from memory. When you own a shelf of good books on architecture, data, SRE, security or testing, you want it to cite them instead — and you want that to happen without asking every time, and without noise when the books have nothing to say. That last part is the hard one: automatic injection needs an absolute score that says "this is relevant enough", not just a ranking. recall is built around that score.
Quickstart
Windows 10/11 x64, Python 3.12 and uv, in PowerShell (Windows PowerShell 5.1 or pwsh 7).
1. Install
Install the locked environment (every package hash-pinned) plus recall itself,
so that python -I -m recall works. CI runs the second block verbatim on every
push.
git clone https://github.com/andreshma/recall.git
cd recalluv venv --python 3.12 .venv
uv pip sync --require-hashes --python .venv\Scripts\python.exe requirements.lock
uv pip install --no-deps --no-build-isolation --python .venv\Scripts\python.exe -e .
.venv\Scripts\python.exe -I -m recall --helpRun the uv pip install ... -e . line again after any later uv pip sync
(sync removes packages that are not in the lock, recall included).
2. Get the embedding model
recall never downloads anything. Fetch an
ONNX snapshot once, with any tool you like and outside recall's environment —
for example git clone https://huggingface.co/onnx-community/embeddinggemma-300m-ONNX
with Git LFS installed (accept the model's license on its page first; the
Gemma models are gated). The folder must contain onnx/model_quantized.onnx
(plus its .onnx_data, if any) and tokenizer.json; its name is recorded as
the revision. Point model.snapshot in %LOCALAPPDATA%\recall\config.json at
it (USAGE §2.2); the recommended model and
settings are in config.example.json.
3. Point recall at your library
The library is Markdown, one file per chapter, one
folder per book (input contract). The
default root is %USERPROFILE%\books\md; set collections.books.roots in the
same config.json to use another folder.
4. Index, search, check
.venv\Scripts\python.exe -I -m recall index # incremental; the first full run takes hours
.venv\Scripts\python.exe -I -m recall search "tasa de consumo del presupuesto de errores" "error budget burn rate" --text
.venv\Scripts\python.exe -I -m recall statusThen wire it into Claude Code and Desktop (MCP server + hooks) following the User Manual.
How it works
The diagram follows a book from its Markdown chapters to the passages the assistant receives.
flowchart LR
L["PDF/EPUB books"] --> M["Markdown per chapter"]
M --> I["recall index<br/>incremental, atomic batches"]
I --> DB[("SQLite WAL<br/>float32 vectors + FTS5")]
P[("Page map")] --> S
DB --> S["recall serve<br/>127.0.0.1 + Bearer token<br/>model kept warm"]
U["User prompt"] --> H["Hook<br/>threshold · 1.5 s budget · fail-open"]
H -->|HTTP| S
H -->|passages + citation| A["Assistant"]
A -->|recall_books_search| MCP["MCP server · stdio"]
MCP --> SThree principles keep it useful and out of the way:
Absolute scores. Search returns the raw cosine between question and passage. The hook injects only above a calibrated threshold, so unrelated prompts ("make the README title bold") get nothing.
Fail open. The hook has a 1.5 s budget. On any error, timeout or low score, the prompt goes through unchanged. It starts in shadow mode: it logs what it would have injected (a hash of the prompt, never its text) so the threshold can be calibrated on real use before switching on.
The index knows its model. Model files, prefixes and chunking are part of the index identity. Searching with a different model is an explicit error, never silently wrong results.
The four flows behind the diagram — the indexing pipeline, search inside the service, automatic injection (hook) and explicit search (MCP) — are described step by step, each with its diagram, in docs/architecture.md. Every diagram of the project (context, components, sequences, trust boundaries) is in docs/DIAGRAMS.md.
Components
Component | What it does | Where |
| Splits the Markdown chapters by section into chunks and stores text + vector in SQLite. Incremental: only changed chapters are reprocessed, and any already-embedded text reuses its vector. |
|
| Local service with the model loaded (DirectML GPU, CPU fallback). Hybrid search: vector first, fused with FTS5 via RRF, deduplicated by section. |
|
|
|
|
| Dependency-free MCP server exposing |
|
|
|
|
| Year (from the copyright page), edition, format and topic domains for each book; shipped inside the package too. |
|
| Maps each Markdown line to its printed PDF page, for citations like "p. 199". |
|
| Read-only integrity verifier for any index. |
|
| Summarizes the shadow log: how many real prompts each candidate threshold would inject. |
|
| Indexes another model or chunking into its own directory and compares it with production. |
|
Usage
Command | What it does |
| Index the library (incremental). |
| Search with one or more phrasings. |
| Run the local search service. |
| Run the MCP server over stdio. |
| Show index and service state. |
| Regression metrics (R@5, MRR@10). |
| Verify index integrity, read-only. |
| Shadow-mode summary for threshold calibration. |
| Build experiment indexes without touching production. |
| Compare production and experiments on the 80 queries. |
Run everything with the project interpreter in isolated mode:
.venv\Scripts\python.exe -I -m recall …. The full guide, from install to uninstall, is the
User Manual.
Results
From the study in docs/paper.md, a dated snapshot (2026-11-05): 126 books (3,184 chapters) at the time, with 80 hand-labeled queries (40 Spanish, 40 English) and 28 negative prompts. The library has grown since (148 books); the chunk counts below are for the 126.
Configuration | Chunks | R@5 | R@5 ES→EN | MRR@10 | Separation |
Baseline: embeddinggemma-300m, ~900 chars | 111,407 | 0.975 | 0.975 | 0.883 | 0.944 |
Production (E5): embeddinggemma-2, ~3,500 chars | 34,721 | 0.988 | 0.975 | 0.898 | 1.000 |
Separation is the share of relevant queries scoring above the highest unrelated prompt; 1.0 means a threshold exists that accepts all of them and rejects every negative. Production started with a threshold of 0.75 (96.7 % of relevant queries pass and none of the negatives); real prompts in shadow mode then showed a few generic chapters matching almost everything, so the hook now subtracts a per-chunk hub prior first and uses 0.76 on that adjusted score (ADR 0011). Search latency is ~0.13 s (median) and the full hook round trip 0.4–0.6 s.
The study also documents that the quantized ONNX export of Qwen3-Embedding-0.6B is not padding-invariant — a vector changes with whatever else shares its batch — which the integrity verifier caught before evaluation.
Configuration
State lives in %LOCALAPPDATA%\recall (override with RECALL_HOME): the index,
service.json (port and token), shadow.log, and an optional config.json:
{
"collections": {"books": {"roots": ["C:\\Users\\<user>\\books\\md"]}},
"chunking": {"target": 3200, "max_chars": 3500, "min_chars": 1500, "overlap": 400},
"model": {"name": "onnx-community/embeddinggemma-2-ONNX", "snapshot": "<local snapshot dir>",
"doc_max_tokens": 1100, "batch_size": 8},
"search": {"query_window_tokens": 32},
"hook": {"mode": "shadow", "threshold": 0.76}
}Setting | Default | Meaning |
|
| Library roots, in precedence order (a book in an earlier root replaces the same book in a later one). A configured root that does not exist is reported as an error; its books stay indexed. |
| ~900 chars | Chunk target, limits and overlap. Part of the index identity. |
| embeddinggemma-300m | Model name, snapshot, prefixes, pooling. Part of the index identity. |
|
|
|
| per model | Minimum cosine to inject. Recalibrate whenever the model changes. |
The code defaults are the baseline configuration, so existing indexes
keep working. To use the configuration measured as best (E5), start from
config.example.json: copy it to
%LOCALAPPDATA%\recall\config.json, point snapshot at your local
embeddinggemma-2 download, and run recall index --rebuild.
Changing chunking or model requires recall index --rebuild. Full
reference: User Manual §10.
Security model
Local retrieval:
127.0.0.1, ephemeral port, random Bearer token compared in constant time; no network calls at run time. Clients check that the server proves it knows the token (GET /proof, an HMAC bound to its port) before they send the token or a prompt.Read-only search: the service and the MCP server open the index read-only.
Passages are data: injected passages are wrapped in a block that marks them as reference data, not instructions; in every field taken from the index (text, headings, year, path…)
<,>and their look-alikes become</>and line breaks are collapsed, so no field can close that block or forge an entry.Paths: the hook cites library-relative paths (
book-id/chapter.md); the MCP tool returns the absolute local path so the assistant can open the file — that path (which includes your user name) reaches the assistant's provider.Pinned supply chain: every dependency hash-pinned in
requirements.lock;huggingface-hubexcluded on purpose.
Full analysis: docs/THREAT_MODEL.md. Found a vulnerability? Report it privately — see SECURITY.md.
Testing
.venv\Scripts\python.exe -I -m pytest # unit suite (default; excludes `model`)
.venv\Scripts\python.exe -I -m pytest -m model # model suite (real model + real index)The unit suite needs no model and runs in CI; the model suite and the index
integrity check (tools\verify_index.py) run locally. Suites, fixtures, CI
jobs and lint commands: docs/TESTING.md.
Status
Alpha, in daily use on one machine (Windows 11, DirectML). The index, service, hook, MCP server, page citations and filters are in place; the hook runs in shadow mode while its threshold is calibrated on real prompts.
The unit suite (238 tests, no model needed) runs in CI on Windows. The
model suite (pytest -m model, 14 tests) needs the real model and a
full index and runs locally, with floors set to the measured production
numbers — see docs/TESTING.md.
Known limits are listed in USAGE §16; open items of the study (more negative prompts, a second labeler, an automatic batch-invariance check) are in docs/paper.md and CONTRIBUTING.md.
Documentation
Document | What it answers |
Setup, indexing, Claude Code/Desktop, configuration, troubleshooting. | |
Context, components, flows, state, invariants. | |
Every diagram in one place: context, components, sequences, trust boundaries. | |
Unit suite, model regression, integrity checks, CI. | |
STRIDE analysis, supply chain, accepted risks. | |
Operations, symptoms and recovery, by task. | |
Why each significant decision was taken. | |
Chunking and model study, evaluation, rollout. | |
Red-team passes and their findings. | |
Dated 360° audits, summaries and SBOMs. | |
What changed in each release, with upgrade notes. | |
Citation metadata. | |
Ground rules, dev setup, workflow, commits. | |
Expected behavior and how to report a problem. | |
Roles, how decisions are made, merging, releases. | |
Supported versions, private reporting, security model. | |
Which channel to use for which question. |
Community
Contributions are welcome. Start with CONTRIBUTING.md (dev
setup, tests, the measurement rule for thresholds and models); issues labeled
good first issue
are a good entry point.
Questions and ideas: Discussions — see SUPPORT.md
Bugs and features: issues
Vulnerabilities: privately, per SECURITY.md
How the project is run: GOVERNANCE.md · Code of Conduct
License
Apache-2.0. See LICENSE and NOTICE. Embedding models are downloaded separately and keep their own licenses.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Grounded, citable answers to tech questions from O'Reilly's library. Requires Expert MCP access.
Agentic search over your Dewey document collections from any MCP-compatible client.
Web search, scraping, RAG answers with citations, and translation as MCP tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceA library management MCP server supporting book search, member management, and loan operations through natural language commands.134MIT
- FlicenseAqualityCmaintenanceEnables bibliographic research on a private local Calibre library by providing read-only metadata search, book inspection, and optional RAG-based content retrieval through MCP.5-
- FlicenseAqualityCmaintenanceEnables Claude clients to access a private local book library, allowing users to list books, search content, and retrieve metadata, chapter summaries, action items, personal notes, and infographic text through MCP tools.7-
- FlicenseNot gradedqualityDmaintenanceEnables searching books, generating APA 7 citations, reserving available copies, and finding alternative books from a MySQL-backed library catalog through MCP.-