通过API管理将REST API公开为MCP服务器
此项目包含用于将模型上下文协议(MCP)网关应用程序部署到具有Azure容器注册表的Azure容器应用程序的二头肌模板和配置。然后通过APIM管理暴露MCP
建筑
该解决方案部署了:
- Azure容器注册表:容器映像的私有注册表
- Azure容器应用程序环境:使用日志分析的托管环境
- Weather REST API容器应用程序:REST API服务的可扩展容器
- MCP服务器容器应用程序:MCP服务器服务的可扩展容器
- API发布:将API和MCP服务器发布到API管理。
- 日志分析工作区:集中记录和监控
快速开始
先决条件
- Azure订阅
- Azure CLI或Azure开发者CLI(azd)
- Docker(用于构建镜像)
- .NET 9.0 SDK(用于本地开发)
PowerShell部署脚本
# Full deployment with build and publish
.\deploy.ps1 -ResourceGroupName "org-mcpgateway-dev-rg" -ApimName "org-mcp-poc-apim-dev" -ApimResourceGroupName "org-apim-rg" -ServiceNamePrefix "org-mcp-gateway" -Location "australiaeast"
# Infrastructure only (skip build and container updates)
.\deploy.ps1 -ResourceGroupName "org-mcpgateway-dev-rg" -ApimName "org-mcp-poc-apim-dev" -ApimResourceGroupName "org-apim-rg" -ServiceNamePrefix "org-mcp-gateway" -Location "australiaeast"
-SkipBuild
