Skip to content

bug: OnUnregisterSession hooks not called in the StreamableHttp session termination handler #651

@connor-strata

Description

@connor-strata

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions