feat: add message to ProgressNotification#435
feat: add message to ProgressNotification#435ihrpr merged 13 commits intomodelcontextprotocol:mainfrom
Conversation
ihrpr
left a comment
There was a problem hiding this comment.
Thank you for adding the support for the message in Progress Notifications!
Some comments:
- Having the message parameter on the progress() method (not the context manager) would be more intuitive
It would look like
async with progress(total=100) as p:
await p.progress(10, message="Loading configuration...")
await p.progress(30, message="Connecting to database...")
await p.progress(40, message="Fetching data...")
await p.progress(20, message="Processing results...")would be great cover ProgressContext with tests as well
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
Co-authored-by: ihrpr <inna.hrpr@gmail.com>
|
Thank you! Absolutely, that makes sense. I reviewed and committed your changes, and I'll add a test case for the ProgressContext as soon as possible. I also have the PR typecheck error fixed and can push that with the new test case. |
|
Added a test case for the progress context manager. Looks like the 3.11 check failed on |
ihrpr
left a comment
There was a problem hiding this comment.
thank you!
would be great to remove sleep in tests before merging
Added an optional message field to ProgressNotificationParams according to latest mcp spec.
Motivation and Context
Addressing #399 to add spec guidelines to sdk
How Has This Been Tested?
Added test_progress_notification to test messages bidirectionally. I'm hesitant that covers all angles so I'd like if someone could look over the test case a little more.
Breaking Changes
This did break test_176_progress_token, but it was over a schema check rather than implementation of the code (checking message=None since it's now an optional (default set to None) arg in fastmcp.server.report_progress().
Outside of test cases, no. Since the message field is optional, it shouldn't impact anything on release.
Types of changes
Checklist
Additional context
This is my first pull request to MCP (and honestly, to a codebase of this magnitude and quality). I’m incredibly excited to contribute, but also want to acknowledge that I might have missed some things. I’d really appreciate any extra scrutiny or tips reviewers can offer, especially around the test cases. Thanks in advance, and apologies if anything is off!