Provides live RAG capabilities by connecting to a vector store and exposing MCP endpoints for automatic context retrieval.
Configuration
View docs{
"mcpServers": {
"0xrdan-mcp-rag-server": {
"command": "node",
"args": [
"/path/to/mcp-rag-server/dist/server.js"
],
"env": {
"CHROMA_URL": "http://localhost:8000",
"OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
"CHROMA_COLLECTION": "my_knowledge_base"
}
}
}
}You can run an MCP RAG Server that exposes a ready-to-use retrieval-augmented generation (RAG) workflow to Claude Code and any MCP client. It connects your vector store, handles embedding, hybrid search, and document indexing, so you fetch live knowledge from your own data sources without manual context pasting.
Use the MCP RAG Server as a standard MCP endpoint that plugs into your client. Once running, your MCP client can index documents, run hybrid searches, and query your knowledge base to retrieve relevant context automatically. Typical workflows include indexing internal documents, querying for architectural details, and retrieving up-to-date information from your vector store to augment prompts.
# Prerequisites
- Install Node.js (recommended LTS)
- Ensure you have access to a ChromaDB instance or run the provided Docker image
# Start ChromaDB (example)
docker run -p 8000:8000 chromadb/chroma
# Set embedding API key (OpenAI used for embeddings)
export OPENAI_API_KEY="sk-..."
```
```
# Clone the project
git clone https://github.com/0xrdan/mcp-rag-server.git
cd mcp-rag-server
# Install dependencies
npm install
# Build the server for distribution
npm run buildConfigure Claude Code or another MCP client to connect to the local server. The example below shows how to point the client to run the server locally with the required environment variables and a local path to the built server file.
{
"mcpServers": {
"rag": {
"command": "node",
"args": ["/path/to/mcp-rag-server/dist/server.js"],
"env": {
"OPENAI_API_KEY": "sk-...",
"CHROMA_URL": "http://localhost:8000",
"CHROMA_COLLECTION": "my_knowledge_base"
}
}
}
}Query the knowledge base with hybrid search and return formatted context suitable for prompts.
Perform a raw similarity search returning chunks with scores.
Add a single document to the knowledge base.
Index multiple documents in a batch.
Delete all documents from a given source.
Retrieve collection statistics like total chunks and documents.
Permanently clear all data in the collection (requires confirmation).