IBM's Azure Foundry Enterprise Kit

MCP Server Hosting

Value: Production-ready hosting templates for custom MCP servers on Azure Functions and Container Apps — with dual-auth, VNet isolation, health probes, and OTel observability pre-configured. Deploy a governed MCP server in minutes instead of weeks.

Overview

The Enterprise Kit provides two hosting patterns for deploying custom MCP servers into your Azure environment. Both include Bicep infrastructure modules, application scaffolding, and automatic integration with the Foundry Toolbox ecosystem. Once deployed, servers are registered in the Private Tool Catalog (API Center) and become available to agents through the Toolbox consumer endpoint.

Hosting Patterns

PatternPlatformBest ForKey Features
Azure FunctionsFlex ConsumptionEvent-driven, lightweight toolsFastMCP + SSE transport, @register_tool decorator, function key + Entra dual-auth, auto-scale to zero
Container AppsAzure Container AppsStateful, VNet-isolated workloadsFastAPI + JSON-RPC 2.0 + SSE, sidecar pattern, VNet internal-only ingress, liveness/readiness probes, OTel to App Insights

Infrastructure (Bicep Modules)

Three Bicep modules support MCP hosting:

ModulePathResources Provisioned
function-mcp.bicepadapters/hosting/azure-functions/infra/Function App (Flex Consumption), Storage Account, App Insights, User-Assigned Managed Identity
container-app-mcp.bicepadapters/hosting/container-apps/infra/Container App, ACR, Container Apps Environment, Managed Identity, App Insights
api-center.bicepinfra/bicep/modules/Azure API Center — Private Tool Catalog for MCP server discovery, RBAC, metadata schema

Authentication (5 Foundry Methods)

The MCPAuthProvider in sdk-starters/python/mcp_auth_provider.py implements all five Foundry MCP authentication methods with automatic token caching (5-minute buffer) and Key Vault credential rotation:

MethodUse CaseEnvironment
Key-BasedAPI key / PAT stored in Foundry project connectionDev only
Entra Agent IdentityPer-agent scoped token with auto-requestAll
Entra Project Managed IdentityShared MI across all agents in project (recommended default)All (recommended)
OAuth Identity PassthroughDelegated user consent with retry flowAll
UnauthenticatedPublic or VNet-isolated servers onlyDev only

Production environments restrict auth to entra_project_mi and entra_agent_identity only (ZT-15).

Endpoint Resolution

The ToolboxEndpointResolver handles consumer vs. developer endpoint resolution with version pinning and APIM gateway URL rewriting:

Endpoint TypeURL PatternUse Case
Consumer{endpoint}/toolboxes/{name}/mcp?api-version=v1Production agents (uses default version)
Developer{endpoint}/toolboxes/{name}/versions/{ver}/mcp?api-version=v1CI/CD testing with version pinning

Deployment Workflow

  1. Write tools — Use the @register_tool decorator in either template
  2. Deploy infrastructure — Run the appropriate Bicep module (Functions for lightweight, Container Apps for stateful/VNet-isolated)
  3. Register in catalog — Run scripts/register-mcp-servers.py to register in the Private Tool Catalog (API Center)
  4. Wire to Toolbox — Configure in the agent's toolbox YAML with auth method and allowed tools
  5. Verify — Auth is auto-resolved by MCPAuthProvider based on connection config

Security Controls

MCP hosting is governed by ZT-15 (MCP Security):

  • Transport: TLS 1.2+, VNet internal-only ingress, no CORS, POST-only (JSON-RPC 2.0), 1MB request limit
  • Gateway (APIM): IP filtering (RFC 1918 only), rate limiting (60 RPM per tool, 200 RPM per agent), header sanitization, circuit breaker (5 consecutive failures)
  • Authentication: Production restricted to Entra-based methods only
  • Monitoring: OTel spans to App Insights, KQL fleet dashboard queries

Project Structure

PathPurpose
adapters/hosting/azure-functions/Azure Functions MCP server template + Bicep
adapters/hosting/container-apps/Container Apps MCP server template + Dockerfile + Bicep
infra/bicep/modules/api-center.bicepPrivate Tool Catalog (API Center) module
sdk-starters/python/mcp_auth_provider.pyUnified MCP auth abstraction (5 methods)
sdk-starters/python/toolbox_endpoint_resolver.pyConsumer vs. developer endpoint resolution
scripts/register-mcp-servers.pyCatalog registration script

Next Steps