
azure-samples/remote-mcp-apim-functions-python
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
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
- Зарегистрировать поставщика ресурсов [[T0].
- Если вы используете 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, чтобы загрузить веб-приложение MCP Inspector по URL, отображаемому приложением (например, http://127.0.0.1:6274/#resources)
-
Установить тип транспорта на
SSE -
Укажите URL на вашу текущую точку управления API SSE, отображаемую после
azd upи Connect: -
Список инструментов. Кликни на инструмент и Запусти инструмент.
Обзор технической архитектуры
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
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