mcp-rag-service
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., "@mcp-rag-serviceWhat are the payment terms in the Nordwind contract?"
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.
mcp-rag-service
A production-minded Retrieval-Augmented Generation (RAG) service you can plug into any LLM through the Model Context Protocol (MCP) — with PII redaction guardrails and a retrieval-first evaluation harness, packaged for Docker and Kubernetes.
I built this because I wanted a single, safe "answer questions over my documents" tool that any MCP-aware assistant (Claude, an IDE agent, my own scripts) could call — without leaking personal data and without me having to trust the answers blindly. So it answers only from retrieved passages, cites its sources, redacts PII before anything touches the model, and ships with an eval script that measures retrieval quality rather than vibes.
Why it exists (the real problem)
An LLM on its own hallucinates and can't see your private documents. Wrapping retrieval around it fixes both — but three things are usually missing from demo RAG:
It isn't callable from other tools. Here it's exposed as an MCP server, so any MCP client can use it as a first-class tool.
It leaks PII. Emails, phone numbers, IBANs and card-like numbers are redacted before retrieval and before the prompt (asymmetric-cost thinking: a redaction is cheap, an accidental leak into a model/log is expensive).
Nobody measures it. A
hit@k+ grounded-answer eval harness makes quality a number, not a feeling. Most "RAG hallucination" is really a retrieval miss, so I measure retrieval first.
Related MCP server: MCP-RAGAnything
Architecture
MCP client (Claude / agent)
│ tool: rag_query(question)
▼
MCP server (src/mcp_rag/server.py)
│
RAG pipeline (rag.py)
│ 1. redact PII (guardrails.py)
│ 2. hybrid retrieve (retriever.py: dense + BM25, score-fused)
│ 3. generate grounded, cited answer (LLM, or extractive fallback)
▼
{answer, citations[], redactions[]}Hybrid retrieval: dense embeddings (meaning) fused with BM25 (exact terms like IDs and names). Runs fully offline with a hashing embedder + pure-Python BM25 fallback, so there is no API key required for development — the paid LLM is used only for the final wording.
Guardrails:
guardrails.pyredacts PII with well-tested patterns (and optionally Microsoft Presidio if installed).Grounding: answers are built only from retrieved chunks and carry
[n]citations; if nothing relevant is retrieved it says so instead of guessing.
Run it
pip install -r requirements.txt
python -m mcp_rag.ingest data/ # index your documents
python -m mcp_rag.server # start the MCP server (stdio)Query it directly (no MCP client needed):
python -m mcp_rag.rag "What are the payment terms in the Nordwind contract?"Evaluate retrieval quality:
python eval/run_eval.py # prints hit@k and grounded-answer rateDeploy (Docker + Kubernetes)
docker build -t mcp-rag-service -f deploy/Dockerfile .
kubectl apply -f deploy/k8s.yaml # Deployment + Service, readiness/liveness probesTech
Python · MCP (FastMCP) · FAISS / hashing-embedder fallback · BM25 · FastAPI (HTTP mode) · Presidio-optional PII redaction · pytest · Docker · Kubernetes.
Status
Working core (retrieval, guardrails, MCP tool, eval) + container/K8s manifests. Corpus in
data/ is a small sample; point ingest at your own documents to use it for real.
This server cannot be installed
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 Servers
- Flicense-qualityDmaintenanceMCP server that enables querying an HR FAQ document via RAG, returning accurate answers and related chunks, and supports index rebuilding and response evaluation.Last updated
- Flicense-qualityCmaintenanceMulti-modal RAG service exposing a REST API and MCP server for document indexing and knowledge-base querying, powered by RAGAnything and LightRAG.Last updated14
- Flicense-qualityCmaintenanceAn enterprise-ready MCP server that exposes a RAG tool for retrieving relevant context and metadata from a Qdrant vector database using natural language queries.Last updated2
- Flicense-qualityBmaintenanceMCP server for a modular RAG system that enables natural language question answering over enterprise documents with intent-aware routing, adaptive retrieval, and citation-backed responses.Last updated
Related MCP Connectors
Local-first RAG engine with MCP server for AI agent integration.
Hosted MCP server exposing US hospital procedure cost data to AI assistants
Multi-engine search for AI agents. Trust scoring, local corpus, MCP-native. Self-hostable, BYOK.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Gurmeher23/mcp-rag-service'
If you have feedback or need assistance with the MCP directory API, please join our Discord server