SSE and Streamable HTTP MCP connections don't forward env headers — blocks Bearer-auth servers (e.g. Obsidian Local REST API)
Prerequisites
- I searched open issues and discussions and did not find an existing report of this bug.
- This is not a security vulnerability. (Vulnerabilities go to GitHub Security Advisories — see SECURITY.md.)
- I am running the latest code from
main.
Install Method
Docker (docker compose up)
Operating System
Windows
Steps to Reproduce
- Add an MCP server with SSE or Streamable HTTP transport
- Set the env field to {"Authorization": "Bearer "}
- 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.
Source: odysseus-dev/odysseus