Skip to content

Request headers not applied to transport #63

Open
@ssuukk

Description

@ssuukk

Description
I'm trying to connect to Home Assistant MCP server, which uses "Authorization: Bearer xxxx" header for connection.

To Reproduce
Steps to reproduce the behavior:

Try to connect to HA MCP server using such transport:

        val haTransport = http.mcpSseTransport( "http://homeassistant.local:8123/mcp_server") {
            headers {
                append("Authorization", "Bearer some_token_here")
            }
        }

Gives: Error connecting to server: Expected status code 200 but was 401

Calling it via CURL works without a problem:

curl -H "Authorization: Bearer some_token_here" http://homeassistant.local:8123/mcp_server/sse
event: endpoint
data: /mcp_server/messages/01JQEXWJPKWPZPTFVEQRKS76BZ

Expected behavior
The header is passed and the server returns 200

Metadata

Metadata

Assignees

No one assigned

    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