Azure OpenAI を使用するための MCP サーバーとクライアントの実装
- モデル コンテキスト プロトコル (MCP) と Azure OpenAI を活用した最小限のサーバー/クライアント アプリケーション実装。
- MCP サーバーは
FastMCP
を使用して構築されます。 Playwright
は、最新の Web アプリケーションをテストするための、Microsoft によるオープン ソースのエンドツーエンドのテスト フレームワークです。- ツールに関する MCP 応答は、OpenAI 関数呼び出し形式に変換されます。
- MCP サーバー応答を OpenAI 関数呼び出し形式に変換するブリッジは
MCP-LLM Bridge
実装をカスタマイズします。 - 安定した接続を確保するために、サーバー オブジェクトはブリッジに直接渡されます。
- MCP サーバーは
モデルコンテキストプロトコル(MCP)
モデル コンテキスト プロトコル (MCP) MCP (モデル コンテキスト プロトコル) は、AI アプリケーションとローカルまたはリモート リソース間の安全で制御された相互作用を可能にするオープン プロトコルです。
公式リポジトリ
コミュニティリソース
関連プロジェクト
- FastMCP : MCP サーバーを構築するための高速な Python の方法。
- チャットMCP :MCPクライアント
- MCP-LLM ブリッジ: MCP サーバーと OpenAI 互換 LLM 間の通信を可能にする MCP 実装
MCP劇作家
構成
2024年12月の開発フェーズでは、Pythonプロジェクトは「uv」で開始される予定です。「pip」や「poetry」などの他の依存関係管理ライブラリは、MCP CLIではまだ完全にサポートされていません。
.env.template
の名前を.env
に変更し、Azure OpenAI の.env
に値を入力します。- Pythonライブラリ管理用の
uv
をインストールする python chatgui.py
を実行する- サンプル画面では、クライアントがブラウザを起動して URL に移動する様子が示されています。
'stdio' に関して
stdio
はトランスポート層(生データフロー)であり、 JSON-RPCは アプリケーションプロトコル(構造化通信)です。これらは明確に区別できるものですが、プロトコルでは「JSON-RPC over stdio」のように、しばしば互換的に使用されます。
ツールの説明
ヒント: uv
ヒント
- python.exe の taskkill コマンド
- Visual Code: Python デバッガー: launch.json を使用してデバッグすると、.vscode/launch.json の構成を使用してデバッガーが起動します。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
モデル コンテキスト プロトコル (MCP) と Azure OpenAI を活用した最小限のサーバー/クライアント アプリケーション実装。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol (MCP) server that lets you seamlessly use OpenAI's models right from Claude.Last updated -17565MIT License
- -securityAlicense-qualityA simple MCP server for interacting with OpenAI assistants. This server allows other tools (like Claude Desktop) to create and interact with OpenAI assistants through the Model Context Protocol.Last updated -36MIT License
- -securityFlicense-qualityA Model Context Protocol server implementation that enables connection between OpenAI APIs and MCP clients for coding assistance with features like CLI interaction, web API integration, and tool-based architecture.Last updated -34
- -securityAlicense-qualityA Node.js-based remote Model Context Protocol (MCP) server that runs on Azure Container Apps, allowing different AI models and tools to communicate with each other in a serverless environment.Last updated -MIT License