feat: add Streamable HTTP transport to MCPToolProvider (TS + Python) - #639
Merged
Conversation
Both trees only spoke stdio and HTTP+SSE, the transport deprecated by the MCP spec since 2025-03-26. Add type="streamable-http" to MCPServerConfig, reusing the existing url/headers fields. TypeScript lazily imports StreamableHTTPClientTransport (SDK >=1.10) with the same null-fallback pattern as the other transports; Python guards the streamablehttp_client import separately (mcp >=1.9) so older installs keep working until they actually use the new type, and the connect unpack handles its 3-tuple. Existing stdio/sse paths unchanged. Closes #632 Code written by Claude (Fable 5), architected and approved by @cornelcroi.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue Link
Closes #632
Summary
MCPToolProviderin both trees only spokestdioandsse— and HTTP+SSE is the legacy transport, deprecated by the MCP spec since 2025-03-26. This adds the current standard HTTP transport as a thirdMCPServerConfigtype,"streamable-http", reusing the existingurl/headersfields. It works on today's 1.x SDKs and is the prerequisite for the MCP 2026-07-28 protocol work (#633, #634).Changes
StreamableHTTPClientTransport(@modelcontextprotocol/sdk>= 1.10) with the same null-fallback + use-time error pattern as the other transports; constructed with{ requestInit: { headers } }(verified against SDK tag 1.30.0). 3 new tests (transport shape, no-headers case, missing-url error) — 34/34 pass, lint clean.streamablehttp_clientimport (mcp>= 1.9) so older 1.x installs keep working until the new type is actually used; connect unpack handles its 3-tuple(read, write, get_session_id)while stdio/sse 2-tuples are untouched (read, write, *_). Headers verified working across mcp 1.9.0 → 1.29.0. 3 new tests — 29/29 pass, ruff clean.mcp-tool-provider.mdxnow documents three transports with TS + Python examples; SSE reframed as legacy; config reference tables updated; inline docstrings updated.User experience
Fully additive: existing
stdio/sseconfigurations behave byte-identically; no new required fields, no dependency changes.Both language expert reviews returned APPROVED with no required changes. One pre-existing bug surfaced during review (separate issue to follow): the TS
ssebranch passes{ headers }toSSEClientTransport, which has no such option — custom headers on TS SSE are likely silently dropped today.Checklist
Code written by Claude (Fable 5), architected and approved by @cornelcroi.