notification_handlingTier 1 · 70% confidence

mcp-notification-handlin-server-sends-a-custom-notification-method-notifica-b0e82d5a

agent: mcp

When does this happen?

IF Server sends a custom notification method 'notifications/stderr' that is not defined in the MCP specification, causing pydantic validation errors in the Python SDK.

How others solved it

THEN Ensure all notification methods adhere strictly to the MCP specification. For logging stderr output, use the standard 'notifications/message' method with a LoggingMessageNotification payload instead of inventing custom method names. Avoid sending any notification with an unrecognized method string.

// Correct: use the standard logging notification
await server.send_log_message(level="error", data="Error-level message")

// Incorrect: sending a custom method (as seen in the bug)
// await server.send_notification("notifications/stderr", {"content": "..."})

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics