A generic RAG MCP server with pluggable embedding providers and vector stores
Project description
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
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 |
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rag_retrieval_mcp-0.1.0.tar.gz.
File metadata
- Download URL: rag_retrieval_mcp-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f313974bef976175334879efae3c32a383478447e5943844a1548866e295352b
|
|
| MD5 |
616d203757ad47ea2ebfa905899f241c
|
|
| BLAKE2b-256 |
765cee75ba4c3a13ee70c829c5ce2154daf934e6a6e0b19ccbd25d2e5f83041b
|
File details
Details for the file rag_retrieval_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rag_retrieval_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
206b8221e51321e14f7cf98c9398739974a01d37f6cda3ae735ec3573a46f519
|
|
| MD5 |
578be07293560d999c9c8b4bb6a80bec
|
|
| BLAKE2b-256 |
5e238088fad878d2b22889a3871893bdf06263a9f1cca584f5d04a30287253fb
|