rag-retrieval-mcp

rag-retrieval-mcp

Enables retrieval-augmented generation by embedding queries with a chosen provider (e.g., OpenAI) and searching supported vector stores (Pinecone, pgvector) to return relevant content.

Category
Visit Server

README

MCP Server for RAG Retrieval

A generic Retrieval-Augmented Generation (RAG) Model Context Protocol (MCP) server with pluggable embedding providers and vector stores.

Why this server?

Vendor MCP servers usually only support their (own) integrated embedding models. If your index uses external embeddings (e.g., OpenAI), those servers can't query it. This server fills that gap — it embeds your query with the provider of your choice, then searches any supported vector store.

Currently Supports

Embedding Providers:

  • OpenAI (text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002, etc.)

Vector Stores:

  • Pinecone
  • pgvector (PostgreSQL)

Tools

retrieve

Search a knowledge base and return relevant content.

Parameters:

  • query (string, required) — The search query to find relevant content.

Returns a JSON array of results, each with text, score, and metadata fields.

Install & Run

Run directly with uvx (no install needed):

uvx rag-retrieval-mcp[all]

Or install with pip:

pip install rag-retrieval-mcp[all]
rag-retrieval-mcp

MCP client configuration

{
  "mcpServers": {
    "rag-retrieval": {
      "command": "uvx",
      "args": ["rag-retrieval-mcp[all]"],
      "env": {
        "OPENAI_API_KEY": "your-openai-api-key",
        "PINECONE_API_KEY": "your-pinecone-api-key",
        "PINECONE_HOST": "your-pinecone-index-host-url"
      }
    }
  }
}

Environment Variables

Variable Required Default Description
RAG_EMBEDDING_PROVIDER No openai Embedding provider to use
RAG_VECTOR_STORE No pinecone Vector store to use
RAG_TOP_K No 5 Number of results to return
OPENAI_API_KEY Yes (if using OpenAI) OpenAI API key
OPENAI_EMBEDDING_MODEL No text-embedding-3-small OpenAI embedding model
PINECONE_API_KEY Yes (if using Pinecone) Pinecone API key
PINECONE_HOST Yes (if using Pinecone) Pinecone index host URL
PINECONE_TEXT_FIELD No text Metadata field containing text
PGVECTOR_CONNECTION_STRING Yes (if using pgvector) PostgreSQL connection string
PGVECTOR_TABLE No embeddings Table name containing vectors
PGVECTOR_TEXT_COLUMN No text Column containing text content
PGVECTOR_EMBEDDING_COLUMN No embedding Column containing embedding vectors

Adding New Providers

Implement the EmbeddingProvider or VectorStore abstract base class and register it in server.py's factory function. See src/rag_retrieval_mcp/embedding_providers/base.py and src/rag_retrieval_mcp/vector_stores/base.py for the interfaces.

License

Apache License 2.0

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
Qdrant Server

Qdrant Server

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

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