@@ -467,6 +467,7 @@ async def run_stdio_async(self) -> None:
467467 async def run_sse_async (self ) -> None :
468468 """Run the server using SSE transport."""
469469 import uvicorn
470+
470471 starlette_app = self .sse_app ()
471472
472473 config = uvicorn .Config (
@@ -481,33 +482,35 @@ async def run_sse_async(self) -> None:
481482 def _normalize_path (self , mount_path : str , endpoint : str ) -> str :
482483 """
483484 Combine mount path and endpoint to return a normalized path.
484-
485+
485486 Args:
486487 mount_path: The mount path (e.g. "/github" or "/")
487488 endpoint: The endpoint path (e.g. "/messages/")
488-
489+
489490 Returns:
490491 Normalized path (e.g. "/github/messages/")
491492 """
492493 # Special case: root path
493494 if mount_path == "/" :
494495 return endpoint
495-
496+
496497 # Remove trailing slash from mount path
497498 if mount_path .endswith ("/" ):
498499 mount_path = mount_path [:- 1 ]
499-
500+
500501 # Ensure endpoint starts with slash
501502 if not endpoint .startswith ("/" ):
502503 endpoint = "/" + endpoint
503-
504+
504505 # Combine paths
505506 return mount_path + endpoint
506-
507+
507508 def sse_app (self ) -> Starlette :
508509 """Return an instance of the SSE server app."""
509510 # Create normalized endpoint considering the mount path
510- normalized_endpoint = self ._normalize_path (self .settings .mount_path , self .settings .message_path )
511+ normalized_endpoint = self ._normalize_path (
512+ self .settings .mount_path , self .settings .message_path
513+ )
511514 sse = SseServerTransport (normalized_endpoint )
512515
513516 async def handle_sse (request : Request ) -> None :
0 commit comments