fix: pass related_request_id in report_progress for SSE streaming#2002
Open
hubbard-zlee wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
Conversation
Progress notifications were not being delivered to clients because related_request_id was not passed to send_progress_notification(), causing the SSE transport to drop the notification.
Member
|
@claude fix the test |
|
I'll analyze this and get back to you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #2001
Progress notifications were not being delivered to clients because related_request_id was not passed to send_progress_notification(), causing the SSE transport to drop the notification.
Summary
Context.report_progress()notifications are not delivered to clients when using the streamable HTTP transport, whileContext.info()and other logging methods work correctly.Root Cause
In
src/mcp/server/fastmcp/server.py, thereport_progressmethod does not passrelated_request_idtosend_progress_notification():The SSE transport uses
related_request_idin the message metadata to route notifications to the correct client. Without it, progress notifications are silently dropped.In contrast,
send_log_message(used byinfo(),warning(), etc.) correctly passesrelated_request_id:Fix
Add
related_request_id=self.request_idto thesend_progress_notification()call:Reproduction
stateless_http=Trueawait ctx.info("test")andawait ctx.report_progress(0.5, total=1.0, message="test")info()messages are delivered via SSE butreport_progress()messages are notEnvironment
stateless_http=True)