Skip to content

Add client completion notification and details#1368

Open
stephentoub wants to merge 3 commits intomodelcontextprotocol:mainfrom
stephentoub:completiondetails
Open

Add client completion notification and details#1368
stephentoub wants to merge 3 commits intomodelcontextprotocol:mainfrom
stephentoub:completiondetails

Conversation

@stephentoub
Copy link
Contributor

Introduce a new mechanism for reporting MCP client session completion details, including both graceful and error terminations. Add a Completion property to McpClient, exposing a Task<ClientCompletionDetails> that completes with details about session closure. Implement extensible completion details (including StdioClientCompletionDetails for stdio transports) and propagate them via a new internal TransportClosedException.

Closes #1332
Closes #438

eiriktsarpalis
eiriktsarpalis previously approved these changes Feb 24, 2026
halter73
halter73 previously approved these changes Feb 24, 2026
Copy link
Contributor

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see this implemented for stateful Streamable HTTP when there are 404s as well, but I think this is already a nice improvement even without that part. I have a small preference for the abstract Completion property over the method, but I don't care too much either way on that.

stephentoub and others added 3 commits February 25, 2026 15:40
Introduce a new mechanism for reporting MCP client session completion details, including both graceful and error terminations. Add a Completion property to McpClient, exposing a `Task<ClientCompletionDetails>` that completes with details about session closure. Implement extensible completion details (including StdioClientCompletionDetails for stdio transports) and propagate them via a new internal TransportClosedException.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stdio transport does not expose process exit code on server launch failure Provide notification of server connection loss

4 participants