home / mcp / rag information retriever mcp server

RAG Information Retriever MCP Server

Provides retrieval-augmented generation capabilities by indexing documents and enabling context-aware responses from multiple sources.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "chandrahaasj-rag_mcp": {
      "command": "mcp",
      "args": [
        "dev",
        "retrieverServer.py"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_OPENAI_API_KEY",
        "VECTOR_DB_PATH": "./vector-db"
      }
    }
  }
}

You work with a Retrieval-Augmented Generation MCP server that combines semantic retrieval with generation to fetch and synthesize information from multiple sources. This server is ideal when you need accurate, context-aware responses that leverage both structured data and natural language understanding.

How to use

You interact with the server through an MCP client to perform information retrieval and answer generation tasks. Formulate your queries to be specific and provide any relevant context to improve relevance. You can perform basic single-context lookups or advanced multi-context queries that combine multiple sources or data categories. Use filters when you need to narrow results to a particular category or version.

For typical usage, start with a straightforward question such as a feature inquiry or a system overview. When you need deeper results, send a multi-context query that includes a question plus an array of contexts (for example, installation, deployment, and configuration). If you want to limit results to a specific subset, apply filters like category or version. The server will retrieve relevant documents, assemble the best context, and generate a concise, context-aware reply.

How to install

Prerequisites: ensure you have Python installed on your system (Python 3.8+ is recommended) and that you can install Python packages with pip. You also need a running MCP client to interact with the server through the standard MCP workflow.

pip install langchain openai chromadb sentence-transformers

Create a configuration file to provide access to the vector database and the API. Include your OpenAI API key and the path to your vector database. The exact values are placeholders you will replace with your own data.

OPENAI_API_KEY=your_openai_api_key
VECTOR_DB_PATH=path_to_vector_database

Start the MCP server in development mode using the command shown below. This runs the RAG retriever server locally for testing and development.

mcp dev retrieverServer.py

Configuration and security notes

Key configuration items include enabling semantic retrieval, setting up vector storage, and providing an API key for the underlying language model. Protect your API key and restrict access to the server with appropriate authentication controls and rate limiting. Regularly review access permissions and ensure data encryption at rest and in transit where applicable.

Examples and usage patterns

Basic information retrieval lets you ask for a feature overview or system behavior. Advanced retrieval supports multi-context queries that combine context from installation, deployment, and configuration topics, or filtered retrieval that targets specific API documentation or versions.

RAG Information Retriever MCP Server - chandrahaasj/rag_mcp