@@ -828,7 +828,7 @@ async def sse_endpoint(request: Request) -> Response:
828828 def streamable_http_app (self ) -> Starlette :
829829 """Return an instance of the StreamableHTTP server app."""
830830 from starlette .middleware import Middleware
831- from starlette .routing import Mount
831+ from starlette .routing import Route
832832
833833 # Create session manager on first call (lazy initialization)
834834 if self ._session_manager is None :
@@ -845,7 +845,7 @@ async def handle_streamable_http(scope: Scope, receive: Receive, send: Send) ->
845845 await self .session_manager .handle_request (scope , receive , send )
846846
847847 # Create routes
848- routes : list [Route | Mount ] = []
848+ routes : list [Route ] = []
849849 middleware : list [Middleware ] = []
850850 required_scopes = []
851851
@@ -889,17 +889,19 @@ async def handle_streamable_http(scope: Scope, receive: Receive, send: Send) ->
889889 )
890890
891891 routes .append (
892- Mount (
892+ Route (
893893 self .settings .streamable_http_path ,
894- app = RequireAuthMiddleware (handle_streamable_http , required_scopes , resource_metadata_url ),
894+ endpoint = RequireAuthMiddleware (handle_streamable_http , required_scopes , resource_metadata_url ),
895+ methods = ["POST" , "GET" , "DELETE" ],
895896 )
896897 )
897898 else :
898899 # Auth is disabled, no wrapper needed
899900 routes .append (
900- Mount (
901+ Route (
901902 self .settings .streamable_http_path ,
902- app = handle_streamable_http ,
903+ endpoint = handle_streamable_http ,
904+ methods = ["POST" , "GET" , "DELETE" ],
903905 )
904906 )
905907
0 commit comments