Skip to content

Run MCP Streamable HTTP server in stateless mode - #251

Merged
asiniscalchi merged 1 commit into
mainfrom
fix/mcp-stateless-mode
May 18, 2026
Merged

Run MCP Streamable HTTP server in stateless mode#251
asiniscalchi merged 1 commit into
mainfrom
fix/mcp-stateless-mode

Conversation

@asiniscalchi

Copy link
Copy Markdown
Owner

The server used rmcp's default stateful_mode, keeping every session in LocalSessionManager's RAM. Any restart of the backend invalidated existing session IDs; clients that did not renegotiate initialize — observed with Gemini CLI — kept reusing the stale ID and received 404 Not Found indefinitely.

PortfolioServer only exposes request/response tools and does not rely on server-initiated SSE streams, so stateless mode covers the full surface while making each request self-contained and immune to session loss across restarts.

The server used rmcp's default stateful_mode, keeping every session in
LocalSessionManager's RAM. Any restart of the backend invalidated
existing session IDs; clients that did not renegotiate initialize —
observed with Gemini CLI — kept reusing the stale ID and received 404
Not Found indefinitely.

PortfolioServer only exposes request/response tools and does not rely
on server-initiated SSE streams, so stateless mode covers the full
surface while making each request self-contained and immune to session
loss across restarts.
@asiniscalchi
asiniscalchi merged commit 8d98f31 into main May 18, 2026
4 checks passed
@asiniscalchi
asiniscalchi deleted the fix/mcp-stateless-mode branch May 18, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant