feat(mcp): add Streamable HTTP client to extra/mcp#592
Open
adrienduchemin wants to merge 4 commits into
Open
Conversation
Adds MCPClientStreamableHTTP + StreamableHTTPServerParams alongside the existing SSE and stdio MCP clients, for servers that speak the Streamable HTTP transport (--transport http). Credentials are set on the httpx client so they ride every request including initialize; the transport's own headers arg is deprecated.
arnaudde
reviewed
Jul 16, 2026
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.
Summary
Adds a Streamable HTTP MCP client to
mistralai.extra.mcp, alongside the existing SSE and stdio clients, for MCP servers that speak the Streamable HTTP transport (--transport http).StreamableHTTPServerParams(url, headers, timeout, sse_read_timeout)MCPClientStreamableHTTP(MCPClientBase)whose_get_transportwiresmcp.client.streamable_http.streamable_http_clientto anhttpx.AsyncClient.Why
extra/mcpshipssse.pyandstdio.pybut no Streamable HTTP client. Streamable HTTP is the transport used by self-hosted / remote MCP servers (e.g. the official Notion MCP with--transport http), and it's the only option for callers that can't spawn a stdio subprocess.Credentials (bearer token, per-request integration headers) are set as the httpx client's default headers, so they are sent on every request including the
initializecall. This is required because recentmcpreleases deprecate and ignore the transport's ownheaders=argument (headers must live on thehttpx.AsyncClient).Notes
src/mistralai/extra/*is excluded from codegen (.genignore), so this hand-written module is safe.sse.py's structure andMCPClientBasecontract; no OAuth flow (not applicable to the bearer/header model this targets).Context
Currently consumers (Mistral Workflows SDK plugins) carry a local subclass of
MCPClientBaseto get this transport; once this lands and is released they can import it here instead, symmetric with SSE/stdio.