Linux Setup Guide

Connect Claude to Home Assistant on Linux in ~10 minutes

A free option is available — the community Claude Desktop build works with a free Claude account. The official Claude Code path needs a paid Claude plan.

1

Create a Claude Account

Go to claude.ai and create an account.

A free account is enough for the community Claude Desktop path below. Claude Code (the official CLI) requires a paid plan — Pro, Max, Team, or Enterprise.

Choose your path

Anthropic doesn't ship Claude Desktop for Linux, so there are two ways to connect. Pick one:

Path A — Claude Code

Official

The officially-supported way to run an MCP server on Linux. Requires a paid Claude plan (Pro, Max, Team, or Enterprise).

2

Install Claude Code

Open Terminal and run the official installer:

curl -fsSL https://claude.ai/install.sh | bash

Supported on Ubuntu 20.04+, Debian 10+, and Alpine 3.19+. You can also install via apt / dnf / apk or npm install -g @anthropic-ai/claude-code. Verify with claude --version.

3

Add the Home Assistant MCP Server

Run the installer with the --claude-code flag — it installs uv and registers ha-mcp for the demo environment:

curl -LsSf https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install.sh | sh -s -- --claude-code
Manual setup (if the installer doesn't work)

Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Register the server

claude mcp add home-assistant --scope user \
  --env HOMEASSISTANT_URL=https://ha-mcp-demo-server.qc-h.net \
  --env HOMEASSISTANT_TOKEN=demo \
  -- uvx --python 3.13 ha-mcp@latest

--scope user makes the server available in every project (the default scope is the current project only).

4

Test It

Start Claude Code and confirm the server is connected:

claude

On first launch you'll be prompted to log in (this is where the paid plan is required). Then run /mcp to confirm home-assistant is listed, and ask:

Can you see my Home Assistant?

claude mcp list — list configured MCP servers

claude mcp remove home-assistant --scope user — remove this server

Path B — Claude Desktop

Free

Anthropic doesn't ship Claude Desktop for Linux. This path uses the community-maintained aaddrick/claude-desktop-debian build, which repackages the official app for Debian/Ubuntu/Fedora/Arch. It's a well-regarded project, but it's unofficial — if it ever lags an Anthropic Desktop release, this path can break until it catches up.

2

Install the Community Claude Desktop Build

Follow the instructions for your distro on the aaddrick/claude-desktop-debian project (it ships .deb, .rpm, AUR, Nix, and AppImage builds).

Then sign in to Claude Desktop with your free Claude account.

3

Run the Installer

In Terminal, paste:

curl -LsSf https://raw.githubusercontent.com/homeassistant-ai/ha-mcp/master/scripts/install-linux.sh | sh

This installs the required tools and configures Claude Desktop for the demo environment.

Manual Installation (if the installer doesn't work)

Install uv

curl -LsSf https://astral.sh/uv/install.sh | sh

Configure Claude Desktop

  1. 1. Open Claude Desktop
  2. 2. SettingsDeveloperEdit Config
  3. 3. Paste the following configuration:
{
  "mcpServers": {
    "Home Assistant": {
      "command": "/home/YOUR_USER/.local/bin/uvx",
      "args": ["--python", "3.13", "ha-mcp@latest"],
      "env": {
        "HOMEASSISTANT_URL": "https://ha-mcp-demo-server.qc-h.net",
        "HOMEASSISTANT_TOKEN": "demo"
      }
    }
  }
}

Replace /home/YOUR_USER/.local/bin/uvx with the output of which uvx. Claude Desktop doesn't inherit your shell's PATH, so a bare uvx will fail with "command not found" on most systems.

4. Save and restart Claude Desktop.

4

Restart Claude Desktop & Test

Quit and reopen Claude Desktop so it picks up the new configuration, then ask:

Can you see my Home Assistant?

Claude should respond with a list of entities from the demo environment (lights, sensors, switches, etc.).

5

Explore the Demo

The demo environment is a real Home Assistant you can experiment with:

Web UI: ha-mcp-demo-server.qc-h.net

Login: mcp / mcp

Note: Resets weekly - your changes won't persist

Try asking Claude:

  • "Turn on the kitchen lights"
  • "What's the temperature in the living room?"
  • "Create an automation that turns off all lights at midnight"
6

Connect Your Home Assistant

Ready to use your own Home Assistant? You'll need a long-lived access token:

To get your token:

  1. 1. Open Home Assistant in your browser
  2. 2. Click your username (bottom left)
  3. 3. Security tab → Long-lived access tokens
  4. 4. Create token → Copy immediately (shown only once)

Claude Code

Re-register the server with your own URL and token:

claude mcp remove home-assistant --scope user
claude mcp add home-assistant --scope user \
  --env HOMEASSISTANT_URL=http://homeassistant.local:8123 \
  --env HOMEASSISTANT_TOKEN=your_long_lived_token \
  -- uvx --python 3.13 ha-mcp@latest

Claude Desktop

Open the config in your editor (swap nano for your preferred one):

nano ~/.config/Claude/claude_desktop_config.json

Replace the demo values:

{
  "mcpServers": {
    "Home Assistant": {
      "command": "/home/YOUR_USER/.local/bin/uvx",
      "args": ["--python", "3.13", "ha-mcp@latest"],
      "env": {
        "HOMEASSISTANT_URL": "http://homeassistant.local:8123",
        "HOMEASSISTANT_TOKEN": "your_long_lived_token"
      }
    }
  }
}

Then quit and reopen Claude Desktop.

?

Troubleshooting: Can't Connect to Local HA?

If the demo server works but your local Home Assistant doesn't, check the following:

1. Running under WSL?

The Claude Desktop path doesn't work in WSL — Claude Desktop runs on Windows and reads its config from %APPDATA%\Claude\, not the WSL filesystem. Use the Windows guide instead, or use the Claude Code path, which runs fine inside WSL.

2. Firewall rules

If you run ufw or firewalld, make sure outbound connections to your Home Assistant IP and port are allowed. The MCP server runs as a subprocess that needs network access.

3. http:// vs https://

HA in container mode (Docker, K3s) uses HTTP by default. Use http:// unless you configured SSL/TLS or a reverse proxy.

4. Python 3.13 required

ha-mcp requires Python 3.13 (specifically 3.13.x). Older Python can't install the current ha-mcp.

uv python install 3.13
uvx --refresh ha-mcp@latest

If uvx still picks the old Python, make sure "--python", "3.13" is in your config args (as shown above).

See the FAQ & Troubleshooting Guide for more.

7

Share Your Feedback

We'd love to hear how you're using ha-mcp!

Having issues? See the FAQ & Troubleshooting Guide