Agentic RAG MCP

v1.0.0Knowledge & Memorystable

Agentic RAG with MCP Server

agentic-rag-with-mcp-servermcpai-integration
Share:
34
Stars
0
Downloads
0
Weekly
0/5

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

Enable Retrieval Augmented Generation for agentic workflows.
Combine document retrieval with agent reasoning.
Build knowledge-aware AI systems.
ashishpatel26

Maintainer

LicenseMIT
Languagepython
Versionv1.0.0
UpdatedApr 9, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx agentic-rag-with-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

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
1

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-Server
2

Create 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\activate
3

Install dependencies

Install all required Python packages including FastMCP, openai, and python-dotenv from the requirements file.

pip install -r requirements.txt
4

Configure 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_here
5

Start 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.py

Agentic 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.

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.

Quick Config Preview

{ "mcpServers": { "agentic-rag-with-mcp-server": { "command": "npx", "args": ["-y", "agentic-rag-with-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides