mcp-go icon indicating copy to clipboard operation
mcp-go copied to clipboard

Support Dynamic SSE Endpoints Like /:uid/sse

Open weibaohui opened this issue 8 months ago • 4 comments

By default, the SSE (Server-Sent Events) endpoint is /sse. But I want to use different endpoints like /xxxxx/sse or /yyyyy/sse, similar to how Gin handles routes like /:uid/sse.

I’d like to use server.WithSSEContextFunc(ctxFn) and pass in a custom function that can extract the xxxxx or yyyyy part from the http.Request. Based on that value, I will inject different information into the context (ctx) for further logic.

Can you help me do this?

weibaohui avatar Apr 07 '25 15:04 weibaohui

+1

anhao avatar Apr 08 '25 00:04 anhao

https://github.com/mark3labs/mcp-go/pull/121

anhao avatar Apr 08 '25 03:04 anhao

#126 help

jkwang-a avatar Apr 09 '25 08:04 jkwang-a

see also #136

liut avatar Apr 12 '25 09:04 liut

I think this is fully supported now (as of #214), please take a look and let us know if you run into any other issues!

rwjblue-glean avatar May 13 '25 19:05 rwjblue-glean