🚀 MCP サーバーを使用した Agentic RAG
✨ 概要
Agentic RAG with MCP Server は、 Agentic RAG (Retrieval-Augmented Generation) アプリケーションを構築するために MCP (Model Context Protocol) サーバーとクライアントを統合する強力なプロジェクトです。
このセットアップにより、次のような高度なツールが RAG システムに導入されます。
- 🕵️♂️エンティティ抽出
- 🔍クエリの絞り込み
- ✅関連性チェック
サーバーはこれらのインテリジェント ツールをホストし、クライアントはそれらをシームレスに接続して活用する方法を示します。
🖥️ サーバー — server.py
mcp
ライブラリのFastMCP
クラスを活用したこのサーバーは、次のような便利なツールを公開します。
ツール名 | 説明 | アイコン |
---|---|---|
get_time_with_prefix | 現在の日付と時刻を返します | ⏰ |
extract_entities_tool | OpenAIを使用してクエリからエンティティを抽出し、ドキュメント検索の関連性を高めます。 | 🧠 |
refine_query_tool | OpenAIを活用した改良によりユーザークエリの品質を向上 | ✨ |
check_relevance | LLMでチャンクの関連性をチェックして無関係なコンテンツを除外します | ✅ |
🤝 クライアント — mcp-client.py
クライアントは、MCP サーバーに接続して対話する方法を示します。
mcp
ライブラリからClientSession
との接続を確立する- 利用可能なすべてのサーバーツールを一覧表示する
- カスタム引数で任意のツールを呼び出す
- OpenAI または Geminiと MCP ツールを連携して活用してクエリを処理する
⚙️ 要件
- Python 3.9以上
openai
Pythonパッケージmcp
ライブラリ- 環境変数管理のための
python-dotenv
🛠️ インストールガイド
🔐 構成
.env
ファイルを作成する (.env.sample
をテンプレートとして使用).env
で OpenAI モデルを設定します。
🚀 使い方
- MCP サーバーを起動します。
- MCP クライアントを実行します。
📜 ライセンス
このプロジェクトはMIT ライセンスに基づいてライセンスされています。
読んでくれてありがとう🙏
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
エンティティ抽出、クエリ絞り込み、関連性チェック機能を使用して RAG アプリケーションを強化するインテリジェント ツールを公開するサーバー。
Related MCP Servers
- -securityAlicense-qualityProvides RAG capabilities for semantic document search using Qdrant vector database and Ollama/OpenAI embeddings, allowing users to add, search, list, and delete documentation with metadata support.Last updated -514TypeScriptApache 2.0
- -securityFlicense-qualityThis server enables AI assistants (CLINE, Cursor, Windsurf, Claude Desktop) to share a common knowledge base through Retrieval Augmented Generation (RAG), providing consistent information access across multiple tools.Last updated -3TypeScript
Agentsetofficial
AsecurityAlicenseAqualityAn open-source platform for Retrieval-Augmented Generation (RAG). Upload documents and query them ⚡Last updated -1159JavaScriptMIT License- -securityFlicense-qualityImplements Retrieval-Augmented Generation (RAG) using GroundX and OpenAI, allowing users to ingest documents and perform semantic searches with advanced context handling through Modern Context Processing (MCP).Last updated -3Python