diff --git a/src/monarch_mcp_custom/server.py b/src/monarch_mcp_custom/server.py index 48d945e..edf134c 100644 --- a/src/monarch_mcp_custom/server.py +++ b/src/monarch_mcp_custom/server.py @@ -183,8 +183,8 @@ def create_app(): # Stream endpoint at /mcp, messages at /mcp/messages sse = SseServerTransport("/mcp/messages") - async def handle_sse(request): - async with sse.connect_sse(request.scope, request.receive, request._send) as ( + async def handle_sse(scope, receive, send): + async with sse.connect_sse(scope, receive, send) as ( read_stream, write_stream, ): @@ -196,7 +196,7 @@ def create_app(): routes = [ Route("/health", health_check, methods=["GET"]), - Route("/mcp", endpoint=handle_sse, methods=["GET"]), + Route("/mcp", endpoint=handle_sse), Route("/mcp/messages", endpoint=sse.handle_post_message, methods=["POST"]), ]