Searchable agent memory: BM25 corpus recall, original-text injection, remember/forget capsules.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
One-click editor setup isn’t available for this listing yet — we don’t have a confirmed install command, and we’d rather show nothing than point your editor at the wrong package or host. Follow the project’s own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Vl Msa Rs.
msa_indexIndex a document; existing chunks for `doc_id` are replaced.
msa_searchTop-k chunks, score normalized 0.0–1.0.
msa_fetch_docFull original text of a document.
msa_deleteRemove a document and all its chunks.
msa_list_collectionsCollections open in the registry.
msa_statsPer-collection statistics (exact `num_documents` / `total_tokens`).
A searchable long-term memory for AI agents, exposed as an MCP stdio server.
Index documents, notes and past conversations into collections; retrieve the
top-k relevant chunks for a query and inject the original text back to the
model; add or drop agent memories with msa_remember / msa_forget. Pure
Rust, BM25 over tantivy, zero ML
deps in the default build; optional in-process dense rerank.
Any MCP client (Claude Code, Codex, or anything speaking MCP stdio) gets the same memory: a queryable corpus that survives across sessions and model swaps, with no cloud account and no embedding service required. Use it to give an agent durable recall over a knowledge base, a docs tree, or its own chat history — retrieval that returns the original text, not just embeddings.
It is one half of a two-part memory: this server is the library (corpus recall), its companion mcp-memory-rs is the notebook (curated state). An agent that swaps models loses neither.
The name: msa is the retrieval pattern it borrows from the Memory Sparse
Attention paper (arXiv:2603.23516) — an extrinsic approximation, not the
neural model; distinct from MiniMax's MSA-architecture LLMs, which are
intrinsic (in-model) generators. vl is for Vivling (codex-vl), its first
adopter — but the server is fully AI-agnostic and depends on nothing from it.
Status: v0.4 — hybrid sparse+dense optional.
The original Memory Sparse Attention paper (EverMind-AI) describes an end-to-end trainable sparse attention layer over chunk-pooled KV caches. That is a neural artifact and is not portable to a pure-Rust MCP server. What is portable, and what this repo aims to deliver, is the MSA macro pattern:
P=64 words by default, mirroring the paper).msa_search returns chunks, msa_fetch_doc returns the full document.Design and rationale are documented in the project notes (negative results, gate methodology); see docs/NEGATIVE_RESULTS.md.
Retrieval changes are decided on pre-registered, paired deltas with
bootstrap confidence intervals — not on absolute scores. Workloads: HotpotQA
(extractive QA), MLDR-it (long-doc retrieval, Italian), LongMemEval-S (500
conversational-memory questions). Full methodology, acceptance gates and
refuted hypotheses live in docs/NEGATIVE_RESULTS.md.
Headline measurements:
dense_alpha, off by default) for re-testing as
encoders improve.msa_fetch_doc after msa_search): +14.6 F1
exactly on the stratum where snippets miss the content.Reproduce:
| Tool | Since | Description |
|---|---|---|
msa_index | v0.1 | Index a document; existing chunks for doc_id are replaced. |
msa_search | v0.1 | Top-k chunks, score normalized 0.0–1.0. |
msa_fetch_doc | v0.1 | Full original text of a document. |
msa_delete | v0.1 | Remove a document and all its chunks. |
msa_list_collections | v0.1 | Collections open in the registry. |
msa_stats | v0.1 | Per-collection statistics (exact num_documents / total_tokens). |
SearchFilter | v0.2 | Metadata filter (where_eq/where_in/created_*), post-retrieval. |
msa_search_iterative | v0.3 | Memory Interleave with server-side cursor; dedups across rounds. |
msa_drop_session | v0.3 | Force-evict a Memory Interleave session before TTL. |
dense_alpha on msa_search | v0.4 | Hybrid BM25 + cosine rerank. Requires --features embeddings + [embeddings] config. |
msa_remember / msa_forget | v0.4 | Agent-memory surface: enrich + low-signal gate + content-hash dedup; standard metadata (kind / source_id / created_at). |
msa_sync_path | v0.4 | Mirror a directory into a collection (filesystem source; blake3 delta sync). |
Prebuilt binary (recommended) — download the archive for your platform from the latest release, extract, and point your MCP client at the binary:
Prebuilt targets (Linux + Android): x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl, aarch64-unknown-linux-gnu,
aarch64-unknown-linux-musl (edge / ARM / Termux), aarch64-linux-android.
macOS: no prebuilt binary is shipped (it would need Apple code-signing).
Install from source instead — cargo install below compiles it on your Mac in
one command, no signing needed.
From source (Rust toolchain) — --locked is required (the workspace
Cargo.lock pins a working time / tantivy-common resolution; a fresh
resolve breaks the build), and mcp-msa-server is the package name (the
binary it installs is mcp-vl-msa-rs):
Add [embeddings] to MCP_MSA_CONFIG to activate dense rerank. Without
this section the server stays in BM25-only mode even when the binary was
built with --features embeddings.
The production backend is candle-modernbert: the encoder runs in-process
(Candle), offline-deterministic, from a local model bundle — no daemon, no
network at runtime, no automatic downloads. Prepare the bundle once with
scripts/prepare-granite-r2-97m.sh.
A transitional backend = "ollama" (HTTP to an Ollama-compatible service)
still exists but is deprecated and scheduled for removal in v0.6 — do not
build new setups on it.
The AI client opts into hybrid scoring per-call by passing dense_alpha
to msa_search (or any future tool that supports it). dense_alpha = 1.0
(default) is BM25-only; 0.0 is dense-only; intermediate values are a
linear blend α·bm25 + (1-α)·((cos+1)/2). Cosine is shifted to [0,1]
so it composes linearly with the already max-normalized BM25 score.
Example ~/.codex/config.toml entry:
Equivalent ~/.claude.json entry for Claude Code:
Factual signals from GitHub, npm, and our automated checks — not a rating.
No reviews yet — be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/mcp-vl-msa-rs)<a href="https://allmcps.com/mcp/mcp-vl-msa-rs"><img src="https://allmcps.com/api/badge/mcp-vl-msa-rs?style=directory" alt="MCP Vl Msa Rs on AllMCPs" /></a>