Implement DELETE request handling for session termination

- Add explicit DELETE request handling in handleStreamableHTTP
- Validate session existence before termination
- Send shutdown control messages to clean up Redis resources
- Return proper HTTP status codes (200 for success, 404 for not found)
- Fix TypeScript issue with JSONRPCMessage id access in redisTransport
- Add missing semicolon in startServerListeningToRedis call

Follows MCP specification for explicit session termination.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jerome 2025-07-07 15:30:11 +01:00
commit f84e54124b
No known key found for this signature in database

View file

@ -156,7 +156,7 @@ export class ServerRedisTransport implements Transport {
}
async send(message: JSONRPCMessage, options?: TransportSendOptions): Promise<void> {
const relatedRequestId = options?.relatedRequestId?.toString() ?? "id" in message ? message.id : notificationStreamId;
const relatedRequestId = options?.relatedRequestId?.toString() ?? ("id" in message ? message.id?.toString() : notificationStreamId);
const channel = getToClientChannel(this._sessionId, relatedRequestId)
const redisMessage: RedisMessage = { type: 'mcp', message, options };