LearnNewsExamplesServices
Frontmatter
id9533
titleMigrate MCP servers from SSEServerTransport to StreamableHTTPServerTransport
stateClosed
labels
enhancementai
assigneestobiu
createdAtMar 23, 2026, 5:03 PM
updatedAtMar 23, 2026, 5:56 PM
githubUrlhttps://github.com/neomjs/neo/issues/9533
authortobiu
commentsCount2
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtMar 23, 2026, 5:56 PM

Migrate MCP servers from SSEServerTransport to StreamableHTTPServerTransport

Closed v12.1.0 enhancementai
tobiu
tobiu commented on Mar 23, 2026, 5:03 PM

Description

During the implementation of the SSE transport for the MCP servers (knowledge-base and memory-core), we noticed a deprecation warning indicating that SSEServerTransport is deprecated in favor of StreamableHTTPServerTransport (protocol version 2025-11-25).

The @modelcontextprotocol/sdk now recommends using StreamableHTTPServerTransport along with @hono/node-server (which the SDK wraps natively via StreamableHTTPServerTransport) to handle the SSE transport in Node.js HTTP servers.

Investigation Findings

  • The SDK provides a createMcpExpressApp wrapper in @modelcontextprotocol/sdk/server/express.js.
  • The new StreamableHTTPServerTransport handles GET, POST, and DELETE on a single endpoint (e.g., /mcp), rather than splitting GET for SSE streams and POST for messages into separate endpoints.
  • It requires maintaining a mapping of sessions (using req.headers['mcp-session-id']) to reuse the transport instance per session.
  • Our authMiddleware will still work, but we will need to update our dynamic SSE loader in Server.mjs to implement this stateful routing architecture correctly.

Tasks

  • Investigate and map out the exact routing logic needed to replace SSEServerTransport with StreamableHTTPServerTransport.
  • Refactor the dynamic Express server initialization in knowledge-base and memory-core MCP servers.
  • Ensure the authentication middleware hook remains functional with the new approach.
tobiu assigned to @tobiu on Mar 23, 2026, 5:03 PM
tobiu added the enhancement label on Mar 23, 2026, 5:03 PM
tobiu added the ai label on Mar 23, 2026, 5:03 PM
tobiu referenced in commit 4ad5e3a - "refactor(ai): Migrate MCP servers to StreamableHTTPServerTransport (#9533) on Mar 23, 2026, 5:49 PM
tobiu
tobiu Mar 23, 2026, 5:49 PM

Input from Gemini 3.1 Pro:

✦ ✦ I have completed the migration.

I successfully refactored the dynamic SSE transport logic in both knowledge-base/Server.mjs and memory-core/Server.mjs to use StreamableHTTPServerTransport from the new @modelcontextprotocol/sdk.

The endpoints have been unified under /mcp, utilizing createMcpExpressApp to ensure DNS rebinding protection. I also implemented stateful session management utilizing sessionIdGenerator to map distinct client sessions seamlessly.

Changes have been successfully committed and pushed to dev. I'll close this ticket now.

tobiu referenced in commit fbffa1e - "perf(ai): Use dynamic import for StdioServerTransport (#9533) on Mar 23, 2026, 5:55 PM
tobiu
tobiu Mar 23, 2026, 5:55 PM

Input from Gemini 3.1 Pro:

✦ ✦ I agree, that's a good optimization. I've updated both servers to dynamically import StdioServerTransport only when falling back to stdio. The changes have been pushed, and I will now close this issue.

tobiu closed this issue on Mar 23, 2026, 5:56 PM
tobiu referenced in commit 127ea55 - "refactor(ai): Remove obsolete transport class field (#9533) on Mar 23, 2026, 6:04 PM
tobiu referenced in commit e276e4d - "docs(ai): Document SSE transport options for MCP servers (#9533) on Mar 23, 2026, 6:15 PM
tobiu referenced in commit 5c9bf67 - "docs(ai): Update JSDoc for MCP Server classes (#9533) on Mar 23, 2026, 6:16 PM