AS

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

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

131 stars 79 forks Качество 69 Тренд 30MIT

azure-samples/remote-mcp-apim-functions-python — это кандидат MCP-сервера, импортированный из https://github.com/azure-samples/remote-mcp-apim-functions-python.

Обзор

azure-samples/remote-mcp-apim-functions-python — это кандидат MCP-сервера, импортированный из https://github.com/azure-samples/remote-mcp-apim-functions-python.

Обзор (машинный перевод)

Azure API Management выступает в роли AI-шлюза для MCP-серверов.

Этот образец реализует последнюю спецификацию авторизации MCP

Это диаграмма последовательностей для понимания потока.

Deploy Remote MCP Server to Azure

  1. Зарегистрировать поставщика ресурсов [[T0].
  • Если вы используете 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, чтобы загрузить веб-приложение MCP Inspector по URL, отображаемому приложением (например, http://127.0.0.1:6274/#resources)

  3. Установить тип транспорта на SSE

  4. Укажите URL на вашу текущую точку управления API SSE, отображаемую после azd up и Connect:

  5. Список инструментов. Кликни на инструмент и Запусти инструмент.

Обзор технической архитектуры

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

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
Открыть полный README на GitHub

Установка

npx @modelcontextprotocol/inspector
Новичок в MCP? Начните с руководства на mcpskill.org →