Description
Right now the DELETE handler just removes sessions from the session manager
async def _handle_delete_request(self, request: Request) -> Response:
"""Handle session termination."""
session_id = request.headers.get("Mcp-Session-Id")
if not session_id:
return Response("Missing session ID", status_code=400)
client_id = self._session_manager.terminate_session(session_id)
if client_id is None:
return Response("Session not found", status_code=404)
return Response(status_code=200)
It'd be nice to clean up protocol state too. For example, cleaning up the ClientManager, cancelling pending requests, and so on.