Back to Home
Azure-Samples icon

mcp-sdk-functions-hosting-python

Verified Safe

by 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

Run Command
uv run func start

Environment 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

Stats

Interest Score45
Security Score9
Cost ClassMedium
Avg Tokens500
Stars29
Forks10
Last Update2025-11-27

Tags

Azure FunctionsServerlessPythonMCP SDKAI Agents