Azure Functions allows you remotely host servers built with the official MCP SDKs with no code changes. If you've already built a server with the TypeScript MCP SDK, use this scaffold to quickly host the server remotely. The scaffold contains the required Azure Function artifacts, as well as Bicep files for automatic infrastructure provisioning and server deployment. Bicep is a domain-specific language that uses declarative syntax to deploy Azure resources.
Follow instructions in the mcp-sdk-functions-hosting-node repo to leverage this scaffold for hosting remote MCP servers.
Note
The hosting capability is currently in early preview.
The repo has the following main components:
host.jsonlocal.settings.jsoninfradirectory containing Bicep files for resource provisioning and server deployment
This file is required by Azure Functions for deployment. It's used by the Azure Functions host to configure the right settings (through the configuration profile) for the MCP server to run. It also tells the host how to run the server and which port to listen to.
{
"version": "2.0",
"configurationProfile": "mcp-custom-handler",
"customHandler": {
"description": {
"defaultExecutablePath": "npm",
"arguments": ["run", "start"]
},
"http": {
"DefaultAuthorizationLevel": "anonymous"
},
"port": "<MCP server port>"
}
}We'll configure the server to use a built-in authentication and authorization feature, so we disable Azure Functions host-based authentication and allow anonymous access.
The built-in feature implements the requirements of the MCP authorization specification protocol, such as issuing 401 challenge and hosting the Protected Resource Metadata (PRM). When the feature is enabled, clients attempting to access the server would be redirected to identity providers like Microsoft Entra ID for authentication before connecting.
This file is required only if you want to run the server locally with Azure Functions Core Tools, which provides a local version of the Azure Functions host. It allows you to run your server locally as if it's run in the Azure Functions environment in the cloud.
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "node",
"AzureWebJobsFeatureFlags": "EnableMcpCustomHandlerPreview"
}
}All Bicep files are in the infra directory. The main.bicep file specifies the provisioning of various Azure resources and their settings and/or configuration. Other than the Azure Functions app and the hosting plan (Flex Consumption) where the server is deployed to, other resources such as Azure Storage account, Application Insights, Virtual Network, Entra app, etc. are created as well.