HaoZhang615/Azure-MCP-Server-Accelerator
If you are the rightful owner of Azure-MCP-Server-Accelerator and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Azure Container App MCP Server Solution Accelerator provides a comprehensive setup for deploying a Model Context Protocol (MCP) server using Azure Container Apps, enabling efficient slogan creation and management.
Azure Container App MCP Server Solution Accelerator
Welcome to the Azure Container App MCP Server Solution Accelerator. This project provides a complete Model Context Protocol (MCP) server implementation with Azure Container Apps deployment using Azure Developer CLI (azd
).
๐ฏ What This Solution Provides
This solution accelerator creates a complete MCP server that:
- Implements a simple slogan creation tool:
Microsoft = {word}
- Runs as a containerized Python application
- Deploys to Azure Container Apps with full observability
- Uses Azure Developer CLI for one-command deployment
๐๏ธ Architecture
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ MCP Client โโโโโถโ Container App โโโโโถโ FastMCP Server โ
โ (Copilot/Tools) โ โ (Azure hosting) โ โ (Python Logic) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Azure Monitor โ
โ & App Insights โ
โโโโโโโโโโโโโโโโโโโโ
โ๏ธ Prerequisites
Before you begin, ensure you have:
- Visual Studio Code installed (link)
- Python 3.11+ installed
- Docker installed (link)
- Azure Developer CLI installed (link)
- Azure Subscription (with payment method added)
- GitHub account
๐ Quick Start
1. ๐ Login to Azure
azd auth login
2. ๐ฆ Deploy the Solution
azd up
That's it! You'll only be asked for:
- โ Environment name - A unique identifier for your deployment (e.g., "my-mcp-server")
- โ Azure region - Choose from available regions (e.g., "East US 2")
No other configuration needed! The azd up
command will:
- ๐๏ธ Provision all Azure resources automatically (Container Apps, Container Registry, Monitoring)
- ๐ณ Build and containerize your Python MCP server
- ๐ Deploy the container to Azure Container Apps
- ๐ Configure networking and monitoring
- ๐ Provide your server endpoint URL
3. โ Test Your Deployment
After deployment completes, you'll see output similar to:
โ
Your application was provisioned and deployed to Azure
๐ Container App Endpoint: https://slogan-mcp-python.kindwater-12345678.eastus.azurecontainerapps.io
Test the MCP endpoint:
curl https://your-app-url.azurecontainerapps.io/mcp
You should see: {"jsonrpc":"2.0","error":{"code":-32000,"message":"Not Acceptable: Client must accept text/event-stream"}}
This confirms your MCP server is running correctly!
๐ง Local Development
Run Locally
-
Install dependencies:
pip install -e .
-
Run the server:
python main.py
-
Test locally:
curl http://localhost:3000/mcp
๐ ๏ธ Using Your MCP Server
In Visual Studio Code with GitHub Copilot
- Press
Ctrl+Shift+P
(Windows/Linux) orCmd+Shift+P
(Mac) - Type
MCP
and selectMCP: Add Server...
- Select
HTTP (HTTP or Server-Sent Events)
- Enter your server URL:
https://your-app-url.azurecontainerapps.io/mcp
- Give it a name:
my-test-mcp-server
- Save to either Global or Workspace scoped settings
In Microsoft Copilot Studio
- Follow the MCP connector setup guide
- Use your deployed Azure Container App URL as the host
- Create an agent that uses the slogan creation tool
- Test the agent in Copilot Studio, example result below:
๐ Monitoring & Observability
Your deployment includes:
- Application Insights for telemetry and performance monitoring
- Log Analytics for centralized logging
- Azure Monitor dashboards
- Container Apps metrics for scaling insights
Access monitoring in the Azure Portal:
- Navigate to your Resource Group:
rg-{your-environment-name}
- Open Application Insights
- View Live Metrics, Performance, and Logs
๐ Security Features
This solution includes:
- Managed Identity for secure Azure resource access
- Container Registry with role-based access control
- Network isolation within Container Apps Environment
- HTTPS-only endpoints with built-in certificates
๐งน Cleanup
To remove all Azure resources:
azd down
Confirm with y
when prompted. This will delete:
- Container Apps and Environment
- Container Registry
- Monitoring resources
- Resource Group
๐๏ธ Project Structure
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
๐๏ธ Customization
Adding New MCP Tools
Edit main.py
to add more tools:
@mcp.tool()
def another_tool(input: str) -> str:
"""Description of your new tool."""
"""function logic here"""
return f"new logic that uses {input}"
Scaling Configuration
Modify infra/resources.bicep
to adjust scaling:
scaleMinReplicas: 1 # Minimum instances
scaleMaxReplicas: 10 # Maximum instances
๐ฎ Outlook for Scaling
Enterprise-Grade MCP Server Management with Azure API Management
As your MCP server ecosystem grows, this solution accelerator provides a foundation for enterprise-scale deployment and management through integration with Azure API Management (APIM) and Azure API Center.
Preview MCP Center โ explore an Azure API Management powered directory for centralized MCP server discovery and governance.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 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 โ โ
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Scaling Benefits
๐ GenAI Gateway Benefits
- Unified Entry Point: Single endpoint for all MCP servers with intelligent routing
- Rate Limiting: Protect individual MCP servers from overload
- Authentication & Authorization: Centralized security with Azure AD integration
- Caching: Improve response times for frequently requested MCP operations
- Transformation: Standardize request/response formats across different MCP implementations
๐ Central Management through Azure API Center
- API Discovery: Catalog all MCP servers with searchable metadata and capabilities
- Governance: Enforce consistent naming, versioning, and documentation standards
- Compliance: Track API usage, monitor SLA compliance, and generate audit reports
- Developer Experience: Self-service portal for teams to discover and consume MCP servers
Implementation Roadmap
Phase 1: API Management Integration
// 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
}
}
Phase 2: Azure API Center Integration
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
}
}
Phase 3: Multi-Server Deployment Pattern
# 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
Advanced Scaling Features
๐ Auto-Discovery & Registration
- Implement MCP server auto-registration with API Center upon deployment
- Use Azure Event Grid to trigger catalog updates when new servers are deployed
- Automated OpenAPI specification generation from MCP tool definitions
๐ Intelligent Load Balancing
- Route requests based on MCP tool capabilities and current server load
- Implement circuit breaker patterns for resilient MCP server communication
- Geographic distribution of MCP servers with APIM regions
๐ Enterprise Security & Governance
- OAuth 2.0 / Entra ID integration for MCP client authentication
- Role-based access control (RBAC) for different MCP tool categories
- API versioning strategies for backwards compatibility
- Audit logging and compliance reporting
๐ Observability & Analytics
- Consolidated monitoring across all MCP servers through Application Insights
- Custom dashboards showing MCP tool usage patterns and performance metrics
- Proactive alerting for MCP server health and capacity planning
This foundation enables you to build a robust, enterprise-ready MCP server ecosystem that can scale to hundreds of specialized AI tools while maintaining governance, security, and observability.
๐ค Contributing
This solution accelerator welcomes contributions and suggestions. To contribute:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
๐ Support
For issues and questions:
- Check the troubleshooting section below
- Review Azure Container Apps documentation
- Open an issue in this repository
๐ง Troubleshooting
Common Issues
Deployment fails with authentication error:
azd auth login
azd up
Container fails to start:
- Check logs in Azure Portal: Container Apps โ Monitoring โ Log Stream
Local development issues:
# Reinstall dependencies
pip install --force-reinstall -e .
# Check Python version
python --version # Should be 3.11+
๐ Learn More
- Model Context Protocol Documentation
- Azure Container Apps Documentation
- Azure Developer CLI Documentation
- FastMCP Documentation
๐ License
This project is licensed under the MIT License - see the file for details.
Built with โค๏ธ for the Azure community