From 2b7712df86e007197a18f05ff302a6b425b77088 Mon Sep 17 00:00:00 2001 From: zzstoatzz Date: Tue, 20 May 2025 13:53:40 -0500 Subject: [PATCH] take suggestion --- src/fastmcp/server/http.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fastmcp/server/http.py b/src/fastmcp/server/http.py index 18c78be76..2a9cced00 100644 --- a/src/fastmcp/server/http.py +++ b/src/fastmcp/server/http.py @@ -309,7 +309,10 @@ def create_streamable_http_app( try: await session_manager.handle_request(scope, receive, send) except RuntimeError as e: - if "Task group is not initialized" in str(e): + if str(e) == "Task group is not initialized. Make sure to use run().": + logger.error( + f"Original RuntimeError from mcp library: {e}", exc_info=True + ) new_error_message = ( "FastMCP's StreamableHTTPSessionManager task group was not initialized. " "This commonly occurs when the FastMCP application's lifespan is not "