Agentic RAG MCP
Agentic RAG with MCP Server
What is Agentic RAG MCP?
Agentic RAG MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to agentic rag with mcp server
Agentic RAG with MCP Server
This server falls under the Knowledge & Memory and Coding Agents categories on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- Agentic RAG with MCP Server
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx agentic-rag-with-mcp-serverConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Agentic RAG MCP
Agentic RAG with MCP Server implements a Retrieval-Augmented Generation pipeline as an MCP server using FastMCP, enabling AI agents to query documents intelligently rather than relying solely on their training data. The server exposes tools for entity extraction, query refinement, and relevance filtering — allowing an LLM to iteratively improve its retrieval queries and evaluate the usefulness of retrieved chunks before forming a response. It is designed for researchers and developers who want to build knowledge-aware agents that combine real-time document retrieval with the reasoning capabilities of OpenAI or Google Gemini models.
Prerequisites
- Python 3.9 or later
- An OpenAI API key (OPENAI_API_KEY or OPENAI_MODEL_NAME configured)
- A Google Gemini API key (GEMINI_API_KEY)
- pip or a virtual environment manager such as venv or conda
- An MCP-compatible client or the ability to run the included mcp-client.py script
Clone the repository
Download the project source code from GitHub to your local machine.
git clone https://github.com/ashishpatel26/Agentic-RAG-with-MCP-Server.git
cd Agentic-RAG-with-MCP-ServerCreate and activate a virtual environment
Isolate the project dependencies in a Python virtual environment to avoid conflicts with system packages.
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activateInstall dependencies
Install all required Python packages including FastMCP, openai, and python-dotenv from the requirements file.
pip install -r requirements.txtConfigure environment variables
Create a .env file in the project root with your API keys. OPENAI_MODEL_NAME sets the OpenAI model used for entity extraction and query refinement; GEMINI_API_KEY enables Gemini-powered retrieval steps.
OPENAI_MODEL_NAME=gpt-4o
GEMINI_API_KEY=your_gemini_api_key_hereStart the MCP server and run the client
Launch the FastMCP server in one terminal, then execute the client script to establish a ClientSession and invoke the available RAG tools.
# Terminal 1 - start the server
python server.py
# Terminal 2 - run the client
python mcp-client.pyAgentic RAG MCP Examples
Client configuration
Configuration block for connecting an MCP client to the Agentic RAG server running locally via stdio.
{
"mcpServers": {
"agentic-rag": {
"command": "python",
"args": ["/absolute/path/to/Agentic-RAG-with-MCP-Server/server.py"],
"env": {
"OPENAI_MODEL_NAME": "gpt-4o",
"GEMINI_API_KEY": "your_gemini_api_key_here"
}
}
}
}Prompts to try
Sample prompts that exercise entity extraction, query refinement, and relevance filtering tools.
- "Extract the key entities from this paragraph: 'Apple released the M3 MacBook Pro in October 2023 targeting professional video editors.'"
- "Refine this search query to be more specific for RAG retrieval: 'climate change effects'"
- "Given this retrieved chunk, is it relevant to the question 'What are the side effects of ibuprofen?': [chunk text here]"
- "What is the current date and time?"
- "Walk me through a full RAG pipeline: extract entities from my question, refine the query, and filter the retrieved results."Troubleshooting Agentic RAG MCP
ModuleNotFoundError for mcp or fastmcp
Ensure your virtual environment is activated before running pip install -r requirements.txt and before starting server.py. Run 'pip list | grep mcp' to confirm the packages are installed in the active environment.
OpenAI API errors or rate limit exceeded
Verify that OPENAI_MODEL_NAME in your .env file is a valid model identifier (e.g., gpt-4o) and that your OpenAI account has sufficient credits. Check that the .env file is in the project root and python-dotenv is loading it correctly.
Client cannot connect to the server
Make sure server.py is running in a separate terminal before starting mcp-client.py. Confirm both scripts reference the same transport configuration (default is stdio). Check for Python version compatibility — the project requires Python 3.9 or later.
Frequently Asked Questions about Agentic RAG MCP
What is Agentic RAG MCP?
Agentic RAG MCP is a Model Context Protocol (MCP) server that agentic rag with mcp server It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Agentic RAG MCP?
Follow the installation instructions on the Agentic RAG MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Agentic RAG MCP?
Agentic RAG MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Agentic RAG MCP free to use?
Yes, Agentic RAG MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Agentic RAG MCP Alternatives — Similar Knowledge & Memory Servers
Looking for alternatives to Agentic RAG MCP? Here are other popular knowledge & memory servers you can use with Claude, Cursor, and VS Code.
MemPalace
★ 52.6kA local AI memory system that stores all conversations verbatim and organizes them into navigable structures. It provides 19 MCP tools for AI assistants to search and retrieve past decisions, debugging sessions, and architecture debates automatically
Kratos
★ 25.7k🏛️ Memory System for AI Coding Tools - Never explain your codebase again. MCP server with perfect project isolation, 95.8% context accuracy, and the Four Pillars Framework.
Context Mode
★ 15.4kAn MCP server that preserves LLM context by intercepting large data outputs and returning only concise summaries or relevant sections. It enables efficient sandboxed code execution, file processing, and documentation indexing across multiple programm
Memu
★ 13.7kMemory for 24/7 proactive agents like OpenClaw.
MemOS
★ 9.3kMemOS (Memory Operating System) is a memory management operating system designed for AI applications. Its goal is: to enable your AI system to have long-term memory like a human, not only remembering what users have said but also actively invoking, u
Everos
★ 5.4kBuild, evaluate, and integrate long-term memory for self-evolving agents.
Browse More Knowledge & Memory MCP Servers
Explore all knowledge & memory servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Agentic RAG MCP in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Agentic RAG MCP?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.