Skip to content

fix: pass related_request_id in Context.report_progress()#2207

Open
OiPunk wants to merge 1 commit intomodelcontextprotocol:v1.xfrom
OiPunk:codex/mcp-sdk-2001-progress-request-id
Open

fix: pass related_request_id in Context.report_progress()#2207
OiPunk wants to merge 1 commit intomodelcontextprotocol:v1.xfrom
OiPunk:codex/mcp-sdk-2001-progress-request-id

Conversation

@OiPunk
Copy link

@OiPunk OiPunk commented Mar 4, 2026

Summary

Context.report_progress() notifications were silently dropped in stateless HTTP / SSE transports because send_progress_notification() was called without the related_request_id parameter. The transport layer uses this field to route server-initiated notifications back to the correct client SSE stream; without it, progress notifications are discarded.

This adds related_request_id=self.request_id to the send_progress_notification() call inside Context.report_progress(), making it consistent with send_log_message() which already passes the field correctly.

Changes

  • src/mcp/server/fastmcp/server.py -- add related_request_id=self.request_id to the send_progress_notification() call in Context.report_progress()
  • tests/issues/test_176_progress_token.py -- update existing assertions to expect the new related_request_id kwarg
  • tests/issues/test_2001_progress_related_request_id.py -- add regression test that verifies related_request_id is forwarded

Closes #2001

Progress notifications sent via Context.report_progress() were silently
dropped in stateless HTTP / SSE transports because the call to
send_progress_notification() was missing the related_request_id parameter.
The SSE transport relies on this field to route notifications back to the
correct client stream.

Add related_request_id=self.request_id to the send_progress_notification()
call, consistent with how send_log_message() already passes it.

Reported-by: hubbard-zlee
Github-Issue: modelcontextprotocol#2001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant