-
Notifications
You must be signed in to change notification settings - Fork 235
Fix #280 Routing pattern not included in /message endpoint when using SSE Server #323
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
…int modelcontextprotocol#280 currently expected to fail until fix is implemented
Thanks for this PR. We merged "Streamable HTTP" support with #330, so now the relevant logic for this PR is in SseHandler.cs rather than StreamableHttpHandler.cs which no longer sends an "endpoint" event as that's no longer part of the latest transport spec. However, we still want to keep the legacy "HTTP with SSE" support and getting the root-relative endpoint URL correct. I think in order to get this logic completely right, we'll need to take into account the PathBase like ASP.NET Core takes care of If you want to fix the merge conflict and address these issues in the next few days, I'd be happy to merge your PR. Otherwise, I can also take over the fix for #280 myself. Thanks again! |
# Conflicts: # src/ModelContextProtocol.AspNetCore/StreamableHttpHandler.cs
Now it properly considering PathBase. |
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!
I do wonder if this change is necessary now that MapMcp only routes SSE requests to @dogdie233 Was there a specific client that had an issue when just "messages" was used as the relative endpoint URL? I suppose making the messages URL root-relative doesn't hurt though. |
You're right! Emit root-relative paths completely resolves this issue and eliminates the need for URL pattern matching. |
When create
SseResponseStreamTransport
, parse the path of the request to extract the patternMotivation and Context
Solve issue #280
How Has This Been Tested?
I also modified the testing method 'Allows_Customizing_Route' to check if the
message
endpoint returned by the sse request is correctBreaking Changes
No
Types of changes
Checklist
Additional context
Not sure if there are other better ways to get patterns