fix: refactor handle_sse to standard ASGI to avoid Starlette TypeError
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
All checks were successful
Build and Push Monarch MCP Docker Image / build (push) Successful in 8s
This commit is contained in:
@@ -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"]),
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user