Back to Home
ajafry icon

fastmcp-api-obo-demo

Verified Safe

by ajafry

Overview

A FastAPI backend demonstrating the Azure AD On-Behalf-Of (OBO) token exchange flow to securely call an internal FastMCP server with user context.

Installation

Run Command
python mcp_server.py

Environment Variables

  • AUTH_TENANT_ID
  • API_CLIENT_ID
  • API_SCOPES
  • API_SECRET
  • MCP_SCOPES
  • MCP_SERVER_URL
  • MCP_CLIENT_ID
  • MCP_SECRET

Security Notes

The application correctly uses environment variables for sensitive configuration (client IDs, secrets, tenant ID). Authentication via Azure AD (fastapi-azure-auth) and fine-grained authorization (AuthorizationMiddleware) are well-implemented. However, the FastAPI backend uses `CORSMiddleware` with `allow_origins=["*"]`, which is a significant security risk in production environments as it allows cross-origin requests from any domain.

Similar Servers

Stats

Interest Score0
Security Score7
Cost ClassLow
Stars0
Forks0
Last Update2025-11-20

Tags

Azure ADFastAPIToken ExchangeMicroservice