**Home Assistant MCP: One Server for Claude, Codex, and Gemini CLI — Transcript & Summary | SozAI**
Source: https://sozai.app/transcript/home-assistant-mcp-server-claude-codex-gemini/

Learn how to use Home Assistant MCP to connect AI agents like Claude, Codex, and Gemini CLI for smart home automation.

## Key Takeaways

- Home Assistant MCP enables seamless AI agent integration for smart home control.
- External MCP server is more powerful and widely endorsed than the built-in Home Assistant MCP server.
- Backing up Home Assistant is crucial before experimenting with AI integrations to avoid data loss.
- Multiple AI tools support MCP, allowing flexibility in how users interact with their smart home.
- The MCP server exposes a large number of tools and entities, enabling comprehensive home automation.

## What the video covers

- Introduction to Home Assistant MCP (Model Context Protocol) enabling AI agents to interact with Home Assistant.
- Comparison between built-in Home Assistant MCP server and a more powerful external MCP server with 500+ GitHub stars.
- Precautions and recommendations to back up Home Assistant before using AI integrations.
- Prerequisites include having Home Assistant running and an AI agent tool that supports MCP like Cloud Code, Cloud Desktop, Gemini CLI, or Codex.
- Step-by-step installation guide for MCP server integration using Cloud Desktop on Mac OS.
- Instructions on generating a long-lived Home Assistant token for secure API access.
- Configuration of Claude Desktop client to connect with Home Assistant MCP server.
- Demonstrations of AI agent Claude controlling smart home devices such as lights and listing accessible entities.
- Creating automations via AI, such as blinking a lamp multiple times and managing various smart home entities.
- Overview of the extensive toolset (97 tools) provided by the MCP server and links to GitHub repository for further exploration.

## Chapters

1. 00:00 Introduction to Home Assistant MCP and AI integration
2. 01:12 Prerequisites for using MCP with AI agents
3. 01:51 Installing and configuring Cloud Desktop for MCP
4. 02:50 Connecting Claude to Home Assistant MCP server
5. 03:42 Demonstration: Claude controlling smart home lights
6. 04:46 Exploring accessible entities and devices
7. 05:47 Creating automations with Claude
8. 10:04 Overview of MCP server tools and GitHub repository

Answers

## Questions about this video

What is Home Assistant MCP and why is it useful?

Home Assistant MCP (Model Context Protocol) is a protocol that allows AI agents to interact with Home Assistant, enabling smart home devices to be controlled via AI tools like Claude or Codex.

What precautions should I take before using MCP with Home Assistant?

It is highly recommended to back up your Home Assistant instance before using MCP with AI agents to prevent any accidental data loss or configuration issues.

Which AI tools support MCP for Home Assistant integration?

AI tools such as Cloud Code, Cloud Desktop, Gemini CLI, and OpenAI's Codex support MCP, allowing them to connect and control Home Assistant devices.

## Full Transcript — Download SRT & Markdown

00:01

Speaker A

Claude, please run the flash lamp automation. Let's see. Look at that. Hey, [snorts] everybody, I want to tell you about Home Assistant MCP. MCP stands for Model Context Protocol. It is basically the protocol in which AI agents are able to interact with other tools or other services. In this case, that other service or other tool is Home Assistant.

00:20

Speaker A

And so, with an MCP server, these AI agents will be able to interact with Home Assistant. So if you want to control Home Assistant from Cloud Code or Cloud Desktop or Gemini CLI or Codeex CLI, this video is for you. Check it out. A couple notes about this MCP server. So Home Assistant actually has an MCP server built into it, but it's really not very good. I've played around with it. I think it only has like five tools, and it's not very powerful.

00:27

Speaker A

But I stumbled upon this MCP server which has over 500 stars on GitHub. And in fact, if we flip over here to the discussions, the creator of Home Assistant reached out and asked if they could incorporate some of this MCP server into Home Assistant Core. So that's really cool. I would endorse this. It is really powerful and I'm excited to tell you about it. Before jumping in, warnings, limitations.

00:44

Speaker A

The first thing is before you play around with this, please, please, please, please, please back up your Home Assistant. When you're using any AI tool on something that has your data on it, there's always a chance that it could mess something up. I haven't run into an issue where it has messed something up for me, but just to be safe, I would recommend backing up your Home Assistant instance. Go to Settings, go to System, go to Backups, and then hit Backup Now. So, please do that. Please, please, please.

00:57

Speaker A

And then limitations. As far as limitations, unless you do an advanced setup, you're only going to be able to run this MCP server and access it on the same network that you are running Home Assistant. There are ways around that, and I think the website for this tool shows how to do that, but just know that that is a limitation.

01:12

Speaker A

Awesome. So, I want to go over a couple prerequisites. The first is you need Home Assistant and the second is you need an AI agent tool that supports MCP. So Cloud Code, Cloud Desktop, Gemini CLI, OpenAI's Codecs, something like that.

01:26

Speaker A

And then, so those are the two main prerequisites. And then a couple things we'll need for later. You're going to need to make sure that your Home Assistant is up and running. And then we're going to need to generate a long-lived token. So, if I go here, you're going to have to click on your profile down here, go to Security, and then scroll all the way down to the bottom and hit Create Token. I'm just going to call this MCP.

01:31

Speaker A

Okay, here's a token. I'm going to copy this. Don't worry about this being exposed in this video. I will delete it after this video. All right, let's talk about installation. So, go to this link that I'll share in the description, and then click on the Setup tab. Now, this is going to be a different setup for whatever tool you have. I'm going to use Cloud Desktop, so that's what I'll show in this video.

01:36

Speaker A

But if you have Cloud Code or if you have Gemini CLI or Codeex, there's also instructions here. So, I'll click on Cloud Desktop and then I'll click on Local Machine and then I'll click on Mac OS. And so, now we've got the instructions here for what we need to do. The first thing that we need to do is we need to install UV using Brew. If this doesn't work, you can just use this curl link here.

01:46

Speaker A

I'm going to open up Terminal. I'm going to paste this in here. Brew install UV. Hit enter and let that go to town. Cool. So, that is installing. Looks like it's all done. The next thing that we're going to need to do is we're going to need to install this client configuration for Claude Desktop. Let me open that up.

01:51

Speaker A

[snorts] Cool. So, I'm in here in Cloud Desktop. If you don't have Cloud Desktop and you want to install it, go to Anthropic or Claude's website and download their desktop app. The next thing that you're going to need to do is you're going to need to go to Developer and then click on Edit Config. And so, this opens up this file that's selected. It's claude\_desktop\_config.json.

02:04

Speaker A

I'm going to open this with TextEdit. And we'll see here it's kind of an empty config. We're going to copy this client configuration, flip back over, and I'm going to replace it here. If you have something in here already, you're going to want to make sure that you can add this entry in. I'm assuming if you already have something in here, you'll know how to do that. [snorts] So, we've got this here. This is the MCP server Home Assistant. You don't really need to know exactly what's going on here.

02:13

Speaker A

But a couple things that we will need is the Home Assistant URL and the Home Assistant token that we added earlier. So, what I'm going to do is I'm going to go over here to Home Assistant. And this is the URL for my locally running Home Assistant. You can also use the IP address directly. You know, for me, I think it's like 192.168.2 something. But I'm going to use this path here. I'm going to flip back to TextEdit and then I'm going to put the URL here.

02:26

Speaker A

Great. And then the Home Assistant token I'm going to grab. This is the one we created here. Looks like I didn't copy it. So I'm just going to create another one. MCP create and then copy this. And then I'm going to drop this in here and then save it. So now once I have that saved, I think the only thing that I need to do is restart Cloud Code or Cloud Desktop. So I'm going to quit out of Cloud. Wait till that disappears. Great. Then I'm going to open it back up.

02:38

Speaker A

And then I'm going to go to Settings and then Connectors. And you'll see down here I now have Home Assistant as a connector. And then when I click Configure, I can see there's 46 read-only tools and 47 write/delete tools. These are all the tools that are getting picked up from that MCP server. So now let's go and create a new chat.

02:50

Speaker A

Hey, can you see my Home Assistant instance? What lights do you see? We're going to see what happens here.

02:56

Speaker A

All right. So, Claude can see my Home Assistant instance. It wants to use this search entities tool. I'm going to always allow that. And then allow UV to find devices on local network. Sure, I'll do that. Looks like it needed that approval before it did it. Let me try, let me try telling Claude to do that again.

03:08

Speaker A

Cool. Look at that. I can see your Home Assistant instance. You have two lights. Tall lamp and lamp. Both are turned on. What would you like me to do? Cool.

03:17

Speaker A

So, we have the MCP server working and it is accessible via Cloud Desktop. So, that's really exciting.

03:32

Speaker A

All righty, let's move into the first demo here. Let's have Claude turn off the light behind me. Please turn off the lamp. And then we'll see here. Okay, it wants to do this. I'm going to always allow. All right, so it just turned off the lamp. Turn it back on.

03:42

Speaker A

There we go. Cool. So Claude can now turn this lamp on and off. It has access to all my entities. What other entities do you have access to and can turn on or off?

03:51

Speaker A

So, Claude is probably going to search or list all of my entities and then go from there. Let's see what it asks. Always allow. Quite comprehensive. Thank you. Thank you.

04:06

Speaker A

So, a bunch of different switches. I have some water valves, my vacuum. That would be interesting to play around with. Alarm system, [sighs and gasps] handful of scripts, camera automations.

04:18

Speaker A

Cool. So, Claude has access to all that. Let's keep going. Let's have Claude write an automation to turn this lamp on and off three times and then leave it on. So, I'm going to send this off to Claude and then see what happens. This

04:30

Speaker A

I'm going to open this with text edit. And we'll see here it's kind of an empty config. Um, we're going to copy this client configuration, flip back over, and I'm going to replace it here. If you have something in here already, you're

04:44

Speaker A

going to want to make sure that you can add, um, this entry in. Uh, I'm assuming if you already have something in here, uh, you'll know how to do that. [snorts] So, we've got this here. This is the MCP

04:56

Speaker A

server home assistant. You don't really need to know exactly what's going on here. Um, but a couple things that we will need is the Home Assistant URL and the Home Assistant token that we, um, that we added earlier. So, what I'm

05:07

Speaker A

going to do, um, is I'm going to go over here to Home Assistant. And, uh, this is the URL for my locally running Home Assistant. You can also use, um, the IP address directly. You know, for me, I

05:20

Speaker A

think it's like 192.168.2 something. Um, but I'm going to use, uh, this path here. I'm going to flip back to uh text edit and then I'm going to put the URL here.

05:35

Speaker A

Great. And then the Home Assistant token I'm going to grab. Um this is the one we created here. Looks like I didn't copy it. So I'm just going to create another one.

05:45

Speaker A

MCP create and then copy this. And then I'm going to drop this in here and then save it. So now once I have that saved, I think the only thing that I need to do is restart Cloud Code or

06:00

Speaker A

Cloud Desktop. So I'm going to quit out of Cloud. Wait till that disappears. Great. Then I'm going to open it back up.

06:11

Speaker A

And then I'm going to go to settings and then connectors. And you'll see down here I now have Home Assistant as a connector. And then when I click configure, I can see there's 46 readonly tools and 47 write/delete

06:30

Speaker A

tools. These are all the tools that are getting picked up um from that MCP server. So now let's go and create a new chat.

06:40

Speaker A

Hey, can you see my home assistant instance? What uh lights do you see? We're going to see what happens here.

06:56

Speaker A

All right. So, Claude can see my home assistant instance. It wants to use this um search entities tool. Um I'm going to always allow that. And then allow UV to find devices on local network. Sure, I'll do that. Um looks like it needed

07:12

Speaker A

that approval before it did it. Let me try let me try tell Cloud to do that again.

07:22

Speaker A

Cool. Look at that. I can see your home assistant instance. You have two lights.

07:26

Speaker A

Um, tall lamp and lamp. Both are turned on. What would you like me to do? Cool.

07:31

Speaker A

So, we have uh the MCP server working and it is um accessible via uh cloud desktop. Um, so that's really exciting.

07:41

Speaker A

All righty, let's move into the first demo here. Let's have Claude turn uh off the light behind me.

07:50

Speaker A

Please turn off the lamp. And then we'll see here. Okay, it wants to do this. I'm going to always allow. All right, so it just turned off the lamp. Turn it back on.

08:09

Speaker A

There we go. Cool. So Claude can now turn this lamp on and off. Um, it has access to all my entities. What other um entities do you have access to and can turn on or off?

08:28

Speaker A

So, cloud is probably going to search or list all of my entities um and then go from there. Um let's see what it asks.

08:36

Speaker A

Always allow. Quite comprehensive. Thank you. Thank you. Um so, a bunch of different switches.

08:46

Speaker A

Uh, I have some water valves, my vacuum. That would be interesting to play around with. Um, alarm system, [sighs and gasps] handful of scripts, camera automations.

08:57

Speaker A

Cool. So, Claude has access to all that. Uh, let's keep going. Let's have Claude write an automation to turn this lamp on and off three times and then leave it on. So, I'm going to send this off to Claude and then see

09:12

Speaker A

what happens. This is a new session, so it's probably going to search all my entities again. Um, that's not right.

09:22

Speaker A

Use the MCP tool. So, it just wanted to run some Python code. You may run into something like that. Cool. It sees my MCP server now, and now it's using that. You might run into something similar. Um, it's

09:37

Speaker A

searching entities. Great. Cool. It found the lamp entity and now it's going to write this automation.

09:47

Speaker A

Here it is. Blink the lamp three times. Uh, I'm going to allow once and then it's running the set automation.

09:55

Speaker A

Awesome. Repeat three times. Turns lamp off then waits 1 second. Great. Uh, run it now, please.

10:04

Speaker A

Going to see what happens now. cloud is taking a minute. Hey, look at that. Blinking three times and then turns back on and I think it should stay. Yep, it stays. So, that's pretty cool. Um, I can do all of that here. It

10:24

Speaker A

wrote all the code that was needed uh to do that. And then you'll see here if I flip over to settings, automations, blink lamp three times, I can now see the automation that Claude built. So pretty cool.

10:42

Speaker A

So the last thing that I want to show you is uh having Claude build me a dashboard. So I want Claude to build me a dashboard called cool dashboard. Um, it should include temperature sensors using gauges and then uh switches for

10:56

Speaker A

all my lights grouped by room. I'm going to send this off to Claude and see what happens. Nice. Uh, first it's searching entities. We'll give that a minute to finish. Um, looks like it's doing that again.

11:12

Speaker A

Now, let me get all your lights in their areas. So, it's also doing another search. Not sure exactly why. Um, can I see the Yeah, I can see. Cool. I can actually see the responses in here, which is which is neat. Uh, let me open

11:26

Speaker A

this one, too. Side note, I think there has been a bug reported in Cloud Desktop that if you don't open this up, uh, it just freezes.

11:37

Speaker A

So, just keep that in mind. You may need to just pop these open. Um, that should be fixed very soon, though.

11:44

Speaker A

I'm going to allow once getting this entity for more information. Then getting my areas to do something cool uh allow once and now it's creating a cool dashboard with the temperature gauges and lights.

12:04

Speaker A

I'll be very interested to see what it comes up with here. Nice. So, here's the dashboard. Here's all the config information.

12:17

Speaker A

It's still writing that out. So, I'll give it a minute. Nice. Are we done here or not quite?

12:28

Speaker A

I think maybe. So, I'm going to allow once and then see what happens. Okay. Says it's created it. And I actually just saw it pop up over on the side here. So, I'm going to flip over to um my home assistant and then click on

12:42

Speaker A

the cool dashboard. And there we go. We have all of our temperature sensors, kitchen sink, primary bath. Okay, so this is interesting. These are um some of these are my moisture uh sensors that also have temperature values in them. Um

