We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce14d07 commit ddcf62eCopy full SHA for ddcf62e
README.md
@@ -443,9 +443,10 @@ from mcp.math import math
443
# Create a combined lifespan to manage both session managers
444
@contextlib.asynccontextmanager
445
async def lifespan(app: FastAPI):
446
- async with echo.mcp.session_manager.run():
447
- async with math.mcp.session_manager.run():
448
- yield
+ async with contextlib.AsyncExitStack() as stack:
+ await stack.enter_async_context(echo.mcp.session_manager.run())
+ await stack.enter_async_context(math.mcp.session_manager.run())
449
+ yield
450
451
452
app = FastAPI(lifespan=lifespan)
0 commit comments