RAG Server

v1.0.0Knowledge & Memorystable

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

mcp-rag-servermcpai-integration
Share:
70
Stars
0
Downloads
0
Weekly
0/5

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

Index and search documents using vector embeddings.
Perform retrieval-augmented generation on PDF, PowerPoint, and text.
Build searchable knowledge bases from diverse document types.
karaage0703

Maintainer

LicenseMIT License
Languagepython
Versionv1.0.0
UpdatedMar 31, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-rag-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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 sync
2

Start 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;"
3

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: "
4

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 index
5

Start 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.main
6

Configure 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.

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.

Quick Config Preview

{ "mcpServers": { "mcp-rag-server": { "command": "npx", "args": ["-y", "mcp-rag-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides