Skip to content

Handle streamable POSTs to properly support new streamable transport protocol spec #91

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into streaming_posts
  • Loading branch information
mattt authored Apr 27, 2025
commit e7204b7eb978d21807f5ea5382e3f7e22668ba9b
6 changes: 3 additions & 3 deletions Sources/MCP/Base/Transports/HTTPClientTransport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ public actor HTTPClientTransport: Actor, Transport {

// Check response status
guard httpResponse.statusCode == 200 else {
// For servers that don't support streaming from this endpoint
// they should return a 405 NOT ALLOWED. So lets cancel the task
// instead of retrying
// If the server returns 405 Method Not Allowed,
// it indicates that the server doesn't support SSE streaming.
// We should cancel the task instead of retrying the connection.
if httpResponse.statusCode == 405 {
self.streamingTask?.cancel()
}
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.