-
Notifications
You must be signed in to change notification settings - Fork 18
fix: issue 116 - custom_streamable_http_endpoint #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hey @jsudano , thanks for pointing out the issue and suggesting a fix , I really appreciate it! As you mentioned, we don't have unit tests for the HyperServerOptions. It would be great if you could add a test ( a test module at the end of the same file) to cover this fix. |
|
@hashemix thanks for the quick response, and apologies for the delay! I've pushed a couple commits with tests; the first includes a handful of basic tests, and the second adds a dev dependency in order to properly test SSL validation. I broke it into two commits in case you'd prefer not to add any dependencies, in which case I'll remove the second. |
| NamedTempFile::with_suffix(".pem").expect("Expected to create test cert file"); | ||
| let ssl_cert_path = cert_file | ||
| .path() | ||
| .to_str() | ||
| .expect("Expected to get cert path") | ||
| .to_string(); | ||
| let key_file = | ||
| NamedTempFile::with_suffix(".pem").expect("Expected to create test key file"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a note, these files should be dropped when they go out of scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jsudano , you are a pro!
the second adds a dev dependency in order to properly test SSL validation. I broke it into two commits in case you'd prefer not to add any dependencies, in which case I'll remove the second.
tempfile is great, no problem to have it in the dev dependency 👍 , thanks for including the various test scenarios.
I plan to have a release in a couple of days including this fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks! Happy I could contribute :)
📌 Summary
I noticed while trying to configure a Streamable HTTP MCP server using
HyperServerOptionsthatcustom_streamable_http_endpointdoesn't seem to work. While digging through the code I noticedHyperServerOptions impl'spub fn streamable_http_endpointinstead returns self.custom_messages_endpoint🔍 Related Issues
HyperServerOptions::custom_streamable_http_endpointis not properly used #116✨ Changes Made
HyperServerOptions::streamable_http_endpoint()to consume the propercustom_streamable_http_endpointconfig value.🛠️ Testing Steps
I didn't add unit tests for this because I couldn't find any related tests. Happy to add some unit tests here, not sure if there's a preference on exactly where they should live.