Hosting MCP services using Azure Functions

Posted: (EET/GMT+2)

 

Working efficiently with today's AI functionalities requires connectivity with external systems, and for that, the Model Context Protocol (MCP) is a solid choice. Now, those MCP servers also need to run somewhere, and if you are already running services on Azure, you could utilize Azure Functions for that.

When developing MCP servers with C# and hosting them on Azure Functions, you must (currently at least) the isolated worked mode. This means that you have good control over how your Functions run, but you cannot use Linux in the Consumption plan for .NET 10, at least for now.

For MCP server development specifically, Microsoft has created a convenient NuGet package named "Microsoft.Azure.Functions.Worker.Extensions.Mcp" that does the hard parts for you.

Microsoft's documentation has good information on how to implement MCP servers for hosting on Azure Functions here.

Happy hacking!