feat(transport): add DELETE /mcp for session termination#131
Open
getlarge wants to merge 2 commits intoplatformatic:mainfrom
Open
feat(transport): add DELETE /mcp for session termination#131getlarge wants to merge 2 commits intoplatformatic:mainfrom
getlarge wants to merge 2 commits intoplatformatic:mainfrom
Conversation
Clients can now explicitly terminate sessions via DELETE with the Mcp-Session-Id header, per the MCP transport spec. The handler force-closes active SSE streams, unsubscribes from the message broker, and deletes the session from the store. Returns 204 on success. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers: - 204 on successful deletion - 400 when Mcp-Session-Id header is missing - 404 when session does not exist - SSE stream is force-closed after DELETE - session is removed from the store - DELETE route is not registered when enableSSE is false Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to #130 — second of the two small PRs porting features I've been running on my fork in production. Same caveat: riding the momentum, happy to slow-roll if the review queue gets busy.
Adds
DELETE /mcpfor explicit session termination, per the MCP streamable HTTP transport spec. Clients sendDELETE /mcpwith anMcp-Session-Idheader; the handler force-closes active SSE streams, unsubscribes from the message broker, and deletes the session from the store.Behavior
DELETE /mcpwith validMcp-Session-Id→204 No Content400404enableSSE: true(sessions only exist in SSE mode)Test plan
npm run typecheckcleantest/session-delete.test.ts— 6 new tests covering 204 / 400 / 404, SSE stream closure, store cleanup, and theenableSSE: falseguard