retrieval-only-RAG

retrieval-only-RAG

An MCP server that retrieves relevant PDF chunks via local embeddings and returns them to IDE agents (Cursor, Kiro, Claude Code) for answer generation.

Category
Visit Server

README

retrieval-only-RAG

A PDF retrieval tool wrapped as an MCP server. It handles the R in RAG — your IDE agent (Cursor, Kiro, Claude Code) handles generation.

PDFs ──> [ load → chunk → embed → store → retrieve ]
                          │
                 returns matching chunks
                          │
              [ MCP server wraps the retriever ]
                          │
     IDE agent calls it ──┘  →  IDE agent writes the answer

No LLM inside this tool. Embeddings run locally (no cloud key needed).


Setup

python -m venv .venv
.venv\Scripts\activate        # Windows
pip install -r requirements.txt

Usage

Index your PDFs — drop PDF files into pdfs/ then run:

python -m pdf_rag.cli index

Only new or changed PDFs are processed on subsequent runs — unchanged files are skipped. Deleted PDFs have their chunks removed automatically.

Search — retrieve the top-k chunks for a question:

python -m pdf_rag.cli search "What is the difference between ArrayList and LinkedList?"

Output includes source filename, page number, and similarity score for each chunk.


MCP Server

Exposes one tool — search_pdfs(query) — that any MCP-compatible IDE agent can call.

python mcp_server.py

Claude Code (.mcp.json in project root)

A .mcp.json is already included in this repo:

{
  "mcpServers": {
    "pdf-rag": {
      "command": "C:\\Projects\\Retrieval\\.venv\\Scripts\\python.exe",
      "args": ["C:\\Projects\\Retrieval\\mcp_server.py"],
      "cwd": "C:\\Projects\\Retrieval"
    }
  }
}

Update the paths to match your machine, then Claude Code picks it up automatically.

Cursor (.cursor/mcp.json)

{
  "mcpServers": {
    "pdf-rag": {
      "command": "path/to/.venv/Scripts/python.exe",
      "args": ["path/to/mcp_server.py"],
      "cwd": "path/to/project"
    }
  }
}

Once connected, ask your IDE agent a question about your PDFs — it calls search_pdfs, gets the chunks, and writes the answer. You own retrieval; the agent owns generation.


Configuration (config.yaml)

pdf_folder: pdfs              # folder to scan for PDFs
vector_store: vector_store    # where ChromaDB persists the index
embedding_model: BAAI/bge-small-en-v1.5   # local HuggingFace model
top_k: 5                      # chunks returned per query

Project structure

pdf_rag/
  config.py      # load + validate config.yaml
  indexer.py     # PDF loading, chunking, embedding, ChromaDB persistence
  retriever.py   # similarity search + result formatting
  cli.py         # index / search commands
mcp_server.py    # MCP wrapper exposing search_pdfs()
config.yaml
requirements.txt
.mcp.json        # Claude Code MCP config (update paths for your machine)
pdfs/            # drop your PDFs here (not committed)
vector_store/    # ChromaDB index + manifest.json (not committed)

How the RAG split works

Layer Who does it How
Retrieval This tool LlamaIndex + ChromaDB + local embeddings
Augmentation MCP protocol Retrieved chunks injected into agent context
Generation IDE agent Cursor / Kiro / Claude Code answers from chunks

The MCP server is editor-agnostic — swap Cursor for Kiro (or any MCP client) by changing only the connection config, no code changes needed.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured