rag-mcp-server
Click on "Deploy 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., "@rag-mcp-serverSearch the local docs for information on GDPR compliance."
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.
RAG Document Search — MCP Server
A retrieval-augmented-generation backend that lets AI assistants search a
document set and answer questions grounded in real sources. It's exposed as a
Model Context Protocol (MCP) server, so any MCP-compatible client can call
its search tool.
Two interchangeable backends:
SQLite FTS5 keyword search — the default, zero heavy dependencies.
Chroma vector database — semantic search (
RAG_BACKEND=chroma).
Clean-room implementation written from scratch to demonstrate RAG + MCP engineering. Ships with no documents or data — you add your own.
How it works
documents/ ──▶ chunker ──▶ index (FTS5 or Chroma)
│
MCP client ──(search)──▶ server.py ──▶ ranked passages
▲
ingest.py --incremental ──┘ only re-indexes changed filesRelated MCP server: ragi
Quick start
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt
# 1) add your own .md/.txt files to ./documents (none are included)
# 2) build the index
python ingest.py --rebuild
# 3) run the MCP server (stdio transport)
python server.pySemantic mode instead of keyword:
pip install chromadb
RAG_BACKEND=chroma python ingest.py --rebuild
RAG_BACKEND=chroma python server.pyRegister with an MCP client
{
"mcpServers": {
"rag-search": {
"command": "/absolute/path/.venv/bin/python",
"args": ["/absolute/path/server.py"]
}
}
}Configuration
All tunables are in config.py: DOCS_DIR, BACKEND, CHUNK_SIZE,
CHUNK_OVERLAP, DEFAULT_TOP_K. The document directory can also be set with the
RAG_DOCS_DIR environment variable.
Design notes
Incremental ingestion: a manifest of file hashes means only new/edited files are re-processed — cheap to keep the index current (e.g. from CI or a timer).
Pluggable backends behind one
get_store()factory: swap keyword ↔ vector search without touching the server or ingester.Word-aligned overlapping chunks so passages stay readable and answers aren't split across a boundary.
Tests
python tests/test_chunker.py
python tests/test_store.py
# or: pytest -qTests use synthetic, generated text only — no datasets are bundled.
License
MIT © 2026 Wei-Ting Yen
This server cannot be deployed
Maintenance
Related MCP Connectors
Agentic search over your Dewey document collections from any MCP-compatible client.
DocBase MCP server for AI agents
MCP server for querying Forkast documentation
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables any MCP-compatible AI assistant to search, filter, and retrieve information from a local document collection using a hybrid search pipeline with vector, BM25, reranking, and LLM enrichment.4-
- AlicenseAqualityDmaintenanceLocal-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.36 npmMIT
- FlicenseNot gradedqualityDmaintenanceA RAG service based on FastMCP that enables document indexing and retrieval (keyword/vector search) through the MCP protocol.-
- FlicenseAqualityDmaintenanceMCP server that enables semantic search over local PDF collections using local RAG, with automatic indexing of new documents.5-