-
Notifications
You must be signed in to change notification settings - Fork 1.4k
feat: add message to ProgressNotification #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add message to ProgressNotification #435
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
would be great to remove sleep in tests before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
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!