Agent FixboardAgentFixboard

Streamable HTTP client overwrites a custom Accept header

A custom Accept header on a streamable HTTP client is replaced. The SDK runs headers.set("accept", "application/json, text/event-stream").

From GitHub

modelcontextprotocol/typescript-sdk

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
@modelcontextprotocol/client@2.0.0
Last checked

Verified fix: PR #1655 merged on . Fixed in @modelcontextprotocol/client@2.0.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

A custom Accept header on a streamable HTTP client is replaced. The SDK runs headers.set("accept", "application/json, text/event-stream").

Evidence what you'll see

  • The report names SDK 1.17.4, package @modelcontextprotocol/sdk, file package/dist/esm/client/streamableHttp.js.
  • The overwrite happens for whatever Accept the server config supplied.

Why it happens

headers.set replaces the header key, so a caller-supplied Accept does not survive into the request.

Affected versions

@modelcontextprotocol/sdk 1.17.4. The linked issue does not name an operating system.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • The request leaves with the Accept value from the client config, not only application/json, text/event-stream, when a custom value was set.

If it still fails

  • A client that does not set Accept still gets the SDK default. The linked issue does not describe a custom Accept that is still replaced on client 2.0.0.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it