npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@astermind/astermind-mcp

v0.1.0

Published

MCP server that cuts LLM token usage with on-device reranking, context filtering, and classification (AsterMind ELM). Nothing leaves the machine.

Readme

AsterMind 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.