Initial Checks
Description
Hello 👋
It seems like context.report_progress is not sending any notifications on streamable-http.
I checked and the reason is that related_request_id is not specified in the underlying function.
A fix that work on my side in the file src/mcp/server/fastmcp/server.py:
asyncdefreport_progress(self, progress: float, total: float|None=None, message: str|None=None) ->None:
# <---- non important code is skipped here --->awaitself.request_context.session.send_progress_notification(
progress_token=progress_token,
progress=progress,
total=total,
message=message,
# ADD this line to fix the issuerelated_request_id=self.request_id,
)
I created a PR to add that line.
Example Code
frommcp.server.fastmcpimportContext, FastMCPmcp=FastMCP("StatelessServer", stateless_http=True)
@mcp.tool()asyncdefexample(ctx: Context) ->str:
awaitctx.report_progress(0, None, "This does not work")
awaitctx.session.send_progress_notification(
ctx.request_context.meta.progressToken, 0, None, "But this works perfectly", ctx.request_id
)
return"Done"mcp.run(transport="streamable-http")Python & MCP Python SDK
mcp 1.9.4
Python 3.13.3
uv 0.7.13
Initial Checks
Description
Hello 👋
It seems like
context.report_progressis not sending any notifications on streamable-http.I checked and the reason is that
related_request_idis not specified in the underlying function.A fix that work on my side in the file
src/mcp/server/fastmcp/server.py:I created a PR to add that line.
Example Code
Python & MCP Python SDK