@@ -737,7 +737,6 @@ def sse_app(self, mount_path: str | None = None) -> Starlette:
737737
738738 async def handle_sse (request : Request ) -> Response :
739739 """Handle SSE connection using Starlette's EventSourceResponse."""
740- # Create a custom Response class that wraps the SSE connection
741740 class SSEConnectionResponse (Response ):
742741 def __init__ (self , sse_transport : SseServerTransport , server : MCPServer ) -> None :
743742 super ().__init__ ()
@@ -791,7 +790,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
791790 )
792791 )
793792
794- # Create auth wrapper if needed
793+ # When auth is configured, require authentication
795794 if self ._token_verifier :
796795 # Determine resource metadata URL
797796 resource_metadata_url = None
@@ -802,7 +801,7 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
802801 str (self .settings .auth .resource_server_url ).rstrip ("/" ) + "/.well-known/oauth-protected-resource"
803802 )
804803
805- # # Auth is enabled, wrap the endpoints with RequireAuthMiddleware
804+ # Auth is enabled, wrap the endpoints with RequireAuthMiddleware
806805 async def handle_sse_auth (scope : Scope , receive : Receive , send : Send ) -> None :
807806 request = Request (scope , receive )
808807 response = await handle_sse (request )
0 commit comments