
ashishpatel26/agentic-rag-with-mcp-server
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
MCP 서버와 Agentic RAG
개요
mCP(Model Context Protocol) 서버와 클라이언트를 구축하는 강력한 프로젝트입니다. 이 설정은 다음과 같은 고급 도구를 사용하여 RAG 시스템을 허용합니다. 서버는 이러한 지능형 도구를 호스팅하고 클라이언트가 원활하게 연결하고 활용하는 방법을 보여줍니다. mcp 라이브러리에서 FastMCP 클래스에 의해 구동, 서버는이 편리한 도구를 노출: 클라이언트는 MCP 서버와 연결하고 상호 작용하는 방법을 보여줍니다: * mcp 라이브러리의 ClientSession과의 연결 설정 * 모든 사용 가능한 서버 도구 * 사용자 지정 인수로 모든 도구를 호출 * 프로세스 쿼리 레버리지 및 탠덤에서 MCP 도구 * Python 3.9 이상 * openai Python 패키지 * mcp 라이브러리 * 환경 변수 관리를위한 python-dotenv 1. .env 파일 만들기 (사용 .env.sample 템플릿으로) 2. .env에서 OpenAI 모델을 설정:
개요(AI 번역)
✨ 개요
** MCP Server**를 가진 Agentic RAG는 MCP(모델 Context Protocol) 서버와 클라이언트를 함께 제공하는 강력한 프로젝트입니다 Agentic RAG(Retrieval-Augmented Generation) 애플리케이션.
이 설정은 다음과 같은 고급 도구를 사용하여 RAG 시스템을 허용합니다.
- ️ ♂️Entity Extraction
- 🇨🇳 ** 쿼리 정의 **
- ✅ **Relevance Checking **
서버는 이러한 지능형 도구를 호스팅하고 클라이언트가 원활하게 연결하고 활용하는 방법을 보여줍니다.
̇️ 서버 — [T0]]
FastMCP] 클래스의 mcp 라이브러리에서, 서버는 이러한 편리한 도구를 노출:
| 도구 이름 | 설명 | 아이콘 |
| -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| get_time_with_prefix|현재의 날짜 및 시간**||
| extract_entities_tool | 용도 OpenAI 쿼리에서 엔티티티를 추출할 수 있습니다.
| refine_query_tool | OpenAI-powered refinement | ✨ | 의 품질 향상
| check_relevance | LLM을 이용한 펑크의 반란을 확인하여 부정확한 콘텐츠를 필터링 | ✅ |
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
🚀 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 🙏
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →