Skip to content

Conversation

hashemix
Copy link
Member

@hashemix hashemix commented Sep 1, 2025

📌 Summary

This PR refactors the signature of handler functions in ServerHandler and ServerHandlerCore to accept an Arc instead of a &dyn McpServer.
This PR also refactors the start function in server_runtime.rs to prevent the stream loop from being blocked by handle_message calls.

✨ Changes Made

  • Updated handler functions to accept an Arc<dyn McpServer> instead of a &dyn McpServer
  • Removed on_server_started in favor of on_initialized
  • Unblock Stream Loop in start Function with Task Spawning

⚠ BREAKING CHANGE:

  • Any implementations or overrides of the ServerHandler and ServerHandlerCore functions must update their signatures to accept Arc<dyn McpServer> instead of &dyn McpServer
  • on_initialized() should be used instead of on_server_started()

@hashemix hashemix changed the title feat!: update server handler trait feat!: improved ServerHandler and ServerHandlerCore traits Sep 1, 2025
@hashemix hashemix changed the title feat!: improved ServerHandler and ServerHandlerCore traits feat!: update ServerHandler and ServerHandlerCore traits Sep 1, 2025
@hashemix hashemix merged commit a2d6d23 into main Sep 17, 2025
3 checks passed
@hashemix hashemix mentioned this pull request Sep 17, 2025
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.

1 participant