Agentic RAG with MCP Server - Powerful tools for entity extraction, query refinement, and relevance checking
Project description
🚀 Agentic RAG with MCP Server 
✨ Overview
Agentic RAG with MCP Server is a powerful project that brings together an MCP (Model Context Protocol) server and client for building Agentic RAG (Retrieval-Augmented Generation) applications.
This setup empowers your RAG system with advanced tools such as:
- 🕵️♂️ Entity Extraction
- 🔍 Query Refinement
- ✅ Relevance Checking
The server hosts these intelligent tools, while the client shows how to seamlessly connect and utilize them.
🖥️ Server — server.py
Powered by the FastMCP class from the mcp library, the server exposes these handy tools:
| Tool Name | Description | Icon |
|---|---|---|
get_time_with_prefix |
Returns the current date & time | ⏰ |
extract_entities_tool |
Uses OpenAI to extract entities from a query — enhancing document retrieval relevance | 🧠 |
refine_query_tool |
Improves the quality of user queries with OpenAI-powered refinement | ✨ |
check_relevance |
Filters out irrelevant content by checking chunk relevance with an LLM | ✅ |
🤝 Client — mcp-client.py
The client demonstrates how to connect and interact with the MCP server:
- Establish a connection with
ClientSessionfrom themcplibrary - List all available server tools
- Call any tool with custom arguments
- Process queries leveraging OpenAI or Gemini and MCP tools in tandem
⚙️ Requirements
- Python 3.9 or higher
openaiPython packagemcplibrarypython-dotenvfor environment variable management
🛠️ Installation Guide
# Step 1: Clone the repository
git clone https://github.com/ashishpatel26/Agentic-RAG-with-MCP-Server.git
# Step 2: Navigate into the project directory
cd Agentic-RAG-with-MCP-Serve
# Step 3: Install dependencies
pip install -r requirements.txt
🔐 Configuration
- Create a
.envfile (use.env.sampleas a template) - Set your OpenAI model in
.env:
OPENAI_MODEL_NAME="your-model-name-here"
GEMINI_API_KEY="your-model-name-here"
🚀 How to Use
- Start the MCP server:
python server.py
- Run the MCP client:
python mcp-client.py
📜 License
This project is licensed under the MIT License.
Thanks for Reading 🙏
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iflow_mcp_agentic_rag_with_mcp_server_1-0.1.0.tar.gz.
File metadata
- Download URL: iflow_mcp_agentic_rag_with_mcp_server_1-0.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1043c558d7e9ea58b1117e22ed3eea5834773566b44c8d86ef5d718a0742fcb0
|
|
| MD5 |
57ef106d02509c7e52ed2e39535c26b0
|
|
| BLAKE2b-256 |
86ffded59086ebc7b6307b62e57580df19087cc584195f19a1f50ec75de62afd
|
File details
Details for the file iflow_mcp_agentic_rag_with_mcp_server_1-0.1.0-py3-none-any.whl.
File metadata
- Download URL: iflow_mcp_agentic_rag_with_mcp_server_1-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.10 {"installer":{"name":"uv","version":"0.9.10"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3851bfe7605ad2c9bab22a9aa66a20c78c0f38be43e1dc3a70d5b03a38135679
|
|
| MD5 |
bcccb38c69601103884ec483615d2e4f
|
|
| BLAKE2b-256 |
5adef665bd089b4f57021dff962663d20ef682eb60308642fa28a88b9081b905
|