rag-mcp

rag-mcp

Enables ingestion and semantic search over text documents using PostgreSQL + pgvector and OpenAI-compatible embeddings, allowing any LLM agent to retrieve relevant chunks for grounded answers.

Category
Visit Server

README

rag-mcp

A RAG-over-docs MCP server: ingest text into collections, then let any LLM agent semantically search it. Backed by PostgreSQL + pgvector, embeddings via any OpenAI-compatible endpoint (OpenAI, Azure, or a local Ollama / llama.cpp server).

RAG is split the MCP-native way — this server owns retrieval (chunk → embed → store → cosine search); the calling model owns generation. Point Claude, ChatGPT, Cursor, or any MCP client at it and answers get grounded in your docs.

Tools

Tool Purpose
ingest_text Chunk, embed, and store text in a collection (with optional metadata)
search Top-k semantic search over a collection; returns chunks + 0–1 cosine score
list_collections List collections and their chunk counts
delete_collection Delete a collection and all its chunks

Quickstart

# 1. Start Postgres + pgvector and the server
cp .env.example .env         # set EMBEDDINGS_API_KEY
docker compose up -d --build

# — or run locally over stdio (e.g. for Claude Desktop) —
uv pip install --system .
docker compose up -d db      # just the database
EMBEDDINGS_API_KEY=sk-... rag-mcp

Add to an MCP client (stdio):

{ "mcpServers": { "rag": { "command": "rag-mcp",
  "env": { "EMBEDDINGS_API_KEY": "sk-...",
           "DATABASE_URL": "postgresql://postgres:postgres@localhost:5432/rag" } } } }

Configuration

All via environment (see .env.example): DATABASE_URL, EMBEDDINGS_API_BASE / EMBEDDINGS_API_KEY / EMBEDDINGS_MODEL, EMBED_DIM (must match your model's dimension — 1536 for text-embedding-3-small), CHUNK_SIZE, CHUNK_OVERLAP, and MCP_TRANSPORT (stdio | http).

How it works

ingest_text splits text on natural boundaries with overlap, embeds each chunk, and stores it in a chunks table with a vector(EMBED_DIM) column and an ivfflat cosine index. search embeds the query and returns the nearest chunks by cosine distance (<=>). Everything is namespaced by collection.

License

Copyright © 2026 Next Level Management Advisors, LLC.

Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE. If you run a modified version over a network, the AGPL requires you to make your modified source available to its users.

Commercial licensing: to use this in a closed-source or commercial product, or to host a modified version without publishing your source, a commercial license is available — contact forrest@nlma.io.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured