Skip to main content
Glama

Home Assistant MCP Server

by miguelg719

🤝 家庭助理 MCP 服务器

一个与 Home Assistant 集成以提供智能家居控制功能的模型上下文协议 (MCP) 服务器项目。

提示

服务器为每个域的工具集提供提示。

工具

该服务器实现了对各种 Home Assistant 域的控制。目前支持:

  • 💡 灯光:打开/关闭,亮度控制
  • 🌡️ 气候:温度控制、HVAC 模式
  • 🔒 锁:锁定/解锁功能
  • 🚨 报警控制面板:布防/撤防安全系统
  • 💧 加湿器:湿度控制

示例工具包括:

light-turn_on() climate-turn_off() alarm_control_panel-disarm() lock-lock() humidifier-turn_off()

配置

环境变量

使用以下命令在根目录中创建.env文件:

HOMEASSISTANT_TOKEN=your_long_lived_access_token_here # get it from your Home Assistant instance after onboarding HOMEASSISTANT_BASE_URL=your_home_assistant_url_here # e.g. http://homeassistant.local:8123

快速入门

安装

按照有关如何安装 Home Assistant 并获取长期访问令牌的说明进行操作。

克劳德桌面

在 MacOS 上: ~/Library/Application\ Support/Claude/claude_desktop_config.json在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

发展

构建和发布

准备分发包:

  1. 同步依赖项并更新锁文件:
uv sync
  1. 构建软件包分发版:
uv build

这将在dist/目录中创建源和轮子分布。

  1. 发布到 PyPI:
uv publish

注意:您需要通过环境变量或命令标志设置 PyPI 凭据:

  • 令牌: --tokenUV_PUBLISH_TOKEN
  • 或用户名/密码: --username / UV_PUBLISH_USERNAME--password / UV_PUBLISH_PASSWORD

调试

由于 MCP 服务器通过 stdio 运行,调试起来可能比较困难。为了获得最佳调试体验,我们强烈建议使用MCP Inspector

您可以使用以下命令通过npm启动 MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory /Users/miguel/Documents/home-assistant-server/home-assistant-server run home-assistant-server

启动后,检查器将显示一个 URL,您可以在浏览器中访问该 URL 以开始调试。

贡献

感谢您有兴趣为这个项目做出贡献!

请参阅CONTRIBUTING.md了解指南。

执照

MIT 许可证 - 详情请参阅许可证

-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

与 Home Assistant 集成的模型上下文协议服务器,通过自然语言提供智能家居控制功能,支持灯光、气候系统、锁、警报器和加湿器等设备。

  1. 提示
    1. 工具
      1. 配置
        1. 环境变量
      2. 快速入门
        1. 安装
      3. 发展
        1. 构建和发布
        2. 调试
      4. 贡献
        1. 执照

          Related MCP Servers

          • A
            security
            A
            license
            A
            quality
            A server that enables interaction with Home Assistant devices and automations through the Model Context Protocol, allowing users to monitor device states, control devices, trigger automations, and list entities.
            Last updated -
            4
            43
            JavaScript
            MIT License
            • Apple
          • -
            security
            F
            license
            -
            quality
            A versatile Model Context Protocol server that enables AI assistants to manage calendars, track tasks, handle emails, search the web, and control smart home devices.
            Last updated -
            14
            Python
            • Apple
            • Linux
          • A
            security
            A
            license
            A
            quality
            A Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.
            Last updated -
            12
            142
            Python
            MIT License
            • Apple
            • Linux
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that allows large language models to control and query Home Assistant smart home systems through natural language interactions.
            Last updated -
            9
            1
            TypeScript
            MIT License
            • Apple

          View all related MCP servers

          MCP directory API

          We provide all the information about MCP servers via our MCP API.

          curl -X GET 'https://glama.ai/api/mcp/v1/servers/miguelg719/home-assistant-mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server