#3017·odysseus

SSE and Streamable HTTP MCP connections don't forward env headers — blocks Bearer-auth servers (e.g. Obsidian Local REST API)

Author: TempyTheClericCreated Jun 6, 2026Updated Sep 15, 2026
Labelsbugready for review

Prerequisites

Install Method

Docker (docker compose up)

Operating System

Windows

Steps to Reproduce

  1. Add an MCP server with SSE or Streamable HTTP transport
  2. Set the env field to {"Authorization": "Bearer "}
  3. Save and attempt to connect

Expected Behaviour

The env dict is forwarded as HTTP headers on the connection request, same as stdio transport already does.

Actual Behaviour

The env dict is silently discarded. The connection is made with no Authorization header, causing the server to return 400 Bad Request. Logs show: "unhandled errors in a TaskGroup (1 sub-exception)" with no useful detail about the actual cause.

Logs / Screenshots

httpx - INFO - HTTP Request: GET http://host.docker.internal:27123/mcp/ "HTTP/1.1 400 Bad Request" src.mcp_manager - ERROR - Failed to connect MCP server Obsidian Vault: unhandled errors in a TaskGroup (1 sub-exception)

Model / Backend (if relevant)

No response

Are you willing to submit a fix?

Yes — I can open a PR

Additional Information

Tested against Obsidian Local REST API plugin (Streamable HTTP transport, Bearer auth) running on the Docker host via host.docker.internal. The fix threads env through _connect_sse and _connect_http as HTTP headers, mirrors the existing stdio behaviour, and adds a Headers field to the SSE/Streamable HTTP form in the UI.