Skip to content

Conversation

@hashemix
Copy link
Member

@hashemix hashemix commented Oct 15, 2025

📌 Summary

This PR refactors the create_server() function to accept an McpServerHandler directly, improving the SDK's flexibility and extensibility. This lays groundwork for plug-and-play session store support and other modular components.

✨ Changes Made

  • create_server() now accepts a McpServerHandler directly.
  • Introduced new traits to convert ServerHandler and ServerHandlerCore to a McpServerHandler.
    This enables the creation and configuration of handlers before calling create_server().

⚠ BREAKING CHANGE:
This is a minor breaking change that's easy to adopt:
when calling create_server(), simply call .to_mcp_server_handler() on your handler instance to convert it to an McpServerHandler before passing it in:

- let server =  server_runtime::create_server(server_details, transport, handler);
+ let server =  server_runtime::create_server(server_details, transport, handler.to_mcp_server_handler());

🛠️ Testing Steps

cargo make check

💡 Additional Notes

This lays groundwork for plug-and-play session store support and other modular components, in line with future support planned for HTTP frameworks like Actix and serverless environments such as AWS Lambda.

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.

2 participants