Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

context.report_progress not sending notifications on streamable-http#953

Copy link
Copy link
@abdhx

Description

@abdhx
Issue body actions

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:

async def report_progress(self, progress: float, total: float | None = None, message: str | None = None) -> None:

# <---- non important code is skipped here --->

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

    # ADD this line to fix the issue
    related_request_id=self.request_id,
)

I created a PR to add that line.

Example Code

from mcp.server.fastmcp import Context, FastMCP

mcp = FastMCP("StatelessServer", stateless_http=True)

@mcp.tool()
async def example(ctx: Context) -> str:
    await ctx.report_progress(0, None, "This does not work")
    await ctx.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
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Nice to haves, rare edge casesNice to haves, rare edge casesbugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.