MCP setup#

1. Home Assistant#

1.1. Home Assistant Side (The Server)#

Before the CLI can talk to your home, you must enable the MCP bridge.

  1. Install Add-on: Go to Settings > Add-ons > Add-on Store.
  2. Add Repository: Click the three dots (top right) > Repositories. Add the ha-mcp repository URL.
  3. Install & Start: Find the ha-mcp add-on, install it, and click Start.
  4. Get Your URL: Go to the Logs tab of the add-on. Look for a line that says: SSE endpoint: http://<your-ha-ip>:9583/SEE 1Password

1.2. Gemini CLI Side (The Client)#

We will use the built-in mcp add command. This is safer than manual JSON editing because it handles the formatting for you.

Step A: Initialize the Connection#

Run this command in your terminal. Replace the URL with the one you copied from the Home Assistant logs.

# Adding the Home Assistant server using SSE transport
gemini mcp add --transport sse home-assistant [http://10.1.2.200:9583/private_JrJdvi1vUjcyzqV8M3N7Tg](http://10.1.2.200:9583/private_JrJdvi1vUjcyzqV8M3N7Tg)

Step B: Manual Verification (The “Nano” Method)#

If you need to check or edit the file manually, use nano. This allows you to see the structure without overwriting the whole file.

nano ~/.gemini/settings.json
# Add description
{
  "tipsShown": 10,
  "terminalSetupPromptShown": true,
  "startupWarningCounts": {
    "home-directory": 2,
    "true-color": 3
  },
  "mcpServers": {
    "home-assistant": {
      "url": "http://10.1.2.200:9583/private_JrJdvi1vUjcyzqV8M3N7Tg",
      "transport": "sse",
      "timeout": 60000
    },
    "gemini-obsidian": {
      "command": "gemini-obsidian",
      "args": []
    }
  }
}```
*Inside the file, ensure `transport: "sse"` is present in the `home-assistant` block.*

---

## Testing & Usage

Once configured, launch the CLI and verify the "Green Circle."
# Secure the file
chmod 600 ~/Obsidian/.gemini/settings.json

Verification Command#

Inside the Gemini prompt, run: /mcp You should see 🟢 home-assistant - Ready.

Test Queries#

Try these to confirm the AI can actually “see” your house:

  • Status Check: “What is the current state of my server room temperature sensor?”
  • Discovery: “List all entities in Home Assistant that have ‘UPS’ in the name.”
  • Action: “Turn on the office light.” (Note: Gemini will ask for confirmation before calling services).

1.3. 🛠️ Recovery & Troubleshooting#

If the server shows as 🔴 Disconnected, run this “Power Cycle” for the CLI:

# 1. Kill any stuck processes
pkill -9 gemini

# 2. Clear the handshake cache
rm -rf ~/.gemini/.mcp-cache

# 3. Relaunch
gemini