mcp-sdk-functions-hosting-python
Verified Safeby Azure-Samples
Overview
Host Python-based Model Context Protocol (MCP) servers on Azure Functions as custom handlers to enable serverless deployment of AI agent tools.
Installation
uv run func startEnvironment Variables
- OVERRIDE_USE_MI_FIC_ASSERTION_CLIENTID
- WEBSITE_AUTH_CLIENT_ID
- WEBSITE_AUTH_AAD_ALLOWED_TENANTS
- WEBSITE_HOSTNAME
Security Notes
The server uses standard libraries (httpx, azure.identity) for network requests and authentication. On-Behalf-Of (OBO) flow is implemented for secure token exchange with Microsoft Graph, relying on environment variables for sensitive configurations. No 'eval' or obvious malicious patterns found. The 'DefaultAuthorizationLevel' in host.json is 'anonymous', but the server logic implements its own authorization (Microsoft Entra ID integration) as part of the MCP specification, which is crucial for its secure operation.
Similar Servers
mcp-sdk-functions-hosting-node
A Node.js server for hosting serverless functions, likely within a Managed Cloud Platform (MCP) SDK context.
mcp-sdk-functions-hosting-dotnet
This project serves as a quickstart and SDK example for hosting serverless functions built with .NET within the Microsoft Connected Platform ecosystem, specifically demonstrating a weather service.
mcp-azure-devops-client-demo
This project serves as a Python client demonstration for interacting with Azure DevOps, showcasing API calls for project management, work item manipulation, or pipeline status.
mcp-server-weather
This server provides a tool to fetch current weather conditions for a specified geographic location using the Open-Meteo API.