You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remote MCP servers that use SSE-over-POST (streamable HTTP with SSE response format) fail to connect because opencode's StreamableHTTPClientTransport doesn't send Accept: text/event-stream in the request headers.
Reproduction
Configure a remote MCP server that requires Accept: application/json, text/event-stream:
The server returns 406 Not Acceptable when StreamableHTTPClientTransport POSTs without Accept: text/event-stream. The fallback to SSEClientTransport also fails because the server returns 405 Method Not Allowed on GET (it doesn't support legacy EventSource SSE).
StreamableHTTPClientTransport should include Accept: text/event-stream alongside application/json per the MCP spec, allowing SSE-over-POST servers to respond correctly.
It looks like you've already identified this connection in the "Related Issues" section. Consider adding your findings (the specific Braintrust reproduction case and the SSE-over-POST failure mode) as a comment on #6972 to consolidate the discussion there.
Closing — misdiagnosis. The MCP SDK (@modelcontextprotocol/sdk) correctly sets Accept: application/json, text/event-stream in StreamableHTTPClientTransport.send(). The header is set after merging requestInit.headers, so user-provided headers can't override it.
The actual root cause was {env:BRAINTRUST_API_KEY} silently resolving to "" (env var not exported in shell), causing auth failures. Transport failures were logged at debug level only, making the real error invisible.
Activity
github-actions commentedon Feb 25, 2026
This issue might be a duplicate of an existing issue. Please check:
Accept: application/json, text/event-streamheader, causing 406 Not Acceptable errors from remote MCP serversIt looks like you've already identified this connection in the "Related Issues" section. Consider adding your findings (the specific Braintrust reproduction case and the SSE-over-POST failure mode) as a comment on #6972 to consolidate the discussion there.
dmmulroy commentedon Feb 25, 2026
Closing — misdiagnosis. The MCP SDK (
@modelcontextprotocol/sdk) correctly setsAccept: application/json, text/event-streaminStreamableHTTPClientTransport.send(). The header is set after mergingrequestInit.headers, so user-provided headers can't override it.The actual root cause was
{env:BRAINTRUST_API_KEY}silently resolving to""(env var not exported in shell), causing auth failures. Transport failures were logged atdebuglevel only, making the real error invisible.