grounded-rag-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grounded-rag-mcpSearch my Q3 reports and answer with citations: what were our main risks?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
grounded-rag-mcp (TypeScript)
An MCP server that gives any LLM host grounded, cited retrieval over your own documents — hybrid retrieval (BM25 + dense), reranking-ready, citations, and a built-in eval harness. The TypeScript/Node twin of the Python package.
Point it at documents. Your MCP host (Claude Desktop, an IDE, a custom agent) can then
searchandanswerover them — grounded in the real text, with citations, and an honest "not in the documents" path.
Why
Most RAG-over-MCP examples are toys. This one is built production-flavored:
Hybrid retrieval — BM25 (exact terms) + dense (semantics), fused with Reciprocal Rank Fusion.
Grounding + citations — answers cite sources; if the answer isn't in the docs, it says so.
Built-in eval — measure retrieval quality (recall@k, MRR, hit-rate), not just vibes.
Zero-dependency default — a deterministic hashing embedder runs with nothing extra.
Strict TypeScript, ESM, tested, CI on Node 18/20/22.
Related MCP server: RAG Knowledge Base MCP Server
Status
Built in public, phase by phase.
Phase 0 — scaffold, packaging, CI
Phase 1 — core retrieval (chunk → embed → BM25 + dense → RRF)
Phase 2 — MCP server (stdio) with
ingest/searchPhase 3 — grounding +
answer(via MCP sampling)Phase 4 — eval, resource + prompt, docs
Phase 5 — publish to npm
Install
npm install grounded-rag-mcp
# or run without installing:
npx grounded-rag-mcpTools
Tool | What it does |
| Chunk, embed, and index files or raw text into a named collection |
| Hybrid / dense / bm25 retrieval, per-stage scores |
| Grounded, cited answer via MCP sampling; refuses when nothing is found |
| List collections and chunk counts |
| hitRate / mrr / recallAtK on labeled cases |
Also exposes a resource (rag://collections) and a prompt (grounded_answer).
Use it with an MCP host (e.g. Claude Desktop)
{
"mcpServers": {
"grounded-rag": {
"command": "npx",
"args": ["-y", "grounded-rag-mcp"]
}
}
}Development
npm install
npm run lint && npm run format:check && npm run typecheck && npm run build && npm testLicense
MIT © Chetan C
Available Tools
5 toolsanswerA
Answer a question grounded in a collection, with citations. Retrieves relevant passages and asks the host's model (via MCP sampling) to answer using only those, citing them. Refuses (grounded=false) when nothing relevant is found.
| Name | Required | Description | Default |
|---|---|---|---|
| topK | No | ||
| query | Yes | ||
| collection | No | default |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden, and it does well: it discloses that the tool delegates to the host model via MCP sampling, restricts the answer to retrieved passages only, includes citations, and returns grounded=false when nothing relevant is found. It lacks details about response shape or error behavior, but the core behavioral traits are clearly stated.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the primary purpose, and every sentence adds meaningful behavioral information. No filler or repetition of schema content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool of moderate complexity with no annotations and no output schema, the description covers the main invocation-relevant behaviors: retrieval, generation, citation, and refusal. It stops short of detailing the exact return structure of grounded=false or citation formatting, but an agent can invoke the tool correctly with the information provided.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate for parameter meaning. It implicitly relates 'question' to query and 'collection' to the collection parameter, and 'retrieves relevant passages' hints at topK, but it never explicitly explains topK or the meaning of the defaults. The description adds some context but not enough to fully clarify all three parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a clear verb-resource pair ('Answer a question grounded in a collection') and adds differentiators: citations, retrieval, MCP sampling, and refusal. This clearly separates it from siblings like search or list_collections.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It clearly implies when to use the tool: when the agent needs a grounded, cited answer synthesized from relevant passages in a collection. It does not explicitly name alternatives or exclusions like 'use search for raw passages', but the contextual phrasing is strong enough that an agent can infer the appropriate use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
evaluate_retrievalA
Measure retrieval quality on labeled cases: hitRate, mrr, recallAtK. Each case is {query, relevantSources}. Use it to quantify quality and catch regressions.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid | |
| topK | No | ||
| cases | Yes | ||
| collection | No | default |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations available, the description carries the behavioral burden. It conveys that the tool is observational/read-only through 'measure' and 'quantify,' and clarifies it consumes labeled cases rather than modifying documents. It does not spell out side-effect absence or output shape, but the evaluation framing is non-mutating and sufficient.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences front-load the action and metrics, then add the case format and purpose. No filler or repetition of schema defaults.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is adequate for choosing the tool and constructing the required cases, and it names the metrics returned. However, with no output schema and no annotations, it could usefully state how mode/topK/collection affect the evaluation and that it requires a populated collection.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, but it only explains the required 'cases' parameter ('Each case is {query, relevantSources}'). It adds no meaning for mode, topK, or collection, leaving their semantics to be guessed from names and defaults.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Measure') and a precise resource ('retrieval quality on labeled cases'), then names concrete metrics: hitRate, mrr, recallAtK. This clearly separates it from sibling tools like search (retrieval) and answer (generation).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly says 'Use it to quantify quality and catch regressions,' giving a clear context for invocation. It does not name when-not-to-use alternatives, so it falls just short of the highest bar.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ingest_documentsB
Ingest documents into a named collection so they can be searched. Provide paths (files/dirs of .txt/.md) and/or texts (raw strings). Returns chunks added and total.
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No | ||
| texts | No | ||
| chunkSize | No | ||
| collection | No | default | |
| chunkOverlap | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosing side effects. 'Ingest' implies a write/mutation, but the description does not mention persistence, collection creation behavior, duplicate handling, chunking consequences, or failure behavior. It does add that it returns chunks added and total, which is useful but insufficient for an unannotated write operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two tight sentences with no fluff, front-loading the core purpose and then giving input guidance. It earns its place, though it is concise partly because it omits important parameter and behavior details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with 5 parameters, zero annotations, zero schema description coverage, and no output schema, this description is not complete enough. It covers the two input sources but leaves chunking parameters and collection behavior to inference, and it only vaguely describes the return value.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It explains paths ('files/dirs of .txt/.md') and texts ('raw strings'), but it does not explain chunkSize, chunkOverlap, or the collection parameter beyond the vague phrase 'named collection.' This is a significant gap for a 5-parameter tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and resource: 'Ingest documents into a named collection so they can be searched.' It clearly distinguishes this ingestion tool from the search/answer/evaluation siblings, and it names the two relevant input forms, paths and texts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies clear usage context: use this tool to add documents to a collection before searching them. However, it never explicitly names alternatives or states when not to use it, so it stops short of the strongest possible routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_collectionsA
List all ingested collections and how many chunks each contains.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the behavioral transparency burden. It clearly conveys that the operation is a non-mutating listing action and discloses what the agent will receive: collection names and chunk counts. As a zero-parameter listing tool, this is sufficient transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no wasted words. It front-loads the action ('List all ingested collections') and then supplies the key output detail, making it easy for an agent to parse quickly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, but the description tells the agent exactly what the tool returns. It names the resource, the scope ('all ingested'), and the relevant output field (chunk count), so nothing critical is missing for correct invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters, so the baseline is 4. The description does not need to explain parameter meaning because the schema is empty and there is nothing to document.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb and resource: 'List all ingested collections' and adds the chunk-count detail, making the tool's purpose unmistakable. It is clearly distinct from the sibling tools, which handle ingestion, search, answering, and retrieval evaluation rather than listing collections.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: use this tool when you need the set of ingested collections and their chunk counts. It does not explicitly name alternatives or exclusions, but none of the sibling tools appear to overlap with this listing function.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
searchA
Search a collection and return the most relevant chunks, each with its source and per-stage scores. mode: hybrid (default) | dense | bm25. Empty result = not in the docs.
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | hybrid | |
| topK | No | ||
| query | Yes | ||
| collection | No | default |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the burden of behavioral disclosure. It does reveal return shape ('each with its source and per-stage scores') and the important empty-result semantics. However, it does not explicitly state that this is read-only, what error conditions exist, or any rate-limit/auth considerations, leaving some behavioral traits implicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler: purpose and output are front-loaded, mode options are compactly summarized, and the empty-result note earns its place as an operational signal. Highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description covers purpose, output, mode options, and empty-result interpretation, which is adequate for a basic call with defaults. Yet with no annotations and no output schema, it leaves the meaning of 'collection' and 'topK' implicit, and it does not mention error behavior or side effects. Serviceable but not fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate, but it only restates the 'mode' enum and default already present in the schema. It does not explain the semantics of 'query', 'collection', or 'topK' beyond what an agent might infer from names and defaults. This is a real gap for a tool with four parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Search'), a resource ('a collection'), and a concrete output ('the most relevant chunks, each with its source and per-stage scores'). This clearly distinguishes it from sibling tools like answer, ingest_documents, list_collections, and evaluate_retrieval.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the primary use case: retrieving relevant chunks from a collection. It does not explicitly name alternatives or state when not to use it, but the context is clear enough that an agent should know to call this for raw retrieval rather than generation or ingestion.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
answer - First observed
evaluate_retrieval - First observed
ingest_documents - First observed
list_collections - First observed
search
TDQS
Scored across 5 tools
Each tool has a clearly distinct role: ingest_documents adds content, search retrieves chunks, list_collections inspects collections, answer produces grounded responses with citations, and evaluate_retrieval measures quality. There is no meaningful overlap that would cause an agent to select the wrong tool.
Most tool names follow a clear verb_noun pattern like ingest_documents, list_collections, and evaluate_retrieval. search and answer are single verbs but are still intuitive and consistent in style, creating only minor deviation.
Five tools is well-scoped for a grounded RAG server: ingestion, listing, retrieval, grounded answering, and evaluation. Each tool earns its place without redundancy or bloat.
The core RAG workflow is covered end-to-end, including ingestion, retrieval, grounded answering, and retrieval evaluation. The main gap is the lack of deletion or update operations for documents and collections, which agents would need for full lifecycle management.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Ingest, manage, and retrieve documents for RAG-powered AI applications
Search your knowledge bases from any AI assistant using hybrid RAG.
Turn documents into structured, AI-ready data by parsing, enriching, chunking, and embedding.
- KumbukaOAuthai.kumbuka
Governed, auditable knowledge your team curates for its AI assistants, self-hostable
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered querying of PDF documents using hybrid retrieval (BM25 + vector search) and retrieval-augmented generation, returning structured answers with source citations and confidence scores.-
- FlicenseNot gradedqualityCmaintenanceEnables searching a knowledge base and asking grounded questions with hybrid retrieval, reranking, and cited answers.-
- FlicenseNot gradedqualityCmaintenanceEnables document Q&A and knowledge retrieval through hybrid semantic and keyword search, with tools for document ingestion, chunking, summarization, PII redaction, and RAGAS-based evaluation.-
- FlicenseNot gradedqualityCmaintenanceEnables document indexing and question answering with Retrieval-Augmented Generation, providing cited answers from user-supplied documents.-