Skip to content

Routing pattern not included in /message endpoint when using SSE Server #280

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

Open
anibal-acosta opened this issue Apr 11, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@anibal-acosta
Copy link

anibal-acosta commented Apr 11, 2025

When you set a routing pattern like ...

app.MapMcp("mymcpserver")

The endpoint works with /mymcpserver/sse but this return

event: endpoint
data: /message?sessionId=XXX

should be

event: endpoint
data: {routing_pattern}/message?sessionId=XXX

In my example should be

event: endpoint
data: /mymcpserver/message?sessionId=XXX
@anibal-acosta anibal-acosta added the bug Something isn't working label Apr 11, 2025
@anibal-acosta anibal-acosta changed the title Routing pattern not included in /message endpoint Routing pattern not included in /message endpoint when using SSE Server Apr 11, 2025
dogdie233 added a commit to dogdie233/csharp-sdk that referenced this issue Apr 17, 2025
@halter73
Copy link
Contributor

@anibal-acosta Should we close this issue now that we emit root-relative message endpoint URLs as of #323? As I noted on the PR, I'm not sure we even need to emit a root-relative URL now that the sse endpoint always ends in /sse.

I do wonder if this change is necessary now that MapMcp only routes SSE requests to $"{groupPrefix}/sse" and not just $"{groupPrefix)" since that's now used for the "Streamable HTTP" transport". After all, "messages" should be a valid relative reference.

Regarding this,

The endpoint works with /mymcpserver/sse but this return

event: endpoint
data: /message?sessionId=XXX

As of preview.9 which included the changes in #291 (preview.10 is currently on nuget.org), the endpoint was emitted as follows without the root-relative "/" prefix so it should be a normal root-relative URL which should work with any endpoint ending in "/sse" :

event: endpoint
data: message?sessionId=XXX

I wonder if we should just go back to that behavior instead of using the root-relative URL since it's simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants