Skip to content

Commit 6c8abd3

Browse files
committed
fix: remove unnecessary request_ctx contextvar from notification handlers
1 parent 8e1d947 commit 6c8abd3

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
@@ -530,11 +530,7 @@ async def _handle_notification(
530530
_task_support=task_support,
531531
),
532532
)
533-
token = request_ctx.set(ctx)
534-
try:
535-
await handler(ctx, getattr(notify, "params", None))
536-
finally:
537-
request_ctx.reset(token)
533+
await handler(ctx, getattr(notify, "params", None))
538534
except Exception: # pragma: no cover
539535
logger.exception("Uncaught exception in notification handler")
540536

0 commit comments

Comments
 (0)