MCP-RAG: Modular RAG Pipeline using MCP & GroundX
About
MCP server Implantation for RAG (GroundX API)
Details
- Author
- sujithadr
- Downloads
- 222
- Categories
- Knowledge Base
Jump to
- Modular tool design using MCP server interface
- YAML-based prompt templates with Jinja2 rendering
- PDF file ingestion into GroundX vector store
- Real-time semantic search via GroundX Search Tool
- Plug-and-play API integration for new tools
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
MCP-RAG: Modular RAG Pipeline using MCP & GroundXCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Set up a .env file with your OPENAI_API_KEY and GROUNDEX_API_KEY, then install dependencies with uv pip install -r pyproject.toml. Start the MCP server with mcp dev server.py. Ingest a PDF using mcp call ingest_documents --args '{"file_path": "data/sample.pdf"}' and perform a search with mcp call process_search_query --args '{"query": "What is explained in section 3?"}'.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"mcp-rag: modular rag pipeline using mcp & groundx": {
"mcp-rag-sujithadr": {
"command": "uv",
"args": [
"pip",
"install",
"-r",
"pyproject.toml"
]
}
}
}
}
McpServers
{
"mcp-rag-sujithadr": {
"command": "uv",
"args": [
"pip",
"install",
"-r",
"pyproject.toml"
]
}
}
MCP-RAG: Modular RAG Pipeline using MCP & GroundX
A production-ready Retrieval-Augmented Generation setup
π Overview
MCP-RAG is a modular, production-grade implementation of a Retrieval-Augmented Generation (RAG) system, powered by:
- π§ MCP (Model Context Protocol) for standardized tool orchestration
- π GroundX for semantic search, ingestion, and vector store operations
- π€ OpenAI GPT-4 for LLM-powered contextual response generation
It allows clean separation of responsibilities across ingestion, search, generation, and tool discovery β making it scalable, flexible, and enterprise-ready.
> π Developed by Sujith Somanunnithan for teams building AI-driven applications with reusable components.
---
π¦ Features
- π§ Modular Tool Design using MCP server interface
- π§© YAML-Based Prompt Templates with Jinja2 rendering
- π PDF File Ingestion into GroundX vector store
- π Real-Time Semantic Search via GroundX Search Tool
- π€ Plug-and-Play API Integration for new tools and services
---
π Project Structure
mcp-rag/
βββ server.py # MCP Server initialization
βββ config.py # Environment and config management
βββ ingestion.py # File ingestion tool logic
βββ search.py # Search + LLM generation logic
βββ prompts.yaml # Prompt template in Jinja2
βββ models.py # Pydantic models for configs
βββ .env # API keys (excluded from version control)
βββ pyproject.toml # Project config for uv / MCP
βββ README.md # This file
---
π§ Architectural Flow
1. User query arrives at the MCP server
2. Server routes it to the Search Tool
3. Search Tool queries GroundX API
4. Snippets are rendered via YAML prompt
5. OpenAI API generates final LLM response
> π All tools are discoverable and invocable via MCP dynamically.
---
π Environment Setup
Create .env with your keys:
OPENAI_API_KEY=your-openai-key
GROUNDEX_API_KEY=your-groundx-key
Install using uv:
uv pip install -r pyproject.toml
---
βοΈ Usage
Start the server:
mcp dev server.py
Ingest a PDF:
mcp call ingest_documents --args '{"file_path": "data/sample.pdf"}'
Search with a query:
mcp call process_search_query --args '{"query": "What is explained in section 3?"}'
---
π Clean Separation of Concerns
| Role | Component |
|-------------------------|------------------------|
| Tool discovery/invoke | MCP Server |
| Search execution | GroundX API |
| Response generation | OpenAI API |
| File upload | Ingest Tool (MCP) |
---
π License
This project is licensed under the MIT License.
---
π¨βπ» Author
Sujith Somanunnithan
Cloud & AI Architect | sujith.de
---
π¬ Feedback & Contributions
Feel free to raise issues, pull requests, or connect with the author for improvements or extensions (like multi-file ingestion, RAG fallback chains, etc).
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


