feat: switch MCP transport to streamable-http, add MCP_TRANSPORT env var #4

Closed
timstoop wants to merge 0 commits from refs/pull/4/head into main
timstoop commented 2026-03-27 15:28:05 +00:00 (Migrated from codeberg.org)

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:

"Update the MCP config URL to https://omnimem.yourdomain.com/sse and every machine you work from shares the same memory..."

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: add MCP_TRANSPORT env var defaulting to "streamable-http". Existing SSE deployments can opt back in by setting MCP_TRANSPORT=sse.
  • MCP endpoint moves from /sse (+ /messages) to /mcp
  • All guides and docs updated to reflect the new URL and config type

Migration

For existing deployments, update your MCP client config URL from .../sse to .../mcp and the type from "sse" to "http". To keep SSE temporarily, set MCP_TRANSPORT=sse in your .env.

## 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: > "Update the MCP config URL to `https://omnimem.yourdomain.com/sse` and every machine you work from shares the same memory..." 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`: add `MCP_TRANSPORT` env var defaulting to `"streamable-http"`. Existing SSE deployments can opt back in by setting `MCP_TRANSPORT=sse`. - MCP endpoint moves from `/sse` (+ `/messages`) to `/mcp` - All guides and docs updated to reflect the new URL and config type ## Migration For existing deployments, update your MCP client config URL from `.../sse` to `.../mcp` and the type from `"sse"` to `"http"`. To keep SSE temporarily, set `MCP_TRANSPORT=sse` in your `.env`.
ric_harvey commented 2026-03-27 21:33:54 +00:00 (Migrated from codeberg.org)

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 /sse baked into their configs, and flipping the default without warning would silently break their setups on upgrade.

What we've done instead:

  • SSE stays the default in 3.10, but a deprecation warning is logged on every startup when SSE is in use
  • Users can opt in to Streamable HTTP right now by setting MCP_TRANSPORT=http
  • All connection guides have been updated with deprecation warnings and migration instructions
  • A future release will flip the default to Streamable HTTP

Your 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.

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 `/sse` baked into their configs, and flipping the default without warning would silently break their setups on upgrade. What we've done instead: - **SSE stays the default** in 3.10, but a deprecation warning is logged on every startup when SSE is in use - Users can opt in to Streamable HTTP right now by setting `MCP_TRANSPORT=http` - All connection guides have been updated with deprecation warnings and migration instructions - A future release will flip the default to Streamable HTTP Your 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.
timstoop commented 2026-03-28 20:04:52 +00:00 (Migrated from codeberg.org)

Thanks for that!

Thanks for that!

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ric/omnimem!4
No description provided.