MCP Client authorization

I’d love to integrate my own MCP servers into Home Assistant.

However, currently it’s only possible to add a URL.

Is there any kind of authorization planned, like setting the value of an Authorization header or passing an X-Api-Key or something?

In my specific case, I’d like to connect to my Perplexity MCP server running on a public server outside of the HA cluster.

This seems more like a question than a [FR]
Do you know for a fact that this doesn’t already exist?

I highly suggest you change the category at the top to Configuration - Home Assistant Community and add what you’ve already tried, give others a chance to weigh in on this, Someone might know something about it.

Neither the config flow supports any other input than the URL, nor is there any hint about working with such authorization headers in the MCP client code. It’s definitely a feature request.

I concur. Have been struggling with this for many hours already.

Bottom line:
Some additions to the documentation for how to configure an MCP (SSE) Client are highly appreciated!

Background:
The HA mcp_server documentation instructs the creation of a long-lived access token to be used by the MCP client. And this API_ACCESS_TOKEN must then be entered in the MCP client.

I have tried to set up the suggested Claude Desktop and mcp-proxy, just to test if my (HA) MCP Server is running, but failed miserably on the mcp-proxy part.

Besides, I want to use a n8n “MCP Client (SSE) API” node, which (I believe) can make SSE calls directly to an MCP Server, and therefore should not need an mcp-proxy.

That MCP Client takes 3 parameters:

  1. SSE URL:
    https://<my_ha_server_url>:8123/mcp_server/sse
    (this is specifically mentioned in the documentation)

  2. Messages Post Endpoint:
    https://<my_ha_server_url>:8123/messages
    (educated guess, based on all the documents I read on the subject)

  3. Additional Headers: here I have tried a zillion possibilities, like:
    API_ACCESS_TOKEN=“the long lived access token I generated earlier”
    or only the token and not the label, or without the quotes, etc etc…

Whatever I try, I cannot figure out how to connect to my HA MCP Server from my (n8n) MCP Client, and I keep getting an 401 response (access denied).

Thanks for your input, but I’d like to point out that you’re talking about the mcp_server integration but this feature request is about the mcp client integration.

Even though they’re both related to the Model Context Protocol, they’re some distinct implementations.

I actually have added the mcp_server integration in Claude as described in the documentation. JSON snipped from the claude_desktop_config.json:

    "home-assistant": {
      "command": "/Users/my-user-name/.local/bin/mcp-proxy",
      "args": [
        "https://path-to-my-server/mcp_server/sse"
      ],
      "env": {
        "API_ACCESS_TOKEN": "ey..."
      }
    }

For the messages endpoint, it’s /mcp_server/messages (see comment in code).

I hope it helps you with your issue for the mcp_server integration, even though it’s unrelated to this feature request.

Edit: it seems that your n8n problem is also a bug of the node and not of HA itself.

1 Like