Skip to content

feat: support StreamableHTTPClientTransport #64

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

leo237
Copy link

@leo237 leo237 commented Apr 22, 2025

Description

Adds support for Streamable HTTP. Related to #59

Fixes # (issue)

Type of change

  • 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 not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

How Has This Been Tested?

  1. Tests are added
  2. Manually tested with a Streamable HTTP server

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@benjamincburns benjamincburns changed the title Feature/streamable http feat: support StreamableHttpTransport May 6, 2025
@benjamincburns benjamincburns changed the title feat: support StreamableHttpTransport feat: support StreamableHTTPTransport May 6, 2025
@benjamincburns benjamincburns changed the title feat: support StreamableHTTPTransport feat: support StreamableHTTPClientTransport May 6, 2025
@benjamincburns
Copy link
Contributor

Per the MCP spec, the streamable HTTP transport is meant to replace the SSE transport. Per their backward compatibility guide, clients should attempt to connect to URLs as though they are streamable HTTP first, and then fall back to SSE.

Doing this would fix another problem. Prior to this change the transport type can be inferred from the structure of the config entry. That is, the transport key of the config was optional, and should remain so. Supporting this fallback behavior would allow for that to continue.

@benjamincburns
Copy link
Contributor

I pushed some updates for the above feedback, but I only had time last night to rework some of the tests. IIRC there are 3 tests still failing. We should also make updates to the README & examples to drop the transport field (it's optional and not necessary in 99% of cases).

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