
ashishpatel26/agentic-rag-with-mcp-server
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
MCP Server の Agentic RAG
概要
mCP (Model Context Protocol) サーバとクライアントをビルド(Retrieval-Augmented generation) アプリケーションを組み合わせる強力なプロジェクトです。 このセットアップは、次のような高度なツールを使用して、RAG システムを強化します。 サーバはこれらのインテリジェントなツールをホストします。クライアントはシームレスに接続して利用する方法を示しています。 mcp ライブラリから FastMCP のクラスで、サーバーはこれらの便利なツールを公開します。 クライアントは、MCP サーバーとの接続とやり取り方法を示します。 * mcp ライブラリから ClientSession との接続を確立 * 利用可能なすべてのサーバー ツールを一覧表示 * カスタム 引数を持つ任意のツールを呼び出す * プロセス クエリーと tandem の MCP ツール * Python 3.9 以上 * openai Python パッケージ * mcp ライブラリ * python-dotenv 環境変数管理 1。 .envファイルを作成する(.env.sampleをテンプレートとして使用) 2. .envでOpenAIモデルを設定する:
概要(AI 翻訳)
お問い合わせ
✨ 概要
MCP Server の Agentic RAG は、MCP (Model Context Protocol) サーバーとクライアントを組み合わせて、Agentic RAG (Retrieval-Augmented Generation) アプリケーションを構築するための強力なプロジェクトです。
このセットアップは、次のような高度なツールを使用して、RAG システムを強化します。
- ♂️ ♂️
- 送信完了**
- ✅関連チェックイン
サーバはこれらのインテリジェントなツールをホストします。クライアントはシームレスに接続して利用する方法を示しています。
お問い合わせ
サーバー — [[T0]
[FastMCP] ライブラリの [[T2] クラスの mcp のクラスで、サーバーはこれらの便利なツールを説明します。
| 工具名 | 説明 | アイコン |
| -------------------------------------------------------------------------------------------------------------------------------------- | ---- |
| [get_time_with_prefix | [[T3] ] | [[T3] ] | [現在の日時を返却します。 |
| [extract_entities_tool | クエリからエンティティティを抽出するために「OpenAI**」を利用し、ドキュメントの検索関連を強化 | 🧠 |
|【[[T5]】|【OpenAIパワード精製】でユーザーの問い合わせの質を向上 | ✨ |
| [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 のガイドから始めましょう →