fix for fastmcp v2.14.4

This commit is contained in:
Taylor Wilsdon
2026-01-28 12:55:27 -05:00
parent 2442736749
commit ca627c857f
5 changed files with 65 additions and 64 deletions

View File

@@ -384,6 +384,16 @@ def configure_server_for_http():
logger.info(
"OAuth 2.1 enabled using FastMCP GoogleProvider with protocol-level auth"
)
# Explicitly mount well-known routes from the OAuth provider
# These should be auto-mounted but we ensure they're available
try:
well_known_routes = provider.get_well_known_routes()
for route in well_known_routes:
logger.info(f"Mounting OAuth well-known route: {route.path}")
server.custom_route(route.path, methods=list(route.methods))(route.endpoint)
except Exception as e:
logger.warning(f"Could not mount well-known routes: {e}")
# Always set auth provider for token validation in middleware
set_auth_provider(provider)