Skip to content

StreamableHTTPClientTransport cleanup / fixes - #300

Merged
ihrpr merged 1 commit into
modelcontextprotocol:ihrpr/response-returns-jsonfrom
prompteus-ai:streamable-http-client-fixes
Apr 10, 2025
Merged

StreamableHTTPClientTransport cleanup / fixes#300
ihrpr merged 1 commit into
modelcontextprotocol:ihrpr/response-returns-jsonfrom
prompteus-ai:streamable-http-client-fixes

Conversation

@beaulac

@beaulac beaulac commented Apr 10, 2025

Copy link
Copy Markdown
Contributor
  • always send headers specified in requestInit option
  • avoid doubled onerror call
  • use for-await to iterate SSE stream
  • remove outdated comments
  • simplify requestId tracking
  • throw error when response Content-Type is out of spec

Motivation and Context

suggests changes for #299 ( cc @ihrpr )
Simplifies and fixes some inconsistencies in StreamableHTTPClientTransport.

How Has This Been Tested?

Existing StreamableHTTPClientTransport tests pass, two new tests added:

  • should throw error when invalid content-type is received
  • should always send specified custom headers

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

* always send headers specified in requestInit option
* avoid doubled onerror call
* use for-await to iterate SSE stream
* remove outdated comments
* simplify requestId tracking
* throw error when response Content-Type is out of spec
@beaulac
beaulac force-pushed the streamable-http-client-fixes branch from 5b9de6a to a76004c Compare April 10, 2025 01:18

@ihrpr ihrpr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good! thank you!

@ihrpr
ihrpr merged commit 77352db into modelcontextprotocol:ihrpr/response-returns-json Apr 10, 2025
Pizzaface pushed a commit to RewstApp/mcp-inspector that referenced this pull request May 2, 2025
…ol-error-is-not-highlighted-for-sample-llm-tool-call-rejection

fix: missing condition for lengthy strings
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.

2 participants