
azure-samples/remote-mcp-apim-functions-python
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
azure-samples/remote-mcp-apim-functions-python は、https://github.com/azure-samples/remote-mcp-apim-functions-python. からインポートされたMCPサーバー候補です。
概要
azure-samples/remote-mcp-apim-functions-python は、https://github.com/azure-samples/remote-mcp-apim-functions-python. からインポートされたMCPサーバー候補です。
概要(AI 翻訳)
Azure API ManagementはMCPサーバーのAIゲートウェイとして機能します。
このサンプルは最新のMCP認可仕様を実装しています
これは流れを理解するためのシーケンス図です。
Deploy Remote MCP Server to Azure
- リソースプロバイダーを登録します。
- Azure CLIを使用している場合は、
az provider register --namespace Microsoft.App --waitを実行してください。 - Azure PowerShellを使用している場合は、
Register-AzResourceProvider -ProviderNamespace Microsoft.Appを実行してください。その後、登録が完了しているか確認するために(Get-AzResourceProvider -ProviderNamespace Microsoft.App).RegistrationStateを実行してください。
- このazdコマンドを実行して、API管理サービス、関数アプリ(コード付き)、その他必要なAzureリソースをプロビジョニングします
MCP検査官とのテスト
-
新しいターミナルウィンドウでMCP Inspectorをインストールして実行します
-
CTRLキーで、アプリに表示されるURLからMCP Inspectorのウェブアプリを読み込みます(例:http://127.0.0.1:6274/#resources)
-
輸送タイプを[[T5]に設定します。
-
azd upとConnectの後に表示される実行中のAPI管理SSEエンドポイントのURLを設定する: -
ツール一覧。ツールをクリックしてツールを実行。
技術アーキテクチャ概要
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
README
以下は原文 README の抜粋です。原文を見る。
Secure Remote MCP Servers using Azure API Management (Experimental)
Azure API Management acts as the AI Gateway for MCP servers.
This sample implements the latest MCP Authorization specification
This is a sequence diagram to understand the flow.
Deploy Remote MCP Server to Azure
-
Register
Microsoft.Appresource provider.- If you are using Azure CLI, run
az provider register --namespace Microsoft.App --wait. - If you are using Azure PowerShell, run
Register-AzResourceProvider -ProviderNamespace Microsoft.App. Then run(Get-AzResourceProvider -ProviderNamespace Microsoft.App).RegistrationStateafter some time to check if the registration is complete.
- If you are using Azure CLI, run
-
Run this azd command to provision the api management service, function app(with code) and all other required Azure resources
azd up
Test with MCP Inspector
-
In a new terminal window, install and run MCP Inspector
npx @modelcontextprotocol/inspector -
CTRL click to load the MCP Inspector web app from the URL displayed by the app (e.g. http://127.0.0.1:6274/#resources)
-
Set the transport type to
SSE -
Set the URL to your running API Management SSE endpoint displayed after
azd upand Connect:https://.azure-api.net/mcp/sse -
List Tools. Click on a tool and Run Tool.
Technical Architecture Overview
This solution deploys a secure MCP (Model Context Protocol) server infrastructure on Azure. The architecture implements a multi-layered security model with Azure API Management serving as an intelligent gateway that handles authentication, authorization, and request routing.
Deployed Azure Resources
The infrastructure provisions the following Azure resources:
Core Gateway Infrastructure
- Azure API Management (APIM) - The central security gateway that exposes both OAuth and MCP APIs
- SKU: BasicV2 (configurable)
- Identity: System-assigned and user-assigned managed identities
- Purpose: Handles authentication flows, request validation, and secure proxying to backend services
Backend Compute
- Azure Function App - Hosts the MCP server implementation
- Runtime: Python 3.11 on Flex Consumption plan
インストール
npx @modelcontextprotocol/inspector