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": "cmd",
"args": [
"/c",
"uvx",
"rag-mcp"
],
"env": {
"PERSIST_DIRECTORY": "/path/to/your/persist/directory"
}
}
}
}
Usage
Supported Embedding Models
The system supports two types of embedding models:
- HuggingFace BGE Embeddings (default): High-quality embeddings that work offline
- Uses BAAI/bge-m3 model
How It Works
- Document Loading: Uses DoclingLoader to parse various document formats
- Text Splitting: Documents are split into manageable chunks using RecursiveCharacterTextSplitter
- Embedding Generation: Text chunks are converted to vector embeddings
- Storage: Embeddings are stored in a Chroma vector database
- Retrieval: When queried, the system finds semantically similar content to answer questions
Advanced Configuration
You can customize chunk size, overlap, and other parameters by modifying the code in document_server.py.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
[Specify your license here]
Acknowledgments
- This project uses LangChain and Docling for intelligent document parsing
- Vector storage provided by Chroma
- Embedding models from HuggingFace
- Built on the Model Context Protocol (MCP)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rag_mcp-0.1.1.tar.gz.
File metadata
- Download URL: rag_mcp-0.1.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
431f6fe5ec79f6b242119c4cb1a69c979abe65a0ea5ab9395486c45104bdd5b3
|
|
| MD5 |
e68536505324a1a90feec786722cc57c
|
|
| BLAKE2b-256 |
76f6a5299e00aa15afdc62f687b521a1c606eaa00ac94bab0adff3bf5ced6673
|
File details
Details for the file rag_mcp-0.1.1-py3-none-any.whl.
File metadata
- Download URL: rag_mcp-0.1.1-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58150c43cfb81f04764883573d4d68cadbedeffcc7ff804de2a25d941265d6a
|
|
| MD5 |
eeda74adbbfab3fe5164c1925657ebcb
|
|
| BLAKE2b-256 |
f65992ed32f938bf12bf3fd3eb23501b0719093170735a00aade8fdf3ae9d67a
|