Skip to content

Commit 2b9e8c7

Browse files
committed
fix: remove unnecessary request_ctx contextvar from notification handlers
1 parent 2a5ebec commit 2b9e8c7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/mcp/server/lowlevel/server.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,11 +528,7 @@ async def _handle_notification(
528528
_task_support=task_support,
529529
),
530530
)
531-
token = request_ctx.set(ctx)
532-
try:
533-
await handler(ctx, getattr(notify, "params", None))
534-
finally:
535-
request_ctx.reset(token)
531+
await handler(ctx, getattr(notify, "params", None))
536532
except Exception: # pragma: no cover
537533
logger.exception("Uncaught exception in notification handler")
538534

0 commit comments

Comments
 (0)