feat: Add support for specifying NotificationOptions
Add support for specifying NotificationOptions in FastMCP and lowlevel Server creation
Motivation and Context
Currently there is no straightforward way to specify FastMCP server notification capabilities. Some clients do not respect notifications if server does not disclose support in the initliazation phase. eg: "notifications/resources/list_changed"
How Has This Been Tested?
uv run pytest: Results (18.39s): 653 passed 2 skipped 1 xfailed
Breaking Changes
No
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ *] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Documentation update
Checklist
- [x ] I have read the MCP Documentation
- [ x] My code follows the repository's style guidelines
- [ x] New and existing tests pass locally
- [ x] I have added appropriate error handling
- [ x] I have added or updated documentation as needed
Additional context
Have updated notification snippet and snippet readme
uv run server notifications streamable-http
#1492 is adding the same feature and showing the need for this. @maxisbey
Hello @maxisbey , please let me know how to proceed with this feature PR. Thanks
@felixweinberger @maxisbey would really appreciate your thoughts on this. As of today (afaik) there is no clean way for FastMCP based servers to specify MCP capabilities like prompt / tools / resources listChanged notifications.