Skip to content

[General]: DELETE endpoint should clean up session state. #46

@davenpi

Description

@davenpi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions