Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP hosting on Azure Functions — companion code

Code samples for the blog post Hosting Remote MCP Servers on Azure Functions: GA vs. Preview Options.

Azure Functions supports three distinct ways to expose tools to AI agents. Each folder in this repo corresponds to one option.

Which option should you use?

Do you have an existing MCP SDK server?
├── Yes → Is it Streamable HTTP + stateless?
│         ├── Yes → option2-self-hosted-sdk
│         └── No  → option1-binding-extension (rewrite required)
└── No  → Do you need async, decoupled, fault-tolerant execution?
          ├── Yes → option3-queue-based
          └── No  → option1-binding-extension (default)

Production deadline this quarter? Avoid option2-self-hosted-sdk — it is in preview and configuration details change.

Options

Folder Option Status Verified
option1-binding-extension MCP binding extension GA ✓ say_hello tool called from GitHub Copilot agent mode
option2-self-hosted-sdk Self-hosted MCP SDK via FastMCP Preview ✓ get_weather returned 18.6°C for Amsterdam
option3-queue-based Queue-based tool GA ✓ Result message written to tool-results Service Bus queue

Known issues

option1-binding-extension — WorkerExtensions net6.0 build error

Microsoft.Azure.Functions.Worker.Sdk (all versions to 2.0.7) generates a WorkerExtensions.csproj hardcoded to net6.0. The MCP extension package requires net8.0, so a plain build fails with:

error NU1202: Package Microsoft.Azure.Functions.Extensions.Mcp is not compatible with net6.0

The workaround is already applied in this repo — extension bundle in host.json, PrivateAssets="all" on extension packages, and 1.0.0-preview.3 for the MCP package. See option1-binding-extension/README.md for the full explanation.

Tracked upstream: azure-functions-dotnet-worker #2924.

option2-self-hosted-sdk — Core Tools ARM64 Python detection bug

Core Tools 4.12.1 on Windows detects Python architecture from the OS rather than from registered Python installations. On machines that have ever had ARM64 Python installed, Core Tools keeps looking for an ARM64 worker even after uninstalling ARM64 Python and clearing all registry entries.

Workaround: Test in WSL2 (Ubuntu) where the Linux ARM64 worker is present and the detection bug does not apply. See option2-self-hosted-sdk/README.md for the full account.

option2-self-hosted-sdk — MCP SDK version pinning

Pin to mcp==1.9.0. Versions below 1.6.0 don't have mcp.server.streamable_http. Version 1.28.x has a different API. See option2-self-hosted-sdk/README.md for details.

Prerequisites

Series

This repo accompanies an ongoing series on AI and Azure Functions at sjwiggers.com.

About

Companion code for the Azure Functions AI blog series — MCP binding extension, self-hosted SDK, and queue-based tool patterns, all verified locally.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages