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 |
PGVECTOR_METADATA_COLUMN |
No | jsonb column containing metadata (if any) |
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
Metadata
Release files for rag-retrieval-mcp 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| rag_retrieval_mcp-0.2.0.tar.gz | 4.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| rag_retrieval_mcp-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.3 kB
Release files / rag_retrieval_mcp-0.2.0.tar.gz
| Download URL | rag_retrieval_mcp-0.2.0.tar.gz |
|---|---|
| Size | 4.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6f3251d33be895f8c958a44077fb72c78438c8d103e092e0bf438c932be61372
|
|
BLAKE2b-256 checksum How to use checksums |
f7bd55f2eba37606636725379c8f4dcc0f19337bab61b1802f8cc9dea84da387
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Release files / rag_retrieval_mcp-0.2.0-py3-none-any.whl
| Download URL | rag_retrieval_mcp-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
08b8e43d64006f9f072d1a8ce1dfed78838a238a90d752946433b7f516c352d1
|
|
BLAKE2b-256 checksum How to use checksums |
232bf578a7a416aee934a3bd7bb325a4b9bb7857d3844583c238163c5581f8d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.17
|
Security for rag-retrieval-mcp 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.