Azure OpenAI

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Uses .env configuration for storing Azure OpenAI credentials and settings.

  • References to GitHub repositories for MCP-related projects and resources, including the official MCP Python SDK, server implementations, and community resources.

  • Integrates with Azure OpenAI to provide AI model capabilities. The server implements a bridge that converts MCP responses to the OpenAI function calling format.

Azure OpenAI を使用するための MCP サーバーとクライアントの実装

  • モデル コンテキスト プロトコル (MCP) と Azure OpenAI を活用した最小限のサーバー/クライアント アプリケーション実装。
    1. MCP サーバーはFastMCPを使用して構築されます。
    2. Playwrightは、最新の Web アプリケーションをテストするための、Microsoft によるオープン ソースのエンドツーエンドのテスト フレームワークです。
    3. ツールに関する MCP 応答は、OpenAI 関数呼び出し形式に変換されます。
    4. MCP サーバー応答を OpenAI 関数呼び出し形式に変換するブリッジはMCP-LLM Bridge実装をカスタマイズします。
    5. 安定した接続を確保するために、サーバー オブジェクトはブリッジに直接渡されます。

モデルコンテキストプロトコル(MCP)

モデル コンテキスト プロトコル (MCP) MCP (モデル コンテキスト プロトコル) は、AI アプリケーションとローカルまたはリモート リソース間の安全で制御された相互作用を可能にするオープン プロトコルです。

公式リポジトリ

コミュニティリソース

関連プロジェクト

  • FastMCP : MCP サーバーを構築するための高速な Python の方法。
  • チャットMCP :MCPクライアント
  • MCP-LLM ブリッジ: MCP サーバーと OpenAI 互換 LLM 間の通信を可能にする MCP 実装

MCP劇作家

構成

2024年12月の開発フェーズでは、Pythonプロジェクトは「uv」で開始される予定です。「pip」や「poetry」などの他の依存関係管理ライブラリは、MCP CLIではまだ完全にサポートされていません。

  1. .env.templateの名前を.envに変更し、Azure OpenAI の.envに値を入力します。
    AZURE_OPEN_AI_ENDPOINT= AZURE_OPEN_AI_API_KEY= AZURE_OPEN_AI_DEPLOYMENT_MODEL= AZURE_OPEN_AI_API_VERSION=
  2. Pythonライブラリ管理用のuvをインストールする
    pip install uv uv sync
  3. python chatgui.pyを実行する
    • サンプル画面では、クライアントがブラウザを起動して URL に移動する様子が示されています。

'stdio' に関して

stdioトランスポート層(生データフロー)であり、 JSON-RPCは アプリケーションプロトコル(構造化通信)です。これらは明確に区別できるものですが、プロトコルでは「JSON-RPC over stdio」のように、しばしば互換的に使用されます。

ツールの説明

@self.mcp.tool() async def playwright_navigate(url: str, timeout=30000, wait_until="load"): """Navigate to a URL.""" -> This comment provides a description, which may be used in a mechanism similar to function calling in LLMs. # Output Tool(name='playwright_navigate', description='Navigate to a URL.', inputSchema={'properties': {'url': {'title': 'Url', 'type': 'string'}, 'timeout': {'default': 30000, 'title': 'timeout', 'type': 'string'}

ヒント: uv

uv run: Run a script. uv venv: Create a new virtual environment. By default, '.venv'. uv add: Add a dependency to a script uv remove: Remove a dependency from a script uv sync: Sync (Install) the project's dependencies with the environment.

ヒント

  • python.exe の taskkill コマンド
taskkill /IM python.exe /F
  • Visual Code: Python デバッガー: launch.json を使用してデバッグすると、.vscode/launch.json の構成を使用してデバッガーが起動します。
-
security - not tested
A
license - permissive license
-
quality - not tested

モデル コンテキスト プロトコル (MCP) と Azure OpenAI を活用した最小限のサーバー/クライアント アプリケーション実装。

  1. Model Context Protocol (MCP)
    1. Official Repositories
    2. Community Resources
    3. Related Projects
    4. MCP Playwright
    5. Configuration
    6. w.r.t. 'stdio'
    7. Tool description
    8. Tip: uv
    9. Tip
ID: ta21762xc9