RAG Server
Enables retrieval-augmented generation (RAG) by indexing and searching through documents (Markdown, text, PowerPoint, PDF) using vector embeddings with multilingual-e5-large model and PostgreSQL pgvector. Supports contextual chunk retrieval and incre
What is RAG Server?
RAG Server is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to enables retrieval-augmented generation (rag) by indexing and searching through documents (markdown, text, powerpoint, pdf) using vector embeddings with multilingual-e5-large model and postgresql pgvec...
Enables retrieval-augmented generation (RAG) by indexing and searching through documents (Markdown, text, PowerPoint, PDF) using vector embeddings with multilingual-e5-large model and PostgreSQL pgvector. Supports contextual chunk retrieval and incre
This server falls under the Knowledge & Memory and Search & Data Extraction categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Enables retrieval-augmented generation (RAG) by indexing and
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-rag-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use RAG Server
MCP RAG Server enables retrieval-augmented generation by indexing Markdown, plain text, PowerPoint, and PDF documents into a PostgreSQL pgvector database using the multilingual-e5-large embedding model. AI assistants can then semantically search indexed content and retrieve the most relevant document chunks to ground their responses. This is ideal for building private knowledge bases from large document collections and querying them through natural language without exposing raw files to the model.
Prerequisites
- Python 3.10 or higher with uv package manager installed
- PostgreSQL 14+ with the pgvector extension enabled (Docker image pgvector/pgvector:pg17 works out of the box)
- Sufficient disk space for embedding storage — the multilingual-e5-large model produces 1024-dimensional vectors
- An MCP-compatible client such as Claude Desktop
Clone the repository and install dependencies
Clone the mcp-rag-server repository and use uv to install all Python dependencies into an isolated environment.
git clone https://github.com/karaage0703/mcp-rag-server.git
cd mcp-rag-server
uv syncStart PostgreSQL with pgvector via Docker
Launch a PostgreSQL container that includes the pgvector extension, then create the target database.
docker run --name postgres-pgvector -e POSTGRES_PASSWORD=password \
-p 5432:5432 -d pgvector/pgvector:pg17
docker exec -it postgres-pgvector psql -U postgres \
-c "CREATE DATABASE ragdb;"Configure environment variables
Create a .env file in the project root with your PostgreSQL credentials and document directory paths. The SOURCE_DIR should point to the folder containing your documents to index.
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=ragdb
SOURCE_DIR=./data/source
PROCESSED_DIR=./data/processed
EMBEDDING_MODEL=intfloat/multilingual-e5-large
EMBEDDING_DIM=1024
EMBEDDING_PREFIX_QUERY="query: "
EMBEDDING_PREFIX_EMBEDDING="passage: "Index your documents
Place your Markdown, text, PDF, or PowerPoint files into the SOURCE_DIR folder, then run the indexer to embed and store them in PostgreSQL.
python -m src.cli indexStart the MCP server
Run the server so that your MCP client can connect and begin querying your document knowledge base.
uv run python -m src.mainConfigure your MCP client
Add the server to your Claude Desktop configuration file. Since this is a Python server started via uv, point the command at the project directory.
{
"mcpServers": {
"rag-server": {
"command": "uv",
"args": ["run", "python", "-m", "src.main"],
"cwd": "/path/to/mcp-rag-server"
}
}
}RAG Server Examples
Client configuration
Claude Desktop configuration for the MCP RAG Server, pointing uv at the cloned project directory.
{
"mcpServers": {
"rag-server": {
"command": "uv",
"args": ["run", "python", "-m", "src.main"],
"cwd": "/Users/you/projects/mcp-rag-server"
}
}
}Prompts to try
After indexing your documents, try these prompts with Claude to test retrieval and RAG capabilities.
- "Search my knowledge base for information about quarterly revenue projections"
- "How many documents have been indexed in the RAG server?"
- "Find the most relevant sections about authentication in my documentation"
- "What does my architecture document say about the database layer?"Troubleshooting RAG Server
pgvector extension not found when the server starts
Connect to your PostgreSQL database and run: CREATE EXTENSION IF NOT EXISTS vector; — this is required before the server can create embedding tables.
Indexing fails with memory errors on large PDFs
The multilingual-e5-large model requires significant RAM. Process large files in smaller batches by moving a subset of documents into SOURCE_DIR at a time, then re-running the index command.
Search returns irrelevant results
Ensure the EMBEDDING_PREFIX_QUERY is set to 'query: ' and EMBEDDING_PREFIX_EMBEDDING to 'passage: ' — these prefixes are required by the multilingual-e5-large model for accurate similarity matching.
Frequently Asked Questions about RAG Server
What is RAG Server?
RAG Server is a Model Context Protocol (MCP) server that enables retrieval-augmented generation (rag) by indexing and searching through documents (markdown, text, powerpoint, pdf) using vector embeddings with multilingual-e5-large model and postgresql pgvector. supports contextual chunk retrieval and incre It connects AI assistants to external tools and data sources through a standardized interface.
How do I install RAG Server?
Follow the installation instructions on the RAG Server GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with RAG Server?
RAG Server works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is RAG Server free to use?
Yes, RAG Server is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.
RAG Server Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to RAG Server? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up RAG Server in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use RAG Server?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.