Blog Post

Microsoft Developer Community Blog
2 MIN READ

Learn how to build MCP servers with Python and Azure

Pamela_Fox's avatar
Pamela_Fox
Icon for Microsoft rankMicrosoft
Dec 19, 2025

We just concluded Python + MCP, a three-part livestream series where we:

  • Built MCP servers in Python using FastMCP
  • Deployed them into production on Azure (Container Apps and Functions)
  • Added authentication, including Microsoft Entra as the OAuth provider

All of the materials from our series are available for you to keep learning from, and linked below:

  • Video recordings of each stream
  • Powerpoint slides
  • Open-source code samples complete with Azure infrastructure and 1-command deployment

If you're an instructor, feel free to use the slides and code examples in your own classes. 
Spanish speaker? We've got you covered- check out the Spanish version of the series.

🙋🏽‍♂️Have follow up questions? Join our weekly office hours on Foundry Discord:

  • Tuesdays @ 11AM PT  → Python + AI
  • Thursdays @ 8:30 AM PT → All things MCP

Building MCP servers with FastMCP

YouTube video
📺 Watch YouTube recording

In the intro session of our Python + MCP series, we dive into the hottest technology of 2025: MCP (Model Context Protocol). This open protocol makes it easy to extend AI agents and chatbots with custom functionality, making them more powerful and flexible. We demonstrate how to use the Python FastMCP SDK to build an MCP server running locally. Then we consume that server from chatbots like GitHub Copilot in VS Code, using it's tools, resources, and prompts. Finally, we discover how easy it is to connect AI agent frameworks like Langchain and Microsoft agent-framework to the MCP server.

Deploying MCP servers to the cloud

YouTube video
📺 Watch YouTube recording

In our second session of the Python + MCP series, we deploy MCP servers to the cloud! We walk through the process of containerizing a FastMCP server with Docker and deploying to Azure Container Apps. Then we instrument the MCP server with OpenTelemetry and observe the tool calls using Azure Application Insights and Logfire. Finally, we explore private networking options for MCP servers, using virtual networks that restrict external access to internal MCP tools and agents.

Authentication for MCP servers

YouTube video
📺 Watch YouTube recording

In our third session of the Python + MCP series, we explore the best ways to build authentication layers on top of your MCP servers. We start off simple, with an API key to gate access, and demonstrate a key-restricted FastMCP server deployed to Azure Functions. Then we move on to OAuth-based authentication for MCP servers that provide user-specific data. We dive deep into MCP authentication, which is built on top of OAuth2 but with additional requirements like PRM and DCR/CIMD, which can make it difficult to implement fully. We demonstrate the full MCP auth flow in the open-souce identity provider KeyCloak, and show how to use an OAuth proxy pattern to implement MCP auth on top of Microsoft Entra.

Published Dec 19, 2025
Version 1.0
No CommentsBe the first to comment