Gate log notifications on the per-request log-level opt-in at 2026-07-28 (#3198)

This commit is contained in:
Max 2026-07-28 02:20:33 +01:00 • committed by GitHub
commit 89c5e700f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,9 +16,10 @@ def build_server() -> MCPServer:
try:
for i in range(1, steps + 1):
await ctx.report_progress(float(i), float(steps), f"step {i}/{steps}")
# No non-deprecated logging helper on Context yet, so send the raw
# notification. `related_request_id` keeps it on this request's response
# stream (matters over streamable HTTP).
# Protocol logging is deprecated (SEP-2577), so the raw notification
# keeps this warning-free. On 2026-07-28+ the client only receives it
# because it opts in with `log_level=`; `related_request_id` keeps it on
# this request's response stream (matters over streamable HTTP).
await ctx.request_context.session.send_notification(
types.LoggingMessageNotification(
params=types.LoggingMessageNotificationParams(