AS

azure-samples/remote-mcp-apim-functions-python

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

131 stars 79 forks 品質 69 トレンド 30MIT

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

  1. リソースプロバイダーを登録します。
  • Azure CLIを使用している場合は、az provider register --namespace Microsoft.App --waitを実行してください。
  • Azure PowerShellを使用している場合は、Register-AzResourceProvider -ProviderNamespace Microsoft.Appを実行してください。その後、登録が完了しているか確認するために(Get-AzResourceProvider -ProviderNamespace Microsoft.App).RegistrationStateを実行してください。
  1. このazdコマンドを実行して、API管理サービス、関数アプリ(コード付き)、その他必要なAzureリソースをプロビジョニングします

MCP検査官とのテスト

  1. 新しいターミナルウィンドウでMCP Inspectorをインストールして実行します

  2. CTRLキーで、アプリに表示されるURLからMCP Inspectorのウェブアプリを読み込みます(例:http://127.0.0.1:6274/#resources)

  3. 輸送タイプを[[T5]に設定します。

  4. azd upとConnectの後に表示される実行中のAPI管理SSEエンドポイントのURLを設定する:

  5. ツール一覧。ツールをクリックしてツールを実行。

技術アーキテクチャ概要

このページは 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

  1. Register Microsoft.App resource 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).RegistrationState after some time to check if the registration is complete.
  2. 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

  1. In a new terminal window, install and run MCP Inspector

    npx @modelcontextprotocol/inspector
    
  2. 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)

  3. Set the transport type to SSE

  4. Set the URL to your running API Management SSE endpoint displayed after azd up and Connect:

    https://.azure-api.net/mcp/sse
    
  5. 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
GitHub で README 全文を見る

インストール

npx @modelcontextprotocol/inspector
MCP 初心者?mcpskill.org のガイドから始めましょう →