mcp-rag-server-container

satoshi58/mcp-rag-server-container

3.1

If you are the rightful owner of mcp-rag-server-container and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The MCP RAG Server is a Dockerized Python server that indexes a markdown file and provides RAG search tools without external LLM dependencies.

Tools
2
Resources
0
Prompts
0

MCP RAG Server (Dockerized)

This repository builds a Python MCP server that indexes an input.md file at image build time and exposes simple RAG search tools.

Features

  • Build-time indexing of input.md into a TF–IDF model.
  • MCP FastMCP server exposing tools:
    • search(query: str, top_k: int = 5)
    • answer(question: str, top_k: int = 5)
  • No external LLM dependency; returns context-based answers (extractive stub).

Build

Replace input.md with your content, or point to a different file at build time using a build-arg, then build:

docker build -t mcp-rag:latest .
# or specify a different file in the build context
docker build -t mcp-rag:latest --build-arg INPUT_FILE=docs/my_input.md .

Run

By default, the container starts the FastMCP server over stdio (for MCP clients). To test with the MCP Inspector on the host, use:

# Example: run container and attach STDIN/STDOUT for stdio transport
docker run -it --rm mcp-rag:latest

Or run a Streamable HTTP server by overriding the command (container exposes port 8000):

docker run -it --rm -p 8000:8000 --entrypoint python mcp-rag:latest -c \
  "from app.server import mcp; mcp.run(transport='streamable-http')"

Then connect a client to http://localhost:8000/mcp if you expose a port via a custom CMD/ENTRYPOINT.

Development

Install deps locally and run server via stdio:

python -m venv .venv && . .venv/bin/activate
pip install -r requirements.txt
python -m app.server

Use the MCP dev tools:

# Inspector (optional)
uv run mcp dev app/server.py

Environment

  • MODEL_DIR (default /app/model) – where the index artifacts are stored.

Notes

  • This RAG is a minimal TF–IDF baseline for fast builds. Swap in a vector DB/embeddings if needed.
  • For larger corpora, consider building the index outside Docker and COPY the artifacts.