Reranks and filters retrieved context locally to reduce RAG token usage before sending data to an LLM.
Also known as AsterMindAI/astermind-mcp, astermind-mcp, @astermind/astermind-mcp
- Stars
- 1
- Tools
- 10
- Downloads, 30 days
- 179
- Latest version
- 0.1.0
- Last commit
- Sep 25, 2026
- License
- MIT
What is AsterMind MCP?
AsterMind reranks and filters retrieved context locally to reduce RAG token usage before sending data to an LLM. It exposes 10 tools, such as rerank_documents, filter_context, compress_context.
Summary generated from the project's README
About AsterMind MCP server
AsterMind MCP provides a local solution for managing retrieved context in RAG pipelines. It functions by ranking and filtering data on your own machine before it reaches an LLM, which helps reduce the number of tokens sent in each request. Because the processing happens locally using the AsterMind Community Edition ELM engine, no data leaves your machine and no API keys are required for the server itself.
Developers can integrate this server into clients like Claude Desktop, Cursor, VS Code, or Cline using npx. The server includes ten specific tools to manage text, such as rerank_documents for ordering candidates, filter_context for selecting top-K passages, and compress_context to trim blocks to a specific token budget. It also offers utility tools like count_tokens and estimate_savings to track the impact of filtering. This approach allows you to retrieve a broad set of information but only pay for the most relevant passages when calling an LLM.
What you can do with it
- 1Optimize single-hop queriesKeep only the top one to three passages for simple FAQ or support lookups to maximize savings.
Written from the project's README. Every use case is checked against a quote from it.
How to install AsterMind MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall AsterMind MCP in Claude Code
$ claude mcp add astermind-mcp -- npx -y @astermind/astermind-mcpInstall AsterMind MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"astermind-mcp": {
"command": "npx",
"args": [
"-y",
"@astermind/astermind-mcp"
]
}
}
}Install AsterMind MCP in VS Code
.vscode/mcp.json
{
"servers": {
"astermind-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@astermind/astermind-mcp"
]
}
}
}Install AsterMind MCP in VS Code CLI
$ code --add-mcp '{"name":"astermind-mcp","type":"stdio","command":"npx","args":["-y","@astermind/astermind-mcp"]}'Install AsterMind MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"astermind-mcp": {
"command": "npx",
"args": [
"-y",
"@astermind/astermind-mcp"
]
}
}
}Install AsterMind MCP in Codex
$ codex mcp add astermind-mcp -- npx -y @astermind/astermind-mcpInstall AsterMind MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.astermind-mcp] command = "npx" args = ["-y", "@astermind/astermind-mcp"]
Install AsterMind MCP in Gemini CLI
$ gemini mcp add -s user astermind-mcp npx -- -y @astermind/astermind-mcpInstall AsterMind MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"astermind-mcp": {
"command": "npx",
"args": [
"-y",
"@astermind/astermind-mcp"
]
}
}
}AsterMind MCP tools 10
Detected from the READMErerank_documentsfilter_contextcompress_contextcount_tokensestimate_savingssemantic_searchdetect_languageclassify_textgenerate_embeddingscompare_texts
| rerank_documents | — | |
| filter_context | — | |
| compress_context | — | |
| count_tokens | — | |
| estimate_savings | — | |
| semantic_search | — | |
| detect_language | — | |
| classify_text | — | |
| generate_embeddings | — | |
| compare_texts | — |
Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachableastermindai/astermind-mcp is public and reachablegithub.com/astermindai/astermind-mcp ↗Pass
- Package names this repository as its source@astermind/astermind-mcp names astermindai/astermind-mcp as sourcenpmjs.com/package/@astermind/astermind-mcp ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-09-25github.com/astermindai/astermind-mcp ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from @astermind/astermind-mcpPass
- No critical advisory in the package or its dependencies101 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model10 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubAsterMind MCP
Cut the tokens you send to an LLM — on your own machine, before the call goes out.
AsterMind MCP is a Model Context Protocol server that ranks and filters your retrieved context locally, so you send the model the few passages that actually answer the question instead of everything your retriever returned. It runs on the AsterMind Community Edition ELM engine. No network calls, no API keys, no data leaves the machine.
What it actually does (measured, not promised)
On a 6-scenario RAG benchmark (support KB, API docs, HR policy, e-commerce FAQ, DevOps runbook, fintech help), filtering 10 retrieved candidates down to the top 3 by rerank score:
| Metric | Result |
|---|---|
| Average context-token saving | 66.9% (66.8% overall by tokens) |
| Answer-present hit rate | 100% (a passage that answers the query survived filtering in every scenario) |
| Total tokens | 926 → 307 |
| Strict "all relevant passages kept" recall | 55.6% |
| Precision | 50% |
Tokens counted with gpt-tokenizer
(o200k/cl100k BPE, OpenAI-compatible). Reproduce it yourself: npm run benchmark.
Full methodology and per-scenario results are in BENCHMARK.md.
The honest tradeoff
Savings and recall move in opposite directions — keep fewer chunks, save more tokens, risk dropping a relevant one. You choose the point on the curve:
| Keep top-K of 10 | Token saving | Answer-present hit rate | All-relevant recall |
|---|---|---|---|
| 1 | ~87.9% | 100% | 38.9% |
| 3 (default) | 66.8% | 100% | ~55–75% |
| 6 | ~46% | 100% | 75% |
Rank-1 surfaced a relevant passage in 100% of scenarios at every K we tested. That is the strong, defensible result. For single-hop questions (FAQ, support, one-fact lookups) keep top 1–3 and cut ~67–88% of context. For multi-hop questions that need several passages, keep top 5–6 — don't over-filter, or you'll drop a needed passage.
Install
npx @astermind/astermind-mcp
Or add it to your MCP client config (Claude Desktop, Cursor, VS Code, Cline):
{
"mcpServers": {
"astermind": {
"command": "npx",
"args": ["-y", "@astermind/astermind-mcp"]
}
}
}
Runs on Node 18+. No GPU, no build step, no configuration.
Tools (10)
| Tool | What it does | Strength |
|---|---|---|
rerank_documents |
Score & order candidates against a query | Strong — the core value |
filter_context |
Keep the top-K / above-threshold passages | Strong |
compress_context |
Rerank + trim a context block to a token budget | Strong |
count_tokens |
Exact BPE token count for any text | Exact |
estimate_savings |
Before/after token delta for a filtering choice | Exact |
semantic_search |
Rank a corpus against a query | Good (lexical) |
detect_language |
Identify text language | Good, confidence-flagged |
classify_text |
Label text into supplied categories | Weak — low-confidence flagged |
generate_embeddings |
Character-level vector for text | Near-duplicate use only |
compare_texts |
Similarity between two texts | Near-duplicate use only |
Every tool returns a confidence signal. Where the engine is weak, the tool says so rather than guessing silently.
Known limitations (stated on purpose)
- The reranker is lexical (TF-IDF). It matches on shared terms, so pure synonym gaps can be missed — a query for "payment methods" won't strongly rank a passage that only says "Visa/Mastercard." It excels when the query and the answer share vocabulary, which is the common RAG case.
- Classification is weak out of the box and only fair after training — use it as a low-confidence hint, not a decision-maker. It flags low confidence.
- Embeddings are character-level, useful for near-duplicate detection, not deep semantic similarity.
The token savings above are real only because a relevant passage is preserved. Cutting tokens by dropping the answer is not a saving, and this benchmark measures both.
When this saves you money
The server does not shrink an LLM's vocabulary or compress prompts magically. It saves tokens one specific way: you retrieve broadly, then send the model only the passages that matter. If your RAG pipeline currently stuffs 8–12 retrieved chunks into every prompt, reranking locally and sending 3 is a direct, repeatable cut to your per-call input tokens — and it runs on your machine for free.
Develop & verify
npm install
npm test # engine + MCP client round-trip tests
npm run benchmark # regenerates benchmark/results.json
npm run benchmark:sweep # top-K policy sweep
License
MIT © AsterMind AI. Built on @astermind/astermind-community.
AsterMind MCP questions
How do I add AsterMind MCP to Claude Code?
Run claude mcp add astermind-mcp -- npx -y @astermind/astermind-mcp in your terminal. Add --scope user to make it available in every project.
How do I add AsterMind MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does AsterMind MCP provide?
It exposes 10 tools, including rerank_documents, filter_context, compress_context, count_tokens, estimate_savings.
Does this require an API key or internet connection?
No, it runs locally on your machine with no network calls or API keys required.
How much can I save on context tokens?
On average, you can save approximately 66.9% of context tokens by filtering retrieved candidates.
What are the hardware requirements for running AsterMind?
It runs on Node 18+ and does not require a GPU.
How does the reranker work?
The reranker uses lexical (TF-IDF) matching, which excels when the query and answer share vocabulary.