Skip to content

Send DELETE request when closing an Streamable HTTP session on the serverΒ #12

@halter73

Description

@halter73

StreamableHttpClientSessionTransport.DisposeAsync should be updated to send a delete request. We should ignore non-successful status code because the MCP spec does not require that servers handle the DELETE request, but we shouldn't catch any exceptions.

  1. Clients that no longer need a particular session (e.g., because the user is leaving the client application) SHOULD send an HTTP DELETE to the MCP endpoint with the Mcp-Session-Id header, to explicitly terminate the session.
  • The server MAY respond to this request with HTTP 405 Method Not Allowed, indicating that the server does not allow clients to terminate sessions.

https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http

Update the StreamableHttpClientConformanceTests to verify that this DELETE request gets sent.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions