MCP-RAG: Modular RAG Pipeline using MCP & GroundX
@sujithadr
MCP server Implantation for RAG (GroundX API)
Overview
What is MCP-RAG: Modular RAG Pipeline using MCP & GroundX?
MCP-RAG is a modular, production-grade Retrieval-Augmented Generation (RAG) system that integrates GroundX for semantic search and ingestion, OpenAI GPT-4 for response generation, and the Model Context Protocol (MCP) for standardized tool orchestration. It is designed for teams building AI-driven applications with reusable components.
How to use MCP-RAG: Modular RAG Pipeline using MCP & GroundX?
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?"}'.
Key features of MCP-RAG: Modular RAG Pipeline using MCP & GroundX
- 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
Use cases of MCP-RAG: Modular RAG Pipeline using MCP & GroundX
- Ingest PDF documents and perform semantic search on their content
- Build a modular RAG pipeline with clean separation of concerns
- Use standardized MCP tool orchestration for AI applications
FAQ from MCP-RAG: Modular RAG Pipeline using MCP & GroundX
What dependencies are required?
Python >=3.12, an OpenAI API key, a GroundX API key, and the uv package manager.
How do I ingest a PDF?
Run mcp call ingest_documents --args '{"file_path": "data/sample.pdf"}'.
How do I perform a semantic search?
Run mcp call process_search_query --args '{"query": "What is explained in section 3?"}'.
What is the architectural flow?
User query → MCP server routes to Search Tool → Search Tool queries GroundX API → snippets are rendered via YAML prompt → OpenAI API generates final LLM response.
Where is the ingested data stored?
Data is stored in the GroundX vector store (via the ingestion tool).