Skip to content

fix: pass related_request_id in report_progress for SSE streaming#2002

Open
hubbard-zlee wants to merge 1 commit intomodelcontextprotocol:mainfrom
hubbard-zlee:bugfix/progress-notification-missing-metadata
Open

fix: pass related_request_id in report_progress for SSE streaming#2002
hubbard-zlee wants to merge 1 commit intomodelcontextprotocol:mainfrom
hubbard-zlee:bugfix/progress-notification-missing-metadata

Conversation

@hubbard-zlee
Copy link

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, while Context.info() and other logging methods work correctly.

Root Cause

In src/mcp/server/fastmcp/server.py, the report_progress method does not pass related_request_id to send_progress_notification():

async def report_progress(self, progress: float, total: float | None = None, message: str | None = None) -> None:
    progress_token = self.request_context.meta.progressToken if self.request_context.meta else None

    if progress_token is None:
        return

    await self.request_context.session.send_progress_notification(
        progress_token=progress_token,
        progress=progress,
        total=total,
        message=message,
        # related_request_id is missing here
    )

The SSE transport uses related_request_id in the message metadata to route notifications to the correct client. Without it, progress notifications are silently dropped.

In contrast, send_log_message (used by info(), warning(), etc.) correctly passes related_request_id:

Fix

Add related_request_id=self.request_id to the send_progress_notification() call:

await self.request_context.session.send_progress_notification(
    progress_token=progress_token,
    progress=progress,
    total=total,
    message=message,
    related_request_id=self.request_id,
)

Reproduction

  1. Create a FastMCP server with stateless_http=True
  2. In a tool, call both await ctx.info("test") and await ctx.report_progress(0.5, total=1.0, message="test")
  3. Observe that info() messages are delivered via SSE but report_progress() messages are not

Environment

  • MCP SDK version: [your version]
  • Python version: [your version]
  • Transport: Streamable HTTP (stateless_http=True)

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.
@Kludex
Copy link
Member

Kludex commented Feb 6, 2026

@claude fix the test

@claude
Copy link

claude bot commented Feb 6, 2026

Claude Code is working…

I'll analyze this and get back to you.

View job run

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.

Progress notifications not delivered via SSE in stateless HTTP mode

2 participants