Production-ready RAG system combining LangGraph agent with Model Context Protocol (MCP) integration. Features hybrid search using Reciprocal Rank Fusion (RRF) via MongoDB vector and full-text searches, grounded responses using COSTAR prompting, and automated RAGAS-based evaluation for building reliable, context-aware AI agents.
This repository presents a production-ready RAG system combining LangGraph agent with Model Context Protocol (MCP) integration. Features hybrid search using Reciprocal Rank Fusion (RRF) via MongoDB vector and text searches, grounded responses using COSTAR prompting, and automated RAGAS-based evaluation for building reliable, context-aware AI agents
Overview
The MCP RAG Agent is a sophisticated question-answering system that:
Uses hybrid search to find relevant documents from a policy corpus
Employs a LangGraph agent to reason about and retrieve information
Integrates via the Model Context Protocol (MCP) for modular, reusable components
Ensures grounded responses using the COSTAR prompting framework
Stores and retrieves documents using MongoDB Atlas Vector Search
Provides comprehensive evaluation tools using RAGAS metrics
Key Features
MCP Integration: Standardized protocol for tool exposure and agent communication
Hybrid Search: Combines vector similarity and keyword search using Reciprocal Rank Fusion (RRF)
Semantic Search: Vector-based document retrieval using OpenAI embeddings
Text Search: Full-text keyword search with stemming and relevance scoring
MongoDB Atlas: Scalable vector storage with efficient similarity search
Grounded Responses: Strict context-based answering with no hallucinations
COSTAR Prompting: Structured prompt design for consistent, high-quality outputs
LangGraph Agent: Reasoning and acting cycles for intelligent tool usage
Automated Evaluation: RAGAS-based metrics for answer quality assessment
Architecture
The system architecture diagram illustrates two main workflows:
Document Indexing Flow (Setup Phase): Documents are processed, embedded using OpenAI, and stored in MongoDB Atlas Vector Search with appropriate indexing for efficient retrieval.
Question-Answering Flow (Runtime): User queries trigger the LangGraph ReAct agent, which uses MCP tools to search relevant documents via semantic search, then formulates grounded responses based on retrieved context.
Additionally, the system includes a third workflow not shown in the diagram:
Evaluation Flow (Quality Assurance): The system generates answers for predefined test questions and evaluates them using RAGAS metrics (relevancy, similarity, correctness) to ensure response quality and accuracy.
Environment Variables (.env): Most settings are configured via environment variables, although only the external dependencies are included in the .env.sample file.
Code Configuration (src/mcp_rag_agent/core/config.py): Some advanced settings are configured directly in the Config class, such as text generation parameters (temperature,...)
Note: To modify these settings, edit src/mcp_rag_agent/core/config.py directly. The Config class loads environment variables and provides default values for all configuration parameters.
API Rate Limits: Implement exponential backoff for OpenAI calls
Security
Never commit .env file to version control
Rotate API keys regularly
Use MongoDB Atlas IP whitelisting
Implement rate limiting for production deployments
Sanitize user inputs before processing
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests for new functionality
Update documentation
Submit a pull request
License
MIT
M
MCP Rag Agent
luisrodriguesphd·4 स्टार·
This repository presents a production-ready RAG system combining LangGraph agent with Model Context Protocol (MCP) integration. Features hybrid search using Reciprocal Rank Fusion (RRF) via MongoDB ve
This repository presents a production-ready RAG system combining LangGraph agent with Model Context Protocol (MCP) integration. Features hybrid search using Reciprocal Rank Fusion (RRF) via MongoDB vector and text searches, grounded responses using COSTAR prompting, and automated RAGAS-based evaluation for building reliable, context-aware AI agents
टूल
टूल
अभी टूल सूची नहीं है। रिमोट सर्वर को पहले हेल्थ चेक के बाद सूची मिलती है।
FAQ
सवाल
MCP Rag Agent कैसे इंस्टॉल करें?
इस पेज पर Cursor, Claude Desktop, Claude Code या VS Code के लिए stdio कॉन्फ़िग कॉपी करें। यह पब्लिशर का इंस्टॉल इस्तेमाल करता है, PlugMCP प्रॉक्सी नहीं।
इस रिकॉर्ड में कोई ज़रूरी एनवायरनमेंट वेरिएबल दर्ज नहीं है।
MCP Rag Agent कौन सा ट्रांसपोर्ट इस्तेमाल करता है?
MCP Rag Agent stdio पर लोकल चलता है।
MCP Rag Agent की पिछली जाँच कब हुई थी?
पिछली जाँच 2026-10-28 को हुई। This repository presents a production-ready RAG system combining LangGraph agent with Model Context Protocol (MCP) integration. Features hybrid search using Reciprocal Rank Fusion (RRF) via MongoDB vector and text searches, grounded responses using COSTAR prompting, and automated RAGAS-based evaluation for building reliable, context-aware AI agents