Skip to content

Error: Fail to authorize when connecting MCP Servers with SSE #2

@saya6k

Description

@saya6k
{
  "mcpServers": {
    "home-assistant": {
      "name": "Home Assistant",
      "active": true,
      "url": "http://homeassistant.local:8123/mcp_server/sse",
      "bearerToken": "REDACTED"
    },
...
}

I have installed mcp_server integration in Home Assistant v2025.5.0. I install mcp-proxy-server add-on with mcp_server.json above, but I can't authorize neither with bearerToken nor apiKey.

All stdio servers are working fine.

This is error log.

Attempting to load configuration from: /mcp-proxy-server/config/mcp_server.json
Attempting to load tool configuration from: /mcp-proxy-server/config/tool_config.json
Successfully loaded tool configuration for 17 tools.
Starting update of backend connections...
Clients to remove: None
Clients to keep: None
Server keys to add: home-assistant, memory, sequential-thinking, ...
Connecting 8 new clients...
Connecting to server: home-assistant
  Using Bearer Token for SSE connection to home-assistant
Failed to connect to home-assistant: Error: Error POSTing to endpoint (HTTP 401): 401: Unauthorized
    at SSEClientTransport.send (file:///mcp-proxy-server/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:159:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Retry connection to home-assistant in 2500ms (1/3)
  Using Bearer Token for SSE connection to home-assistant
Failed to connect to home-assistant: Error: Error POSTing to endpoint (HTTP 401): 401: Unauthorized
    at SSEClientTransport.send (file:///mcp-proxy-server/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:159:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Retry connection to home-assistant in 2500ms (2/3)
  Using Bearer Token for SSE connection to home-assistant
Connecting to server: memory
Failed to connect to home-assistant: Error: Error POSTing to endpoint (HTTP 401): 401: Unauthorized
    at SSEClientTransport.send (file:///mcp-proxy-server/node_modules/@modelcontextprotocol/sdk/dist/esm/client/sse.js:159:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions