sathyaNarayanC/mcp-rag-server
If you are the rightful owner of mcp-rag-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The MCP RAG Server for Claude Desktop is a Retrieval-Augmented Generation server that integrates with Claude Desktop using the Model Context Protocol, enhancing document processing capabilities.
š MCP RAG Server for Claude Desktop
A Retrieval-Augmented Generation (RAG) server that seamlessly integrates with Claude Desktop through the Model Context Protocol (MCP). This project enhances Claude's capabilities by providing access to your local document knowledge base through an advanced RAG pipeline.
⨠Features
š Document Processing
- Multi-format support (CSV, PDF, TXT)
- Smart document chunking with context preservation
- Efficient vector embeddings with Chroma DB
- Automated document indexing and updates
š ļø Quick Start
Prerequisites
- Python 3.9+
- uv package manager
- 16GB+ RAM recommended
- Optional: CUDA-compatible GPU
Installation
-
Clone the repository
git clone https://github.com/yourusername/mcp-rag-server.git cd mcp-rag-server
-
Create and activate virtual environment
uv venv source .venv/bin/activate # Unix/macOS # or .venv\Scripts\activate # Windows
-
Install dependencies
uv pip install -e . # Install from pyproject.toml # or uv pip sync # Install from lock file
Configuration
-
Prepare your documents
mkdir -p data/{csv,pdf,text} # Add your documents to respective folders
-
Start the server
python mcp_rag_server.py
-
Configure Claude Desktop
- Open Claude Desktop Settings
- Navigate to Integrations
- Add new MCP Server:
Name: Local RAG Server URL: http://localhost:8000
š Features & Performance
High-Performance Processing
- Fast document indexing (~100 pages/minute)
- Efficient vector storage with Chroma
- GPU acceleration support
- Optimized memory usage (~100MB per 1000 pages)
Enhanced Security
- 100% local processing
- No external API dependencies
- Secure document handling
- Configurable access controls
š» Development
Setup Development Environment
# Install dev dependencies
uv pip install pytest black flake8 isort mypy
# Update lock file
uv pip compile pyproject.toml -o uv.lock
# Sync project dependencies
uv pip sync
Code Quality
# Format code
black .
# Run linters
flake8 .
mypy .
# Run tests
pytest tests/
āļø Advanced Configuration
Document Processing
# config.py
DOCUMENT_CONFIG = {
"chunk_size": 1000,
"chunk_overlap": 200,
"embeddings_model": "sentence-transformers/all-mpnet-base-v2"
}
Retrieval Settings
RETRIEVER_CONFIG = {
"search_type": "similarity", # or "mmr" for diversity
"top_k": 3,
"score_threshold": 0.7
}
Custom Model Integration
from langchain_huggingface import HuggingFaceEmbeddings
custom_embeddings = HuggingFaceEmbeddings(
model_name="your-custom-model",
model_kwargs={"device": "cuda" if torch.cuda.is_available() else "cpu"}
)
7. Maintenance and Monitoring
Vector store management
Dependency updates
Performance monitoring
System health checks
8. Project Structure
.
āāā mcp_rag_server.py # MCP server
āāā main.py # Core implementation
āāā pyproject.toml # Dependencies
āāā uv.lock # Lock file
āāā data/ # Documents
āāā chroma_db/ # Vector store