13:00

Speaker A

so like yeah north AC, south AC um primary bath, those are all temperature sensors um for my my moisture sensors.

13:11

Speaker A

But here we have the appliances that actually are temperature sensors. And then we have lights here. Um these are okay. So this is I think the lamp behind me. Yeah. So I can change the the value on that. And then I have

13:27

Speaker A

tall lamp downstairs which I can turn off and turn on. I have other lights as well but I think that they are registered as smart plugs. Um so I'd have to tell Clog Claude that they are smart plugs. But um

13:42

Speaker A

so yeah, hopefully you can see that this is at least like helpful. Um you can go through and have uh Claude via the MCP um server build you a dashboard and do a bunch of other different things. Um, but

13:56

Speaker A

you may need to uh guide it along the way and say, "Hey, these actually aren't temperature sensors. Um, I only care about these ones." Um, then I also have other lights. So, um, it's not like AGI, but it is helpful. Um, and you can

14:11

Speaker A

create automations, um, turn things on and off, uh, create dashboards a lot easier than having to learn some syntax language to do it yourself.

14:20

Speaker A

All right, before wrapping up, um I wanted to bring us to the GitHub repo and just kind of showcase uh the list of all the different tools that this uh MCP server surfaces. 97 tools. Here's the complete tool list. Um plenty of

14:36

Speaker A

different things. And you don't necessarily need to know all of these, but it can be helpful to um to know about these different tools so that you can better understand what the capabilities are and then better prompt Claude or Gemini or anything like that.

14:50

Speaker A

So, here's a bunch of different tools. Um plenty of different things around dashboards. Uh you can do things get add-on. I'm not sure exactly what that does. That could that seems kind of interesting. Looks like you can actually even back up your

15:05

Speaker A

Home Assistant instance and then um restore. That's kind of cool. You can fetch logs so you can debug um why why something didn't work. Um and then I think you can get where is it?

15:19

Speaker A

You can get you can get an automation trace. So um if an automation failed uh you could actually have Claude retrieve the trace for it um and then update or edit your automation. I think it can edit. I'm not

15:33

Speaker A

sure if not it can certainly delete and then recreate it. Um so that uh it can fix your automation given that information. So plenty of different things here. Searching entities. Um deep search. Not sure what that does. Um but

15:50

Speaker A

plenty going on here. This is a very active repository. Um things changed 3 days ago and like I said um the creator of Cloud Code or the creator of Home Assistant wants to kind of incorporate this into Home Assistant Core.

16:03

Speaker A

I think that's going to do it uh for this video. Hopefully, this was helpful.

16:07

Speaker A

Um it's really cool to have an MCP server like this that uh can just be used by any AI agent. Um again, the links will be in the description. Um plenty of of of you know, cool features here. Um and then it's really cool. It

16:22

Speaker A

has a setup wizard, so you can select any of your um any any tool you want to use. Like for instance, if you wanted to use codeex, you can click on that local machine um Mac and then it gives you the

16:34

Speaker A

install instructions here and then how to kind of set up the MCP server with um with whatever tool you're using. So um yeah, hopefully this is helpful. Um really appreciative of the person who built this out. Um it's been helpful to

16:47

Speaker A

me and hopefully it'll be helpful to you. So, uh, yeah, let me know what you think and until next

Topics: Home Assistant MCP Model Context Protocol AI agents Claude Codex Gemini CLI Cloud Desktop Smart Home Automation Home Assistant Integration

Study this video

- [Flashcards from this video](https://sozai.app/tools/ai-flashcard-generator/?from=transcript&id=78244)
- [Quiz on this video](https://sozai.app/tools/quiz-generator/?from=transcript&id=78244)

Free, made by AI from this transcript. No signup.


---
This is the markdown twin of https://sozai.app/transcript/home-assistant-mcp-server-claude-codex-gemini/ — the same content, without the markup.
Published by SozAI (https://sozai.app). Reuse and quotation are allowed with attribution and a link back.
Machine-readable index: https://sozai.app/llms.txt · data API: https://sozai.app/api/
