Multi-Document RAG MCP server

Enables document processing with OCR, vector embeddings, and semantic search capabilities for efficient retrieval-augmented generation across multiple file formats including PDF, DOCX, PPTX, Excel, CSV, and images.
Back to servers
Provider
Anurag Bombarde
Release date
May 26, 2025
Language
Go
Stats
3 stars

MCP-RAG is a powerful system built with Model Context Protocol (MCP) for handling large files up to 200MB. It provides intelligent chunking strategies, multi-format document support, and enterprise-grade reliability, making it ideal for advanced retrieval-augmented generation tasks across various document types.

Features

Multi-Format Document Support

  • PDF: Intelligent page-by-page processing with table detection
  • DOCX: Paragraph and table extraction with formatting preservation
  • Excel: Sheet-aware processing with column context (.xlsx/.xls)
  • CSV: Smart row batching with header preservation
  • PPTX: Support for PowerPoint presentations
  • IMAGE: Support for jpeg, png, webp, gif and other formats with OCR

Large File Processing

  • Adaptive chunking based on file size
  • Memory-efficient streaming for 50MB+ files
  • Real-time progress tracking
  • Graceful timeout handling

Advanced RAG Capabilities

  • Semantic search with confidence scores
  • Cross-document queries
  • Source attribution with citations
  • Hybrid retrieval combining semantic and keyword search

Prerequisites

Before installing MCP-RAG, ensure you have:

  • Python 3.11 or higher
  • OpenAI API key or compatible LLM endpoint
  • 8GB+ RAM (for large file processing)

Installation

Clone the repository and set up your environment:

git clone https://github.com/yourusername/rag-large-file-processor.git
cd rag-large-file-processor

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

pip install -r requirements.txt

Create a .env file with your configuration:

cat > .env << EOF
OPENAI_API_KEY=your_openai_api_key_here
BASE_URL=https://api.openai.com/v1
MODEL_NAME=gpt-4o
VECTOR_DB_TYPE=chromadb
EOF

Running the Application

Launch the Streamlit interface:

streamlit run streamlit_app.py

Using MCP-RAG

Uploading Documents

  1. Navigate to the Streamlit interface
  2. Upload your document (PDF, DOCX, XLSX, CSV, PPTX, or images)
  3. The system will automatically process and index the document

Querying Documents

  1. Enter your question in the search box
  2. The system will search across your indexed documents
  3. Results will include relevant text passages with source attribution

Advanced Configuration

  • Switch between vector database options (ChromaDB for local use, Milvus for production)
  • Customize chunking strategies for different document types
  • Adjust similarity thresholds for search results

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later