Featured

Deploy OpenClaw in 60 seconds — 20% off logoDeploy OpenClaw in 60 seconds — 20% off

Launch OpenClaw on Hostinger in about 60 seconds and keep your agent live 24/7. Our referral link gives you 20% off, no coupon code needed.

Launch on Hostinger
Run your Hermes agent on Hostinger, fully managed logoRun your Hermes agent on Hostinger, fully managed

Launch Hermes on Hostinger in one click, fully managed, no VPS knowledge needed. Use code ZACAARON10 for 10% off.

Launch on Hostinger
Crawl and scrape any site into clean data, 10% off logoCrawl and scrape any site into clean data, 10% off

Firecrawl crawls and scrapes any site into clean markdown for your agent. Get 1,000 free credits, and new users get 10% off their first purchase.

Try Firecrawl free
6,000+ web scrapers for your AI agent, start free logo6,000+ web scrapers for your AI agent, start free

Apify gives your agent live web data: 6,000+ prebuilt scrapers and actors, MCP-ready. Sign up free with $5 in usage credits.

Try Apify free
One API to scrape, enrich, and extract the internet. logoOne API to scrape, enrich, and extract the internet.

Context.dev gives your agents a single API to scrape, enrich, and extract live web data — no proxies, no parsers, no maintenance.

Start building free
SetupClaw: done-for-you OpenClaw for founders & exec teams logoSetupClaw: done-for-you OpenClaw for founders & exec teams

White-glove OpenClaw for founders and exec teams (4–50+ employees): we install, harden, integrate your tools, and maintain it — secured from day one.

Get it set up for you
SEO data APIs for your agent, $1 free credit logoSEO data APIs for your agent, $1 free credit

DataForSEO gives your agent live access to SERP results, keyword data, backlinks, and on-page SEO data through one API. New accounts get a $1 credit, good for up to 20,000 keyword or backlink lookups.

Try DataForSEO free
Reach 48,000+ AI builders

A flat monthly placement in front of developers actively installing AI tools. No lock-in, cancel anytime.

Advertise here

Works with

Claude CodeClaude DesktopCursorVS CodeClineCodex CLIOpenClaw+ any MCP client

Install to Claude Code

This server doesn't publish a one-line install command. Follow the setup in the source repository.

Summary

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

README.md

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.

See related servers & alternatives →

Related MCP servers

Browse all →

Related guides

Hand-picked reading to help you choose and use Vector & Memory servers.