MCP RAG Server
MCP RAG
MCP server that owns the full RAG pipeline, plus a small web client for uploading PDFs and asking questions.
Layout
src/mcp_rag/
server/ MCP tools: ingest, index, search, ask
client/ FastAPI UI: upload files, ask questions
data/docs/ PDF corpus (owned by the MCP server)
data/faiss_index/ cached embeddingsPDFs uploaded in the client
│
▼
MCP server (:8001/mcp)
ingest → chunk → embed → FAISS
retrieve → generate (OpenAI / LangGraph)
│ Streamable HTTP
▼
Web client (:8000)
upload / delete / askRequirements
Python 3.10+ (3.12 recommended)
An OpenAI API key
Setup
uv sync
copy .env.example .env # or: cp .env.example .envPut your OpenAI key in .env. Optional sample PDFs:
uv run python scripts/make_sample_pdfs.pyRun
Terminal 1 — MCP server (RAG):
uv run python -m mcp_rag.serverTerminal 2 — web client:
uv run python -m mcp_rag.clientOpen http://127.0.0.1:8000. Upload PDFs, then ask questions.
On Windows you can also use scripts\run_server.bat and scripts\run_client.bat.
MCP tools
Tool | Purpose |
| Add a PDF (base64) and rebuild the index |
| Remove a PDF and rebuild the index |
| Build or reuse the FAISS index |
| Semantic search over chunks |
| Retrieve + generate a grounded answer |
| List PDFs in the corpus |
| Index readiness and chunk count |
Client API
Method | Path | Purpose |
|
| Client + MCP status |
|
| List PDFs |
|
| Multipart PDF upload |
|
| Remove a PDF |
|
| Rebuild FAISS index |
|
|
|
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/Sujith29k/MCP-RAG'
If you have feedback or need assistance with the MCP directory API, please join our Discord server