Home Assistant MCP

Home Assistant MCP

Integrates Claude AI with Home Assistant to control smart home devices via natural language.

Category
访问服务器

README

Home Assistant MCP

A Model Context Protocol (MCP) server that integrates Claude AI with your local Home Assistant instance, enabling natural language control of your smart home devices directly through Claude's chat interface.

Overview

This project bridges Claude AI and Home Assistant, allowing you to:

  • Control smart home devices using natural language in Claude chat
  • Query device states and automation status
  • Execute Home Assistant actions through conversational AI
  • Keep everything local and secure with your own Home Assistant instance

Features

  • 🏠 Local Smart Home Integration - Your Home Assistant instance and devices stay completely local; only your chat messages go to Claude for processing/Understanding your conversation
  • 🤖 Claude AI Control - Use natural language to control devices
  • 🔐 Secure Credentials - Environment-based configuration keeps tokens safe
  • 🔌 MCP Protocol - Follows Model Context Protocol standard
  • ⚡ Real-time Device Control - Execute automations and control devices instantly
  • 🌐 MCP Standard - Works with any AI tool/chat that supports Model Context Protocol, not limited to Claude

Compatibility

This MCP server works with any AI assistant that supports the Model Context Protocol standard, including:

  • Claude (claude.ai, Claude Desktop, Claude API)
  • VS Code (with MCP extension)
  • Other MCP-compatible tools (growing ecosystem)

This means your smart home integration isn't vendor-locked and will work with future AI tools that adopt the MCP standard.

Prerequisites

  • Node.js 16+
  • Local Home Assistant instance running
  • Home Assistant long-lived access token
  • Claude Desktop or Claude.ai with Developer access

Quick Start

1. Clone and Install

git clone https://github.com/aniketbhondave/Home-Assistant-MCP.git
cd Home-Assistant-MCP
npm install

2. Get Your Home Assistant Token

  1. Open your Home Assistant instance
  2. Click your profile (bottom left)
  3. Scroll to "Long-lived access tokens"
  4. Click "Create Token"
  5. Name it (e.g., "Claude MCP") and copy the token

3. Add to Claude Desktop

  1. Click the settings icon (gear) in the top right
  2. Click Developer tab
  3. Click Edit Config button
  4. Paste this configuration:
{
  "mcpServers": {
    "home-assistant": {
      "command": "bash",
      "args": [
        "-c",
        "cd /path/to/Home-Assistant-MCP && HOME_ASSISTANT_URL=http://192.168.x.xxx:8123 HOME_ASSISTANT_TOKEN=your-token-here node index.js"
      ]
    }
  }
}
  1. Replace the following:

    • /path/to/Home-Assistant-MCP - Full path to your project (e.g., /Users/yourname/Home-Assistant-MCP)
    • http://192.168.x.xxx:8123 - Your Home Assistant URL (use IP address, not homeassistant.local)
    • your-token-here - The token you copied from Home Assistant
  2. Click Save

  3. Restart Claude Desktop completely (close and reopen)

4. Test It

Ask Claude:

  • "List all my devices"
  • "Turn on the bedroom light"
  • "What devices are currently on?"

Done! 🎉

Example Commands

  • "List all my devices"
  • "Turn on the bedroom light"
  • "What devices are currently on?"
  • "Turn off all lights"
  • "Get the status of my kitchen fan"

Claude will understand natural language and communicate with your Home Assistant instance to perform the requested actions.

Project Structure

Home-Assistant-MCP/
├── index.js                 # Main MCP server entry point
├── .env.example            # Environment variables template
├── .gitignore              # Git configuration
├── package.json            # Node.js dependencies
├── README.md               # This file
└── LICENSE                 # MIT License

Smithery Deployment

This MCP is ready and planned to be deployed to Smithery. Users will be able to install it directly through the Smithery marketplace (TODO).

Security Notes

  • Use IP addresses instead of hostnames (homeassistant.local) for Home Assistant URL
  • Keep your Home Assistant token secure and rotate it periodically
  • Use strong authentication for your Home Assistant instance
  • Always verify the Home Assistant instance is accessible only from trusted networks

Status & Roadmap

🚧 Work in Progress

Current features and planned enhancements:

  • [x] Basic MCP server setup
  • [x] Home Assistant connection
  • [x] Check device status via Claude
  • [x] Turn devices on/off via Claude
  • [x] Natural language device matching
  • [ ] Brightness and color control
  • [ ] Automation triggering
  • [ ] Climate control (temperature, humidity)
  • [ ] Enhanced error handling
  • [ ] Batch device operations
  • [ ] Device state caching for performance
  • [ ] Advanced scene management

Troubleshooting

"Server transport closed unexpectedly"

  • Verify the path to your Home Assistant MCP project is correct
  • Check that Home Assistant URL and token are correct (no typos)
  • Ensure Home Assistant is accessible from your machine
  • Restart Claude Desktop completely

"Cannot connect to Home Assistant"

  • Verify HOME_ASSISTANT_URL is correct (use IP, not hostname)
  • Check the token hasn't expired - create a new one if needed
  • Ensure Home Assistant is running
  • Verify the machine running Claude can reach Home Assistant IP

Device Control Not Working

  • Verify the token has appropriate permissions in Home Assistant
  • Check that devices exist in your Home Assistant instance
  • Review Claude's responses for specific error messages

MCP Server not showing in Claude

  • Restart Claude Desktop completely (close and reopen)
  • Check JSON syntax in config file (invalid JSON will be ignored)
  • Verify all paths are absolute (full paths, not relative)

License

MIT License

Copyright (c) 2026 Aniket Bhondave

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Support

For help and questions:

Acknowledgments


Note: This project is in active development. Features and APIs may change. Please refer to README for updates.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选