A powerful document knowledge base system that leverages PDF processing, vector storage, and MCP (Model Context Protocol) to provide semantic search capabilities for PDF documents. This system allows you to upload, process, and query PDF documents through a modern web interface or via the MCP protocol for integration with AI tools like Cursor.
Features
PDF RAG server for cursor.
PDF Document Upload & Processing: Upload PDFs and automatically extract, chunk, and vectorize content
Real-time Processing Status: WebSocket-based real-time status updates during document processing
Semantic Search: Vector-based semantic search across all processed documents
MCP Protocol Support: Integrate with AI tools like Cursor using the Model Context Protocol
Modern Web Interface: React/Chakra UI frontend for document management and querying
Fast Dependency Management: Uses uv for efficient Python dependency management
System Architecture
The system consists of:
FastAPI Backend: Handles API requests, PDF processing, and vector storage
React Frontend: Provides a user-friendly interface for managing documents
Vector Database: Stores embeddings for semantic search
WebSocket Server: Provides real-time updates on document processing
MCP Server: Exposes knowledge base to MCP-compatible clients
Go Settings -> Cursor Settings -> MCP -> Add new global MCP server, paste below into your Cursor ~/.cursor/mcp.json file. See Cursor MCP docs for more info.
You could also change localhost into the host ip you deployed the service. After this confige added to the mcp json, you will see the mcp server showes at the Cursor mcp config page, switch it on to enable the server:
Building the Frontend (For Developers)
If you need to rebuild the frontend, you have two options:
Option 1: Using the provided script (recommended)
# Make the script executable if needed
chmod +x build_frontend.py
# Run the script
./build_frontend.py
This script will automatically:
Install frontend dependencies
Build the frontend
Copy the build output to the backend's static directory
Option 2: Manual build process
# Navigate to frontend directory
cd frontend
# Install dependencies
npm install
# Build the frontend
npm run build
# Create static directory if it doesn't exist
mkdir -p ../backend/static
# Copy build files
cp -r dist/* ../backend/static/
After building the frontend, you can start the application using the run.py script.
Simple Production Setup
For a production environment where the static files have already been built:
Place your pre-built frontend in the backend/static directory
Start the server:
cd backend
uv pip install -r requirements.txt
python -m app.main
Development Setup (Separate Services)
If you want to run the services separately for development: