Open
Description
Describe the bug
mcp everything sends notification type which cannot be handled by message handler. It passes a notification/stderr which does not belong to the allwoed types in MessageHandlerFn, therefore this results in a pydantic type checking error. I am not sure whether this is a bug in the pythonsdk or in the everything server.
To Reproduce
Steps to reproduce the behavior:
- Try to read notifcations from mcp_everything with a Message Handler.
Expected behavior
Either notification/stderr type should be added to possible inputs of MessageHandlerFn type or everything server should be updated to not send incorrect notifications.
Logs
Notification Handler received: notifications/message - root=LoggingMessageNotification(method='notifications/message', params=LoggingMessageNotificationParams(meta=None, level='error', logger=None, data='Error-level message'), jsonrpc='2.0')
-------------------------------------
WARNING:root:Failed to validate notification: 13 validation errors for ServerNotification
CancelledNotification.method
Input should be 'notifications/cancelled' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
CancelledNotification.params.requestId
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
ProgressNotification.method
Input should be 'notifications/progress' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ProgressNotification.params.progressToken
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
ProgressNotification.params.progress
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
LoggingMessageNotification.method
Input should be 'notifications/message' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
LoggingMessageNotification.params.level
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
LoggingMessageNotification.params.data
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
ResourceUpdatedNotification.method
Input should be 'notifications/resources/updated' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ResourceUpdatedNotification.params.uri
Field required [type=missing, input_value={'content': '03:37:46 PM: A stderr message'}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.11/v/missing
ResourceListChangedNotification.method
Input should be 'notifications/resources/list_changed' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
ToolListChangedNotification.method
Input should be 'notifications/tools/list_changed' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error
PromptListChangedNotification.method
Input should be 'notifications/prompts/list_changed' [type=literal_error, input_value='notifications/stderr', input_type=str]
For further information visit https://errors.pydantic.dev/2.11/v/literal_error. Message was: method='notifications/stderr' params={'content': '03:37:46 PM: A stderr message'} jsonrpc='2.0'