Connect AI to your Home Assistant
Download and install Cursor from the official website if you haven't already.
The MCP server requires Node.js to run. If you don't have it installed:
node --versionImportant: Install Node.js on the computer where Cursor is running, not on the Home Assistant server.
This is your complete Cursor MCP configuration.
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@coolver/home-assistant-mcp@latest"],
"env": {
"HA_AGENT_URL": "http://homeassistant.local:8099",
"HA_AGENT_KEY": "2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ"
}
}
}
}
Settings → Tools & MCP → New MCP Server
Click Add a Custom MCP Server and paste the JSON configuration you copied in Step 3
Fully quit and reopen Cursor (Cmd+Q on Mac, Alt+F4 on Windows)
Ask Cursor AI: "List my Home Assistant entities"
Google Antigravity is Google’s AI-first IDE for agentic development. The built-in assistant is powered by Gemini (you sign in with a Google account and use Google’s AI features according to their terms).
Install Antigravity on the machine where you write code (your Mac, PC, or Linux box)—the same place Node.js must run for the MCP bridge below.
The Home Assistant MCP package runs via npx, so you need Node.js on the computer where Antigravity runs:
node --versionImportant: Install Node.js on your workstation, not on the Home Assistant host (unless you intentionally run the MCP there).
Same JSON shape as Cursor / Claude Desktop: a top-level mcpServers object. You will merge this into Antigravity’s MCP file in the next step.
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@coolver/home-assistant-mcp@latest"],
"env": {
"HA_AGENT_URL": "http://homeassistant.local:8099",
"HA_AGENT_KEY": "2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ"
}
}
}
}
.gemini folder (shared branding with other Google Gemini developer tools). Official overview: Antigravity MCP documentation.
macOS / Linux: ~/.gemini/antigravity/mcp_config.json
Windows: %UserProfile%\.gemini\antigravity\mcp_config.json
If the folder does not exist yet, launch Antigravity once so it can create .gemini/antigravity, then add the file.
home-assistant serverIf the file is empty or missing, you can paste the whole JSON from Step 3.
If you already have other servers, open the existing JSON and merge: keep one top-level "mcpServers" object and add the "home-assistant" entry from Step 3 next to your other server names.
Save the file, then fully quit and reopen Antigravity so it picks up MCP changes (if tools do not appear, a restart is the most reliable fix).
The first time the agent calls your MCP server, Antigravity may ask for permission—choose Allow so Gemini can reach your Home Assistant via the agent.
Ask the assistant something like: “Use the home-assistant MCP tools to list my entities.”
Download and install Claude Code from the official website if you haven't already.
The MCP server requires Node.js to run. If you don't have it installed:
node --versionImportant: Install Node.js on the computer where Claude Code is running, not on the Home Assistant server.
This is your complete Claude Code MCP configuration.
{
"mcpServers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@coolver/home-assistant-mcp@latest"],
"env": {
"HA_AGENT_URL": "http://homeassistant.local:8099",
"HA_AGENT_KEY": "2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ"
}
}
}
}
Open a terminal and run the interactive command:
claude mcp add
The command will prompt you for:
home-assistantnpx-y @coolver/home-assistant-mcp@latestHA_AGENT_URL = http://homeassistant.local:8099HA_AGENT_KEY = (paste the key from Step 3)user (global) or project (project-specific)If you prefer to edit the configuration file directly:
~/.claude.json.mcp.json in your project rootPaste the JSON configuration you copied in Step 3 into the file. If the file already exists, add the "home-assistant" entry to the existing "mcpServers" object.
Note: Ensure the file contains valid JSON. If starting fresh, wrap the configuration in {"mcpServers": {...}}.
Fully quit and reopen Claude Code to ensure the MCP server is loaded.
In Claude Code, you can verify the MCP server is connected by checking the MCP status in the settings or by asking Claude to use the home-assistant tools.
Ask Claude: "Use the home-assistant MCP server to list my Home Assistant entities"
Or try: "Ask the home-assistant MCP server to inspect my current automations"
Make sure VS Code is installed, then install the GitHub Copilot extension. Copilot Chat is automatically included with GitHub Copilot and required for MCP server integration.
The MCP server requires Node.js to run. If you don't have it installed:
node --versionImportant: Install Node.js on the computer where VS Code is running, not on the Home Assistant server.
This is your VS Code + Copilot MCP server configuration.
{
"servers": {
"home-assistant": {
"command": "npx",
"args": ["-y", "@coolver/home-assistant-mcp@latest"],
"env": {
"HA_AGENT_URL": "http://homeassistant.local:8099",
"HA_AGENT_KEY": "2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ"
}
}
}
}
Open the Command Palette in VS Code:
Ctrl+Shift+P (Windows / Linux)
Cmd+Shift+P (macOS)
Type: MCP: Open User Configuration
Click it – this will open the MCP configuration file.
In the opened configuration file (mcp.json), you will see an empty configuration:
{
"servers": {}
}
The file will be open in VS Code editor with the cursor positioned inside the empty servers object. Paste the configuration you copied in Step 3 into this file, replacing the empty servers object, and save the file (Cmd+S / Ctrl+S).
Open GitHub Copilot Chat in VS Code (side panel with the Copilot icon).
Start a new chat. In the tools / MCP section you should now see a server called home-assistant.
If Copilot asks whether it's allowed to use this tool/server, click Allow.
Ask Copilot Chat: "Use the home-assistant tools to list my Home Assistant entities"
Or try: "Ask the home-assistant MCP server to inspect my current automations"
Make sure VS Code is installed, then install the Codex — OpenAI's coding agent extension from the VS Code marketplace.
After installation, open the Codex sidepanel and log in with your OpenAI or GitHub account.
The MCP server requires Node.js to run. If you don't have it installed:
node --versionImportant: Install Node.js on the computer where VS Code is running, not on the Home Assistant server.
TOML for Codex’s config.toml (see Step 4 Option B). If you use Step 4 Option A (codex mcp add), you do not need to paste this block unless you prefer editing the file by hand.
[mcp_servers.home-assistant]
command = "npx"
args = ["-y", "@coolver/home-assistant-mcp@latest"]
env = {
"HA_AGENT_URL" = "http://homeassistant.local:8099",
"HA_AGENT_KEY" = "2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ"
}
config.toml in your Codex user configuration directory (by default ~/.codex/config.toml). The CLI and the VS Code extension share this file. The file is not guaranteed to exist until Codex or you create it—if Open config.toml fails or the path is missing, create the .codex folder and an empty config.toml, then add the block from Step 3 (or use the CLI below, which registers the server for you). Official reference: Model Context Protocol (Codex).
codex mcp add)Often the fastest path: run once in a terminal where the codex command is available (see OpenAI’s Codex MCP docs for install and codex mcp --help).
codex mcp add home-assistant --env HA_AGENT_URL=http://homeassistant.local:8099 --env HA_AGENT_KEY=2qKCub7IqMKt5hi3lboECY_9Kgl6G7jS4jd2nKm-MkQ -- npx -y @coolver/home-assistant-mcp@latest
After regenerating your Agent key in this panel, use Copy CLI command again so the line matches your current key.
config.tomlIn VS Code: Codex side panel → Settings (gear) → MCP settings → Open config.toml. If that does not open a file yet, create ~/.codex/config.toml yourself (create the .codex directory if needed).
Paste the TOML from Step 3. If the file already has other [mcp_servers.…] tables, add only the [mcp_servers.home-assistant] block and its env lines. Save (Cmd+S / Ctrl+S).
For trusted projects only, Codex also supports a project-scoped .codex/config.toml—see the same MCP documentation.
Fully quit and reopen VS Code so Codex reloads MCP configuration.
In Codex chat, type /mcp to list active MCP servers. You should see home-assistant.
If VS Code asks to trust or start the server the first time, choose Allow.
Ask Codex: "Use the home-assistant MCP server to list my Home Assistant entities"
Or: "Ask the home-assistant MCP server to inspect my current automations"