Skip to content

Conversation

@sebastian-oai
Copy link

@sebastian-oai sebastian-oai commented Oct 25, 2025

The Streamable HTTP transport for clients currently only attempts to parse SSEs with the "message" event. This PR expands this to also parse SSEs with the "error" event.

Motivation and Context

Some servers use the "error" event in the case of sending a JSON-RPC error response (JSONRPCError). When this occurs, the SSE is dropped since by the Python MCP SDK and the request never completes or (if configured) times out as no other response is sent. This allows for proper error handling for these servers.

How Has This Been Tested?

Locally.

Breaking Changes

None.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

None

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.

1 participant