Problem
mcpToolProvider.ts constructs the SSE transport as:
transport = new SSEClientTransport(new URL(serverConfig.url), {
headers: serverConfig.headers ?? {},
});
But the SDK's SSEClientTransportOptions has no top-level headers key — it takes authProvider / eventSourceInit / requestInit. So custom headers configured on a TS sse server (e.g. Authorization) are most likely silently dropped. The Python side passes headers correctly (sse_client(url, headers=...)), so this is a TS-only parity bug.
Found during review of #632, where the new streamable-http branch does it correctly via requestInit.
Proposal
Pass headers through both requestInit.headers (POST requests) and eventSourceInit (the SSE GET stream needs a custom fetch/EventSource init to carry headers — check the SDK version's exact mechanism), with a test asserting the constructed options shape.
Behavioral note for the changelog: users' headers on TS SSE configs will start being sent — that is the documented intent, but it is a change in effective behavior.
Problem
mcpToolProvider.tsconstructs the SSE transport as:But the SDK's
SSEClientTransportOptionshas no top-levelheaderskey — it takesauthProvider/eventSourceInit/requestInit. So custom headers configured on a TSsseserver (e.g.Authorization) are most likely silently dropped. The Python side passes headers correctly (sse_client(url, headers=...)), so this is a TS-only parity bug.Found during review of #632, where the new
streamable-httpbranch does it correctly viarequestInit.Proposal
Pass headers through both
requestInit.headers(POST requests) andeventSourceInit(the SSE GET stream needs a custom fetch/EventSource init to carry headers — check the SDK version's exact mechanism), with a test asserting the constructed options shape.Behavioral note for the changelog: users' headers on TS SSE configs will start being sent — that is the documented intent, but it is a change in effective behavior.