Skip to content

Client connection is not closed on drop, and no way to gracefully stop #572

@Ben-Lichtman

Description

@Ben-Lichtman

Describe the bug
When you create a client, it appears to be keeping the session open even when dropping the client / transport, and the only way to completely close appears to be cancelling it explicitly via the client. There is no way to gracefully close the connection at all.

This can pose problems for authenticated MCP connections, where an orphan session can be left open on the remote end, and the server refuses to let you authenticate again until the remote session times out completely.

Expected behavior
The library should attempt to gracefully close the connection when important structures get dropped, and also provide the means to explicitly begin a graceful stop of the connection without needing to cancel.

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