Skip to content

Conversation

@aatchison
Copy link
Collaborator

Problem

The MCP server framework was registering a notification handler for "initialized" instead of the correct "notifications/initialized" method as defined in the MCP specification. This caused protocol compliance issues where clients sending the proper "notifications/initialized" notification would receive "No handler for notification" errors.

Solution

Updated the framework to use the correct method name "notifications/initialized" as specified in the MCP protocol.

Changes

  • server.go: Changed notification handler registration from "initialized" to "notifications/initialized"
  • server_test.go: Updated test to check for the correct method name

References

Testing

  • All existing tests pass
  • The change maintains backward compatibility for any custom handlers
  • Protocol compliance is now correct according to MCP specification

This fix resolves the "No handler for notification: notifications/initialized" error that users were experiencing when using MCP clients that correctly implement the protocol.

The MCP specification defines the initialized notification method as
'notifications/initialized', not just 'initialized'. This change fixes
the protocol compliance issue where clients sending the correct
'notifications/initialized' notification would get 'No handler for
notification' errors.

Changes:
- Updated server.go to register handler for 'notifications/initialized'
- Updated corresponding test to check for the correct method name

Fixes protocol compliance with MCP specification as defined in:
https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/types.ts
@aatchison aatchison marked this pull request as ready for review June 9, 2025 21:24
@aatchison aatchison merged commit aef94e5 into main Jun 9, 2025
14 checks passed
@aatchison aatchison deleted the fix-initialized-notification-method branch June 9, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants