Skip to content

Fix/mcp session status codes - #216

Merged
bocan merged 2 commits into
mainfrom
fix/mcp-session-status-codes
Oct 17, 2026
Merged

bocan merged 2 commits into
mainfrom
fix/mcp-session-status-codes

Conversation

@bocan

@bocan bocan commented Oct 17, 2026

Copy link
Copy Markdown
Owner

No description provided.

bocan added 2 commits October 16, 2026 00:54
… requests

GET /mcp without a session now returns 405 (no standalone SSE stream),
and requests with an unknown or expired session return 404 with
JSON-RPC code -32001, so clients re-initialize instead of retrying.
The repeated 400s were tripping fail2ban.

Extract createMcpHttpServer() so tests can exercise the real handler.
The transport map and sessionStore drifted apart: TTL expiry, the
cleanup interval and per-key eviction removed store entries but left
transports open forever, and requests never refreshed the TTL.

Add SessionStore.onDelete() and route every removal through delete().
The server closes the matching transport from that listener, and
looks up sessions via the store so each request refreshes the TTL.
@bocan
bocan merged commit 74755eb into main Oct 17, 2026
2 of 4 checks passed
@bocan
bocan deleted the fix/mcp-session-status-codes branch October 17, 2026 18:54
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