Title: fix: pass related_request_id in report_progress for SSE streaming by hubbard-zlee · Pull Request #2002 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: fix: pass related_request_id in report_progress for SSE streaming by hubbard-zlee · Pull Request #2002 · modelcontextprotocol/python-sdk
X Title: fix: pass related_request_id in report_progress for SSE streaming by hubbard-zlee · Pull Request #2002 · modelcontextprotocol/python-sdk
Description: 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 Create a FastMCP server with stateless_http=True In a tool, call both await ctx.info("test") and await ctx.report_progress(0.5, total=1.0, message="test") 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)
Open Graph Description: 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....
X Description: 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....
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/pull/2002
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:aa64f883-77d9-5c44-25e8-a19075974b1c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9548:337C5B:5B8FB71:7E6FAD5:6A5E61BA |
| html-safe-nonce | 02d4151127dbb6f1b696a8642a2ff3f1143d8024943c5ecb9399ecbac856678c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NTQ4OjMzN0M1Qjo1QjhGQjcxOjdFNkZBRDU6NkE1RTYxQkEiLCJ2aXNpdG9yX2lkIjoiODU3OTk4MTk2NDg1Mzc5NzMwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 332570db9d920258d87d32bc2dbe4ee4c4055a95f06ec340a330d4976b6c5f68 |
| hovercard-subject-tag | pull_request:3251411302 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/modelcontextprotocol/python-sdk/pull/2002/files |
| twitter:image | https://avatars.githubusercontent.com/u/140850682?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/140850682?s=400&v=4 |
| og:image:alt | 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.... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5684292e6b02f9c72a31f9bc29d1fa47afbeda5424e76fb5f0b7c08766757177 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d151d247da13e8abadf6fd7f5a5f8659dae9a8d0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width