Skip to main content
Glama

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 files

Related 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.py

Semantic mode instead of keyword:

pip install chromadb
RAG_BACKEND=chroma python ingest.py --rebuild
RAG_BACKEND=chroma python server.py

Register 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 -q

Tests use synthetic, generated text only — no datasets are bundled.

License

MIT © 2026 Wei-Ting Yen

A
license - permissive license
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • F
    license
    -
    quality
    B
    maintenance
    Enables 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
  • A
    license
    A
    quality
    D
    maintenance
    Local-first RAG indexing and semantic search MCP server. Enables document retrieval and context-aware queries using local embedding models.
    3
    9
    MIT
  • F
    license
    -
    quality
    D
    maintenance
    A RAG service based on FastMCP that enables document indexing and retrieval (keyword/vector search) through the MCP protocol.

View all related MCP servers

Related MCP Connectors

  • Agentic search over your Dewey document collections from any MCP-compatible client.

  • Remote ChromaDB vector database MCP server with streamable HTTP transport

  • Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.

View all MCP Connectors

Latest Blog Posts

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/weitingyen168/rag-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server