Skip to content

MCP Client connection is never properly closed #6144

@Ben-Lichtman

Description

@Ben-Lichtman

Describe the bug

This is caused by an issue with the rmcp crate: modelcontextprotocol/rust-sdk#572

ie. the connection to an MCP server is never getting formally closed, which can cause the session to stay open on the server side. If this is an authenticated connection this can bar the user from creating a new client until the old session expires.

On goose, this means that once I close the application, I get authentications errors when connecting to the same extension server again until the old session expires on the server side (can take a long time).

A workaround I have found for this is to call .cancel() on the client before dropping it, which appears to close the connection explicitly, though ideally this can be done automatically on Drop (async drop issues aside), and to actually close the transport, rather than cancelling it.

Metadata

Metadata

Assignees

Labels

mcpMCP/Extension relatedp2Priority 2 - Medium

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions