fix(client): preserve custom Accept headers in StreamableHTTPClientTransport (#1655)

Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
Co-authored-by: Felix Weinberger <fweinberger@anthropic.com>
This commit is contained in:
Niels Kaspers 2026-04-02 15:52:53 +03:00 • committed by GitHub
commit 1eb31236e7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,7 @@
---
"@modelcontextprotocol/client": patch
---
fix(client): append custom Accept headers to spec-required defaults in StreamableHTTPClientTransport
Custom Accept headers provided via `requestInit.headers` are now appended to the spec-mandated Accept types instead of being overwritten. This ensures the required media types (`application/json, text/event-stream` for POST; `text/event-stream` for GET SSE) are always present while allowing users to include additional types for proxy/gateway routing.