- Home
- MCP servers
- Personal RAG
Personal RAG
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"timerickson-personal-rag-mcp": {
"command": "python",
"args": [
"-m",
"personal_rag_mcp.server"
],
"env": {
"PORT": "8765 (HTTP) or default if not using HTTP",
"TRANSPORT": "http or stdio (depending on mode)",
"OLLAMA_URL": "http://ollama:11434",
"QDRANT_URL": "http://qdrant:6333",
"LITELLM_URL": "http://litellm-proxy:8000",
"SQLITE_PATH": "/app/data/documents.db",
"LITELLM_API_KEY": "sk-..."
}
}
}
}You can run a Personal RAG MCP Server that stores your notes and documents locally, builds semantic search indexes, and serves questions with retrieval-augmented generation across multiple clients. It supports both stdio and HTTP streaming transports, works with SQLite for documents and Qdrant for vectors, and connects to Ollama and LiteLLM-backed LLMs for embeddings and generation.
How to use
You interact with the MCP server through an MCP client. Use the store tools to add notes and documents, search them with semantic queries, and ask questions that are answered with retrieved context plus generated text. The server exposes two transport modes: stdio for local desktop integrations and HTTP streaming for web-based interfaces. When you issue questions, the server fetches relevant context chunks and then generates an answer along with sources.
Key workflows you will perform regularly: 1) add content to your personal knowledge base, 2) run semantic searches to retrieve relevant notes, and 3) ask questions that return a composed answer with supporting contexts.
How to install
Prerequisites you need before installation: ensure you have Python installed and a modern shell. You will also need Docker if you choose the container route and basic familiarity with environment variables.
# Create a Python virtual environment
python -m venv venv
source venv/bin/activate # on Windows use `venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txt
# Optional: verify Python version
python --version
# Optional: verify pip version
pip --version
# Prepare environment (examples shown; adapt to your setup)
export SQLITE_PATH=./data/documents.db
export QDRANT_URL=http://localhost:6333
export OLLAMA_URL=http://localhost:11434
export LITELLM_URL=http://localhost:4000
# Start the MCP server in stdio mode
python -m personal_rag_mcp.server
# Or start in HTTP mode
export TRANSPORT=http
export PORT=8765
python -m personal_rag_mcp.server
"} ,{
Additional configuration and deployment notes
The server uses a hybrid storage setup with SQLite for full-text documents and Qdrant for semantic search. It is designed to run in containers or on a local machine, and it can connect to Ollama for embeddings and LiteLLM as the LLM proxy. You can customize the configuration through environment variables or compose files to suit your infrastructure.
services:
# Required: Qdrant vector database
qdrant:
image: qdrant/qdrant:latest
container_name: qdrant
ports:
- "6333:6333"
volumes:
- qdrant-data:/qdrant/storage
restart: unless-stopped
# Required: Ollama for embeddings
ollama:
image: ollama/ollama:latest
container_name: ollama
ports:
- "11434:11434"
volumes:
- ollama-data:/root/.ollama
restart: unless-stopped
# LiteLLM proxy for LLM access
litellm-proxy:
image: ghcr.io/berriai/litellm:main-latest
container_name: litellm-proxy
ports:
- "4080:8000"
volumes:
- ./litellm_config.yaml:/app/config.yaml
environment:
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
- AWS_REGION=${AWS_REGION}
- OLLAMA_API_BASE=http://ollama:11434
entrypoint: ["litellm", "--config", "/app/config.yaml", "--port", "8000"]
depends_on:
- ollama
restart: unless-stopped
# Personal RAG MCP Server
personal-rag-mcp:
build: ./personal-rag-mcp
container_name: personal-rag-mcp
ports:
- "8765:8765"
environment:
- TRANSPORT=http
- PORT=8765
- QDRANT_URL=http://qdrant:6333
- OLLAMA_URL=http://ollama:11434
- LITELLM_URL=http://litellm-proxy:8000
- LITELLM_API_KEY=${LITELLM_API_KEY}
- SQLITE_PATH=/app/data/documents.db
volumes:
- personal-rag-data:/app/data
- ./config/personal-rag:/app/config:ro
depends_on:
- qdrant
- ollama
- litellm-proxy
restart: unless-stopped
volumes:
qdrant-data:
ollama-data:
personal-rag-data:
"} ,{
## Troubleshooting and tips
If you encounter connectivity issues, verify that Qdrant, Ollama, and LiteLLM services are reachable at their configured URLs. Confirm the MCP server is running and listening on the expected port by attempting to connect from your MCP client. Check logs for any missing environment variables or startup errors.
## Available tools
### store\_memory
Store notes, documents, or snippets in the knowledge base with namespace and metadata.
### search\_memory
Perform semantic search across stored content with optional content\_type filtering.
### ask\_with\_context
Ask questions with retrieved context to generate informed answers.