RAG3 MCP Server
Connects RAG3 collections to OpenAI's ChatGPT web and local Codex via MCP, enabling ChatGPT to search indexed local documents, read matching chunks, and access page images through a Secure MCP Tunnel and custom MCP plugin.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@RAG3 MCP ServerSearch my demo collection for notes on transformer architectures"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RAG3 — local document search for desktop and ChatGPT
RAG3 is a Windows document indexing and retrieval system with a desktop UI, a shared HTTP backend, and MCP tools. It parses local files with Docling, indexes them in Qdrant, and searches with BGE-M3 semantic vectors, native BM25, or hybrid rank fusion.
This repository contains the indexing and retrieval service. Model weights, personal documents, the Qdrant volume, and tunnel credentials are not part of the source tree.
ChatGPT on the web can search your RAG3 collections. Run RAG3 on your Windows PC, connect its local MCP endpoint through OpenAI Secure MCP Tunnel, and install the resulting custom MCP plugin in ChatGPT. This path was exercised on the development PC. Each installation needs its own tunnel and ChatGPT workspace access; cloning this repository alone does not connect ChatGPT. See MCP setup.
Original-file handoff has a measured boundary. Experiments uploaded a PDF from RAG3 to ChatGPT host storage and downloaded matching bytes, but did not register it as an attachment in the current conversation or establish native PDF reading by the AI. A later Library UI search did not find the uploaded file; the experiment cannot distinguish failed Library registration from an item hidden in that UI. Use RAG3 search, chunk reads, and page images when asking ChatGPT about indexed documents. The experiment record separates the observed results from untested paths.
Engineering highlights
One backend for three clients. The PySide6 UI, local Codex plugin, and ChatGPT web plugin use the same collections, ingestion jobs, and retrieval path. Closing the UI leaves the backend running.
GPU ownership on a 4 GiB card. Long PDFs use a short-lived CUDA parser. RAG3 releases BGE-M3 before parsing and reloads it for embedding or semantic search, while BM25-only search stays available without the dense model.
Recoverable ingestion. A SQLite job journal records progress and state; the UI can pause, resume, retry, and cancel jobs. Managed source copies carry SHA-256 checks for source retrieval.
Inspectable retrieval. BGE-M3 dense vectors and Qdrant's native BM25 sparse vectors support semantic, lexical, and reciprocal-rank-fusion search. Results retain source metadata and PDF page information when available.
Format-aware parsing. Docling handles PDF OCR and tables plus structured formats; plain text has a direct path. Legacy
.docconversion uses Microsoft Word when installed.
PySide6 desktop UI -------------------+
Codex local MCP plugin ---------------+--> Shared RAG3 backend
ChatGPT web --> Secure MCP Tunnel ----+ |-- SQLite job journal
|-- Docling parser and BGE-M3
|-- Qdrant dense and BM25 index
+-- managed source filesThe architecture notes explain the data flow, GPU handoff, and retrieval behavior.
Related MCP server: local-Rag
Requirements at a glance
For | Required components |
Desktop UI and backend | Windows x64, Python 3.11, NVIDIA GPU and compatible driver, WSL2 Ubuntu, Docker Engine and Compose in Ubuntu, Qdrant, local BGE-M3 and Docling models |
Optional launcher | .NET 8 runtime; .NET 8 SDK only to build |
Local Codex MCP plugin | Running backend and Codex with local plugin support |
ChatGPT web MCP plugin | Running backend, Secure MCP Tunnel client and permissions, ChatGPT custom MCP plugin access |
Microsoft Word is needed only for legacy .doc conversion. The Windows installation guide lists the setup and checks for every component.
Quick start
Follow the Windows installation guide to set up WSL2, Docker, Qdrant, Python packages, and local model files. The launcher is optional.
Once the environment and Qdrant are ready, start the shared backend in one PowerShell window:
.\.venv\Scripts\python.exe scripts\rag3-mcp-server.pyIn another window, open the UI:
.\.venv\Scripts\python.exe scripts\ingest-ui.pyCreate a collection, add a PDF, run its job, then search the collection. The backend also serves http://127.0.0.1:8000/mcp for local MCP clients. See Using RAG3 for the UI and MCP paths.
Try it with a document
After installation, use the desktop UI to create a collection named demo, add a PDF you are allowed to process, and click Run. When the job reaches COMPLETE, search for a term from that PDF. For an MCP client, ask it to search the demo collection and read the matching chunks before answering. The worked examples give copyable prompts for the desktop UI, local Codex, and ChatGPT on the web, plus the underlying tool calls.
Verification and limits
The verification notes include a repeatable disposable PDF-to-search check and one measured 535-page local run. On a Quadro T1000 with 4 GiB VRAM, that run indexed 252 chunks in 30.7 minutes and found the source through dense, BM25, and hybrid search. Device-wide GPU usage reached 3,873 MiB. These numbers describe one document and PC, not a general performance guarantee.
The code and workflow have been exercised on the development PC. A clean installation on a second PC has not yet been completed. The bundled infrastructure script currently expects the checkout at C:\python_program\RAG3; other locations require editing that script.
License and published content
The source code and documentation are available under the MIT License. The repository does not include your indexed documents, model weights, local .env, Qdrant data, or tunnel credentials. ChatGPT and other MCP clients receive document content only when you invoke the corresponding tools; review access and write permissions before connecting a client.
This server cannot be deployed
Maintenance
Related MCP Connectors
- docs2mcpOAuthcom.docs2mcp
Query your own PDFs and documents from any MCP client. Every answer cites the page it came from.
Cloud or self-hosted knowledge for AI agents: hybrid search, reranking, GraphRAG, scoped MCP tools.
Ingest, manage, and retrieve documents for RAG-powered AI applications
The Needle MCP server enables semantic search on documents stored in files like PDFs, DOCX, and XLSX by connecting AI applications to external data sources. It provides capabilities to create and manage document collections, perform natural language searches on stored content, and retrieve relevant information without requiring exact keyword matches.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables 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-
- AlicenseAqualityDmaintenanceA local-first document retrieval MCP server that enables AI coding tools like Codex to search private local documents via semantic search and keyword boost, supporting ingestion of PDF, DOCX, TXT, Markdown, and HTML files.7MIT
- FlicenseNot gradedqualityDmaintenanceEnables local document question-answering and retrieval via MCP, supporting multi-turn conversation, intent recognition, and tools for document search, Q&A, and summarization.5-
- AlicenseNot gradedqualityBmaintenanceEnables AI tools to securely search and retrieve relevant, source-attributed chunks from private local documents via MCP, without sending document content to third-party services.2MIT