feat: switch MCP transport to streamable-http, add MCP_TRANSPORT env var #4
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/4/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
SSE transport is stateful and single-session by design. When a second client connects, it takes over the session and the first client loses its connection. This breaks the advertised multi-machine use case:
In practice, only one client can be connected at a time with SSE.
Solution
Switch the default transport to streamable-http, which provides proper per-session isolation for concurrent clients. This is also the current MCP specification recommendation (standardised in 2025-03-26, replacing the legacy SSE transport).
Changes:
mcp_server/server.py: addMCP_TRANSPORTenv var defaulting to"streamable-http". Existing SSE deployments can opt back in by settingMCP_TRANSPORT=sse./sse(+/messages) to/mcpMigration
For existing deployments, update your MCP client config URL from
.../sseto.../mcpand the type from"sse"to"http". To keep SSE temporarily, setMCP_TRANSPORT=ssein your.env.Hey @timstoop — thanks for submitting this! Really appreciate you taking the time to contribute code. Switching to Streamable HTTP is absolutely the right direction and we've incorporated your work into v3.10.0.
The one thing we changed from your original PR is that we're keeping SSE as the default transport for now to avoid breaking existing deployments. A lot of users have
"type": "sse"and/ssebaked into their configs, and flipping the default without warning would silently break their setups on upgrade.What we've done instead:
MCP_TRANSPORT=httpYour contribution is credited in the commit (
Co-Authored-By), the changelog, and a shout-out in the README deprecation notice.Thanks again for the contribution — this is a great improvement for multi-client support and aligns OmniMem with the current MCP specification.
Thanks for that!
Pull request closed