mcpField
M
MCP-RAG: Modular RAG Pipeline using MCP & GroundX

MCP-RAG: Modular RAG Pipeline using MCP & GroundX

Local
github.com/sujithadrMemory & Knowledge0Updated 73w ago

About MCP-RAG: Modular RAG Pipeline using MCP & GroundX

MCP-RAG is a modular RAG implementation using GroundX and OpenAI GPT-4, intended for teams building AI applications. It separates document ingestion, semantic search, and response generation into discoverable, callable tools.

Key features

  1. 01Ingest PDFs into GroundX
  2. 02Run semantic search with GroundX
  3. 03Generate answers with OpenAI GPT-4
  4. 04Render YAML prompts with Jinja2
  5. 05Modular tool design and discovery

Use cases

  1. 01Add PDF documents to a vector store
  2. 02Answer queries using document content

MCP support

The MCP server provides document-ingestion and search tools for clients to discover and invoke. GroundX performs search, while the OpenAI API generates responses.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP-RAG: Modular RAG Pipeline using MCP & GroundX

A production-ready Retrieval-Augmented Generation setup

License Python

🚀 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

RoleComponent
Tool discovery/invokeMCP Server
Search executionGroundX API
Response generationOpenAI API
File uploadIngest 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).

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.