Skip to main content

This is a local rag-mcp solution with chromadb using langchain and docling

Project description

RAG MCP: Document Processing Server

A Retrieval-Augmented Generation (RAG) server built on the Model Context Protocol (MCP) for intelligent document processing and question answering.

Overview

RAG MCP is a tool that allows you to index various document formats and perform semantic searches against them. It uses advanced embedding techniques and vector databases to make your documents searchable through natural language queries.

Features

  • Document Indexing: Support for various document formats (PDF, DOCX, XLSX, PPTX, Markdown, AsciiDoc, HTML, XHTML, CSV)
  • Semantic Search: Query your documents using natural language
  • High Performance: Optimized for various hardware configurations with automatic device selection (CUDA, MPS, CPU)
  • Persistent Storage: Vector embeddings are stored locally for future use

Requirements

  • Python 3.11+
  • Environment with access to your documents

Installation

1. Install UV

First, you need to install UV, a Python package installer and resolver:

On macOS/Linux:

curl -sSf https://astral.sh/uv/install.sh | sh

On Windows:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Run RAG MCP

Once UV is installed, you can run RAG MCP directly using:

uvx rag-mcp

This will start the MCP server and make it available for document processing.

IDE Integration

VS Code Integration

To integrate with Visual Studio Code, create a mcp.json file with the following content:

{
    "servers": {
        "rag-mcp-server": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "rag-mcp"
            ],
            "env": {
                "PERSIST_DIRECTORY": "/path/to/your/persist/directory"
            }
        }
    }
}

Replace /path/to/your/persist/directory with the directory where you want to store your vector database.

Cursor Integration

To integrate with Cursor, go to Cursor Settings > MCP and paste this configuration:

{
    "mcpServers": {
      "rag-mcp": {
        "command": "uvx",
        "args": ["rag-mcp"],
        "env": {
          "PERSIST_DIRECTORY": "/path/to/your/persist/directory"
        }
      }
    }
  }

Usage

Supported Embedding Models

The system supports the following embedding model.

  1. HuggingFace BGE Embeddings (default): High-quality embeddings that work offline
    • Uses BAAI/bge-m3 model

How It Works

  1. Document Loading: Uses DoclingLoader to parse various document formats
  2. Text Splitting: Documents are split into manageable chunks using RecursiveCharacterTextSplitter
  3. Embedding Generation: Text chunks are converted to vector embeddings
  4. Storage: Embeddings are stored in a Chroma vector database
  5. Retrieval: When queried, the system finds semantically similar content to answer questions

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rag_mcp-0.1.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rag_mcp-0.1.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file rag_mcp-0.1.3.tar.gz.

File metadata

  • Download URL: rag_mcp-0.1.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for rag_mcp-0.1.3.tar.gz
Algorithm Hash digest
SHA256 02fd10417e3ed93e42c22c41f7226fd1024cbd53bb931d1434f82abf19aeb7f9
MD5 ba780623e38fb3191c5aadb0e9d43bdb
BLAKE2b-256 32df40bc0c16ea48f9f8704adf7db353ebac1c88e018bdde6245d2107c6c87aa

See more details on using hashes here.

File details

Details for the file rag_mcp-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: rag_mcp-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for rag_mcp-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e15e10ed9cc5de638eafce771a179e3b3b99612911d9103347ab31b0967e592a
MD5 dbb40c774f9b7777eb73b16a632b693e
BLAKE2b-256 62d845f31cb0e9a73979500b22ab66211eb3b0ddf0e3407cbef8df828345fa49

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page