Skip to content

[Bug]: Authenticated GET /mcp SSE hangs without response headers #3183

@schroejahr2

Description

@schroejahr2

Description

Bifrost's MCP Gateway POST /mcp works, but authenticated GET /mcp with Accept: text/event-stream never sends response headers or an initial SSE event.

This breaks MCP clients using Streamable HTTP transport, such as opencode, because they open a GET SSE listener for server-to-client messages during connect.

Environment

  • Bifrost Docker image: maximhq/bifrost:latest
  • MCP initialize reports: serverInfo.version = v1.4.24
  • Also reproduced with: maximhq/bifrost:v1.5.0-prerelease7
  • Governance / virtual key auth enabled
  • Connected MCP clients are healthy; POST /mcp works

Reproduction

Unauthenticated GET returns immediately with 401, so the route is reachable:

curl -i -m 5 http://localhost:8080/mcp \
  -H 'Accept: text/event-stream'

Authenticated POST initialize works:

curl -i -m 10 http://localhost:8080/mcp \
  -H 'Authorization: Bearer <virtual-key>' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data-raw '{
    "jsonrpc":"2.0",
    "id":1,
    "method":"initialize",
    "params":{
      "protocolVersion":"2025-03-26",
      "capabilities":{},
      "clientInfo":{"name":"curl","version":"test"}
    }
  }'

Response on latest:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2025-03-26",
    "capabilities": {"tools": {"listChanged": true}},
    "serverInfo": {"name": "dev", "version": "v1.4.24"}
  }
}

Authenticated GET SSE hangs without response headers:

curl -i -m 15 http://localhost:8080/mcp \
  -H 'Authorization: Bearer <virtual-key>' \
  -H 'Accept: text/event-stream'

Actual result:

curl: (28) Operation timed out after 15002 milliseconds with 0 bytes received

Same behavior was reproduced with X-Api-Key: <virtual-key> and with maximhq/bifrost:v1.5.0-prerelease7.

Expected behavior

According to the MCP Gateway docs, GET /mcp should establish an SSE stream and send a connection/opened message, then keep the connection alive.

Docs: https://docs.getbifrost.ai/mcp/gateway-url

Actual behavior

With valid virtual key auth, Bifrost accepts the connection but does not send HTTP response headers or SSE data. The client hangs until its timeout.

Related

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions