Description
When using the streamable HTTP transport, the OnUnregisterSession hooks are not called when a client terminates its session (uses the DELETE method with the session ID).
We would be happy to submit a PR for this issue. See possible solution below.
Code sample
- streamable_http.go:
handleDelete
Environment
- Go version: 1.25
- mcp-go version: 0.43.1
Additional Context
Possible Solution
Call the server's UnresgisterSession method from the StreamableHTTPServer's handleDelete method:
s.server.UnregisterSession(r.Context(), sessionID)