Back to MCP directory
publicPublicdnsLocal runtime

Azure API Management Gateway with Entra ID Authentication

使用Azure API Management作为AI网关,通过Azure Functions实现远程MCP服务器的安全访问,遵循最新的MCP授权规范。

article

README

🚀 使用 Azure API Management 实现远程 MCP 服务器(实验性)

本项目借助 Azure API Management 作为 AI 网关 为 MCP 服务器提供服务,实现了最新的 MCP 授权规范,并提供了 序列图 辅助理解流程。

流程图

🚀 快速开始

📦 安装指南

将远程 MCP 服务器部署到 Azure

  1. 注册 Microsoft.App 资源提供程序:
    • 若使用 Azure CLI,运行命令 az provider register --namespace Microsoft.App --wait
    • 若使用 Azure PowerShell,先运行 Register-AzResourceProvider -ProviderNamespace Microsoft.App,再运行 (Get-AzResourceProvider -ProviderNamespace Microsoft.App).RegistrationState 检查注册是否完成。
  2. 运行以下 azd 命令,配置 api 管理服务、函数应用(含代码)以及其他所有所需的 Azure 资源:
azd up

MCP 检查工具

  1. 在新的终端窗口中,安装并运行 MCP 检查工具:
npx @modelcontextprotocol/inspector
  1. 按下 CTRL 键并单击命令行输出的 URL 以加载 MCP 检查工具(例如 http://127.0.0.1:6274/#resources)。
  2. 设置传输类型为 SSE
  3. 将 URL 设置为正在运行的 API 管理 SSE 终端点,并连接:
https://<apim-servicename-from-azd-output>.azure-api.net/mcp/sse
  1. 列出工具,点击一个工具并运行工具
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client