-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Add support for Streamable HTTP Transport MCP servers #4210
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
Merged
mrubens
merged 6 commits into
RooCodeInc:main
from
taylorwilsdon:add_streamable_http_support
Jun 2, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
adcd21b
Implement support for streamable-http transport type mcp servers
taylorwilsdon 1fc6d52
add streamable-http mock in same fashion as sse - which does not seem…
taylorwilsdon b165fc7
rename mock to resolve kebabcase vs camelCase
taylorwilsdon b53c7dd
fix (seemingly unrelatd) test failure in writeToFileTool.test.ts
taylorwilsdon 48f4957
fix tests
taylorwilsdon b60dbc6
Merge branch 'main' of github.com:taylorwilsdon/Roo-Code into add_str…
taylorwilsdon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/__mocks__/@modelcontextprotocol/sdk/client/streamableHttp.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| class StreamableHTTPClientTransport { | ||
| constructor(url, options = {}) { | ||
| this.url = url | ||
| this.options = options | ||
| this.onerror = null | ||
| this.onclose = null | ||
| this.connect = jest.fn().mockResolvedValue() | ||
| this.close = jest.fn().mockResolvedValue() | ||
| this.start = jest.fn().mockResolvedValue() | ||
| } | ||
| } | ||
|
|
||
| module.exports = { | ||
| StreamableHTTPClientTransport, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to add this hack in #4148 to make headers work with SSE - do you know if it's also needed for streamable? Hopefully not 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm good call, may not be necessary but wanted it match the existing patterns
Looking at it, EventSource can’t natively send arbitrary request headers from the browser, so #4148 injects them through the polyfill’s custom fetch hook. 
StreamableHTTPClientTransport opens its connection with fetch() under the hood. Because it relies on plain fetch, anything you put in options.requestInit.headers is forwarded automatically; no special shim is required.
The only gotcha is to pass the options object as the second (not third) argument to the transport constructor. Don’t think it poses any usability issues as is, didn’t in my testing but want to make everything clean and tidy can poke at it in the am