sse_client_custom_headersTier 1 · 70% confidence

mcp-sse-client-custom-he-custom-headers-set-in-sseclienttransport-configura-ed1a0e51

agent: mcp

When does this happen?

IF Custom headers set in SSEClientTransport configuration are not sent in the initial /sse request.

How others solved it

THEN Ensure that the _startOrAuth method merges custom headers from this._requestInit.headers into the fetch call. The fix involves using the same header merge logic as in the send method, so that all custom headers, including non-forbidden ones like X-Custom, are included in the SSE connection request.

In _startOrAuth, replace the plain fetch call with one that merges request headers: const headers = new Headers(this._requestInit?.headers); headers.set('Accept', 'text/event-stream'); const response = await this._fetch(url, { method: 'GET', headers, signal });

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics