feat: Set notification options method to configure broadcasted notifications #1492
+150
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Method in FastMCP to configure which change notifications (prompts, resources, tools) the server advertises and broadcasts. Allows developers to selectively enable or disable server-side change notifications announced to clients.
Motivation and Context
Hopefully this change fulfills Issue #1126 with a higher level solution for better user interface.
How Has This Been Tested?
Unit tests added in
/tests/server/test_notification_options_propagation.py
.The tests confirm that:
set_notification_options()
correctly sets internal NotificationOptions.StreamableHTTPSessionManager
and underlying MCP server initialization.run_stdio_async()
to the low-level server'sInitializationOptions
.Breaking Changes
None. Existing FastMCP servers will continue to default to no notifications unless explicitly configured.
Types of changes
Checklist
Additional context
Documentation needs to be updated, I am unsure where to update because the
docs
directory is pretty empty. Maybe a new section in theREADME
?