AsterMind MCP

v0.1.0
io.github.AsterMindAI/astermind-mcp Checked 4 days ago Published 2 months ago

On-device reranking that cuts RAG context tokens ~67% while keeping a relevant passage.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

rerank_documents Rerank documents by relevance

Rank candidate documents/chunks by relevance to a query using an on-device ELM reranker. Best when the query shares vocabulary with the documents (typical RAG). Lexical (TF-IDF) based: strong on keyword overlap, weaker on pure-synonym matches.

ParameterTypeDescription
documents *arrayCandidate documents/chunks to rank.
query *stringThe user query or question.
topKintegerReturn only the top K (default: all).

filter_context Filter context to relevant docs (token saver)

Drop documents not relevant to the query so you feed the LLM a small, relevant context instead of everything. Reports exact tokens saved using an OpenAI-compatible tokenizer. This is the core token-reduction tool.

ParameterTypeDescription
documents *array
query *string
maxDocsintegerMax docs to keep (default 5).
minRelevancenumberMin relevance 0..1 to keep a doc (default 0.5).

compress_context Compress context into a ready-to-paste block

One-shot token saver: filter candidate documents to what is relevant and return a compact, numbered context block ready to paste into a prompt, plus token-before/after accounting.

ParameterTypeDescription
documents *array
query *string
maxDocsinteger
minRelevancenumber

classify_text Classify text (train-from-examples)

Classify text into your categories using an on-device ELM trained on the labeled examples you provide. Requires at least one example per category. Returns a confidence and honestly flags low-confidence results. Use this to route/label locally instead of paying an LLM to classify.

ParameterTypeDescription
categories *arrayThe category labels.
examples *arrayLabeled training examples (>= 1 per category).
text *stringText to classify.

detect_language Detect language

Coarse language detection over 6 European languages (English, Spanish, French, German, Italian, Portuguese) using an on-device classifier. Runs locally with no API call.

ParameterTypeDescription
text *string

generate_embeddings Generate on-device embeddings

Produce deterministic local char-level embeddings for a list of texts. Good for clustering, dedupe, and near-duplicate detection. Not a substitute for large transformer embeddings on nuanced semantics.

ParameterTypeDescription
texts *array

compare_texts Compare two texts (near-duplicate similarity)

Cosine similarity (0..1) between two texts using local embeddings. Best for detecting near-duplicates / paraphrase overlap, not fine-grained semantic ranking.

ParameterTypeDescription
text1 *string
text2 *string

count_tokens Count tokens

Count tokens in a string or array of strings using an OpenAI-compatible BPE tokenizer (o200k/cl100k family). Useful for measuring context size and budgeting.

ParameterTypeDescription
text *

estimate_savings Estimate token & cost savings

Given the full context vs the filtered context you plan to send an LLM, compute tokens removed, percent saved, and (optionally) dollars saved per call for a given model input price.

ParameterTypeDescription
filteredContext *
fullContext *
usdPerMillionInputTokensnumber