Token导航 LogoToken导航TokenDH.com
Azure MCP Server Accelerator logo
运维云端stdio官方级别未说明来源级核验

Azure MCP Server Accelerator

MCP Server

基于Azure Container Apps的Model Context Protocol服务器解决方案,提供容器化部署、监控及扩展功能,适用于AI工具集成和企业级MCP服务器管理。

工具数

1

提示词数

0

GitHub Stars

2

资源数

0
Bicep容器化部署云端部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

HaoZhang615

提供方

HaoZhang615

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -e .

详细介绍

Azure容器应用程序MCP服务器解决方案加速器

欢迎来到 Azure容器应用程序MCP服务器解决方案加速器。此项目使用Azure Developer CLI提供完整的模型上下文协议(MCP)服务器实现和Azure容器应用程序部署(azd).

🎯 此解决方案提供什么

该解决方案加速器创建了一个完整的MCP服务器,该服务器:

  • 实现一个简单的标语创建工具: Microsoft = {word}
  • 作为容器化Python应用程序运行
  • 部署到具有完全可观察性的Azure容器应用程序
  • 使用Azure Developer CLI进行一次命令部署

🏗️ 建筑

┌─────────────────┐    ┌──────────────────┐    ┌─────────────────┐
│   MCP Client    │───▶│  Container App   │───▶│  FastMCP Server │
│ (Copilot/Tools) │    │ (Azure hosting)  │    │ (Python Logic)  │
└─────────────────┘    └──────────────────┘    └─────────────────┘
                              │
                              ▼
                       ┌──────────────────┐
                       │ Azure Monitor    │
                       │ & App Insights   │
                       └──────────────────┘

⚙️ 先决条件

在开始之前,请确保您已经:

  • Visual Studio Code 已安装(链接)
  • Python 3.11+ 安装
  • 码头工人 已安装(链接)
  • Azure开发者命令行界面 已安装(链接)
  • Azure订阅 (已添加付款方式)
  • GitHub账号

🚀 快速开始

1.🔐 登录Azure

azd auth login

2.📦 部署解决方案

azd up

就是这样! 您只会被要求:

  • 环境名称 -部署的唯一标识符(例如“我的mcp服务器”)
  • Azure区域 -从可用区域中选择(例如,“美国东部2”)

无需其他配置!这 azd up 命令将:

  1. 🏗️ 自动配置所有Azure资源(容器应用程序、容器注册表、监控)
  2. 🐳 构建并容器化您的Python MCP服务器
  3. 🚀 将容器部署到Azure容器应用程序
  4. 📊 配置网络和监控
  5. 🔗 提供您的服务器端点URL

3.✅ 测试您的部署

部署完成后,您将看到类似于以下内容的输出:

✅ Your application was provisioned and deployed to Azure
🔗 Container App Endpoint: https://slogan-mcp-python.kindwater-12345678.eastus.azurecontainerapps.io

测试MCP端点:

curl https://your-app-url.azurecontainerapps.io/mcp

您应该看到: {"jsonrpc":"2.0","error":{"code":-32000,"message":"Not Acceptable: Client must accept text/event-stream"}}

这确认您的MCP服务器运行正常!

🔧 地方发展

在本地运行

  1. 安装依赖项:
   pip install -e .
  1. 运行服务器:
   python main.py
  1. 本地测试:
   curl http://localhost:3000/mcp

🛠️ 使用您的MCP服务器

使用GitHub Copilot编写Visual Studio代码

  1. Ctrl+Shift+P (Windows/Linux)或 Cmd+Shift+P (Mac)
  2. 类型 MCP 并选择 MCP: Add Server...
  3. 选择 HTTP (HTTP or Server-Sent Events)
  4. 请输入您的服务器URL: https://your-app-url.azurecontainerapps.io/mcp
  5. 给它起个名字: my-test-mcp-server
  6. 保存到全局或工作区范围的设置

在Microsoft Copilot Studio中

  1. 跟随 MCP连接器设置指南
  2. 将部署的Azure容器应用程序URL用作主机
  3. 创建一个使用标语创建工具的代理
  4. 在Copilot Studio中测试代理,示例结果如下:

Copilot Studio Slogan Example

📊 监测和可观察性

您的部署包括:

  • 应用洞察 用于遥测和性能监测
  • 日志分析 用于集中记录
  • Azure监视器 仪表盘
  • 容器应用程序指标 用于扩展洞察力

Azure门户中的访问监控:

  1. 导航到您的资源组: rg-{your-environment-name}
  2. 开放式应用洞察
  3. 查看实时指标、性能和日志

🔒 安全功能

该解决方案包括:

  • 管理身份 用于安全的Azure资源访问
  • 集装箱登记处 基于角色的访问控制
  • 网络隔离 容器应用程序环境内
  • 仅限HTTPS 具有内置证书的端点

🧹 清理

要删除所有Azure资源,请执行以下操作:

azd down

与……确认 y 当提示时。这将删除:

  • 容器应用程序和环境
  • 集装箱登记处
  • 监控资源
  • 资源组

🏗️ 项目结构

mcp-aca/
├── main.py                 # MCP server implementation
├── pyproject.toml          # Python dependencies
├── Dockerfile             # Container configuration
├── azure.yaml             # Azure Developer CLI config
├── infra/                 # Infrastructure as Code
│   ├── main.bicep         # Main Bicep template
│   ├── resources.bicep    # Resource definitions
│   ├── abbreviations.json # Azure naming conventions
│   └── modules/
│       └── fetch-container-image.bicep
└── README.md              # This file

🎛️ 定制

添加新的MCP工具

编辑 main.py 添加更多工具:

@mcp.tool()
def another_tool(input: str) -> str:
    """Description of your new tool."""
    """function logic here"""
    return f"new logic that uses {input}"

缩放配置

修改 infra/resources.bicep 调整缩放比例:

scaleMinReplicas: 1    # Minimum instances
scaleMaxReplicas: 10   # Maximum instances

🔮 扩展前景

企业级MCP服务器管理与Azure API管理

随着您的MCP服务器生态系统的发展,此解决方案加速器通过与 Azure API管理(APIM)Azure API中心.

预览MCP中心 –探索Azure API管理支持的目录,用于集中的MCP服务器发现和治理。

┌─────────────────────────────────────────────────────────────────┐
│                    Azure API Management                        │
│  ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐   │
│  │   MCP Server    │ │   MCP Server    │ │   MCP Server    │   │
│  │   (Finance)     │ │   (Analytics)   │ │   (Content)     │   │
│  └─────────────────┘ └─────────────────┘ └─────────────────┘   │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│                     Azure API Center                           │
│  • Centralized API Discovery    • Policy Management            │
│  • Governance & Compliance      • Analytics & Monitoring       │
│  • Developer Portal             • Version Control              │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
┌─────────────────────────────────────────────────────────────────┐
│              Client Applications & AI Agents                   │
│  ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
│  │ Copilot     │ │ Custom      │ │ Power       │ │ Third     │ │
│  │ Studio      │ │ AI Agents   │ │ Platform    │ │ Party     │ │
│  └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
└─────────────────────────────────────────────────────────────────┘

关键的扩展优势

🌐 GenAI网关优势

  • 统一入口点:所有具有智能路由的MCP服务器的单一端点
  • 速率限制:保护单个MCP服务器免受过载
  • 身份验证和授权:通过Azure AD集成实现集中安全
  • 缓存:改善频繁请求的MCP操作的响应时间
  • 转变:跨不同MCP实现标准化请求/响应格式

📊 通过Azure API中心进行集中管理

  • API发现:使用可搜索的元数据和功能对所有MCP服务器进行编目
  • 治理:强制实施一致的命名、版本控制和文档标准
  • 合规:跟踪API使用情况,监控SLA合规性,并生成审核报告
  • 开发者体验:团队发现和使用MCP服务器的自助服务门户

实施路线图

第一阶段:API管理集成

// Add to infra/resources.bicep
resource apiManagement 'Microsoft.ApiManagement/service@2023-05-01-preview' = {
  name: '${abbreviations.apiManagementService}${resourceToken}'
  location: location
  sku: {
    name: 'Developer'  // Scale to Standard/Premium for production
    capacity: 1
  }
  properties: {
    publisherEmail: 'admin@company.com'
    publisherName: 'MCP Server Team'
  }
}

// MCP Server API Configuration
resource mcpApi 'Microsoft.ApiManagement/service/apis@2023-05-01-preview' = {
  parent: apiManagement
  name: 'mcp-servers'
  properties: {
    displayName: 'MCP Server Collection'
    path: 'mcp'
    protocols: ['https']
    serviceUrl: containerApp.properties.configuration.ingress.fqdn
  }
}

第2阶段:Azure API中心集成

resource apiCenter 'Microsoft.ApiCenter/services@2024-03-01' = {
  name: '${abbreviations.apiCenter}${resourceToken}'
  location: location
  properties: {
    // Centralized catalog for all MCP servers
  }
}

// Register MCP APIs in API Center
resource mcpApiRegistration 'Microsoft.ApiCenter/services/workspaces/apis@2024-03-01' = {
  parent: apiCenter
  name: 'mcp-slogan-server'
  properties: {
    title: 'Slogan Generation MCP Server'
    kind: 'rest'
    description: 'Model Context Protocol server for generating Microsoft-themed slogans'
    // Link to APIM backend
  }
}

阶段3:多服务器部署模式

# azure.yaml extension for multiple MCP servers
services:
  mcp-finance:
    project: ./servers/finance
    host: containerapp
    
  mcp-analytics:
    project: ./servers/analytics  
    host: containerapp
    
  mcp-content:
    project: ./servers/content
    host: containerapp

hooks:
  postdeploy:
    # Register all servers with API Center
    shell: |
      az apic api import --api-center-name $AZURE_API_CENTER_NAME \
        --workspace-name default \
        --api-id mcp-finance \
        --specification @servers/finance/openapi.json

高级缩放功能

🔄 自动发现和注册

  • 在部署时实现MCP服务器与API中心的自动注册
  • 部署新服务器时,使用Azure事件网格触发目录更新
  • 从MCP工具定义自动生成OpenAPI规范

📈 智能负载平衡

  • 根据MCP工具功能和当前服务器负载路由请求
  • 为弹性MCP服务器通信实施断路器模式
  • 带APIM区域的MCP服务器的地理分布

🔐 企业安全与治理

  • OAuth 2.0/Entra ID集成用于MCP客户端身份验证
  • 不同MCP工具类别的基于角色的访问控制(RBAC)
  • 用于向后兼容性的API版本控制策略
  • 审计日志和合规性报告

📊 可观察性和分析

  • 通过Application Insights对所有MCP服务器进行整合监控
  • 显示MCP工具使用模式和性能指标的自定义仪表板
  • MCP服务器运行状况和容量规划的主动警报

这个基础使您能够构建一个强大的、企业就绪的MCP服务器生态系统,该生态系统可以扩展到数百个专门的AI工具,同时保持治理、安全性和可观察性。

🤝 贡献

这个解决方案加速器欢迎贡献和建议。贡献:

  1. 分叉存储库
  2. 创建要素分支
  3. 进行更改
  4. 提交拉取请求

📞 支持

对于问题和疑问:

  1. 检查 故障排除部分 在......下面
  2. 查看Azure容器应用文档
  3. 在此存储库中打开问题

🔧 故障排除

常见问题

部署失败,出现身份验证错误:

azd auth login
azd up

容器无法启动:

  • 检查Azure门户中的日志:容器应用→ 监控→ 日志流

地方发展问题:

# Reinstall dependencies
pip install --force-reinstall -e .

# Check Python version
python --version  # Should be 3.11+

📚 了解更多

📝 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

内置于❤️ Azure社区

目录标签

目录标签

Bicep容器化部署云端部署本地部署AI工具集成企业级扩展Azure服务Python应用

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

oauth

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiooauth部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP