Skip to main content
Glama

Home Assistant MCP

家庭助理 MCP

这是一个MCP(模型上下文协议)服务器,提供与Home Assistant集成的工具,让AI助手可以与智能家居设备进行交互。

设置

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 Home Assistant Integration:

npx -y @smithery/cli install @guilhermelirio/homeassistant-mpc --client claude

手动安装

  1. 安装依赖项:
npm install
  1. 配置环境变量:
    • 从你的 Home Assistant 获取长期访问令牌
    • 在项目根目录下的.env文件中配置环境变量:
HOME_ASSISTANT_URL=http://your-home-assistant:8123 HOME_ASSISTANT_TOKEN=your_token_here

启动服务器

npm start

对于开发:

npm run dev

可用工具

家庭助理 API 验证

  • homeassistant_api :验证 Home Assistant API 是否在线
    • 参数:无
    • 示例: homeassistant_api()

获取实体状态

  • homeassistant_get_state :获取 Home Assistant 实体的当前状态
    • 参数: entity_id (实体ID)
    • 例如: homeassistant_get_state("light.living_room")

呼叫服务

  • homeassistant_call_service :调用 Home Assistant 实体的服务
    • 参数:
      • entity_id (实体ID)
      • domain (服务域)
      • service (要调用的服务)
    • 例如: homeassistant_call_service("light.living_room", "light", "turn_on")

发展

该项目使用 TypeScript 和 MCP SDK 库来创建可被 Claude、GPT 等语言模型访问的工具。

要添加新工具:

  1. src/tools/[category]中创建一个模块
  2. 按照现有模式实施你的工具
  3. src/index.ts中注册模块

贡献

欢迎贡献代码!欢迎随时提交 issue 或 PR。

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

为AI助手提供通过Home Assistant与智能家居设备交互的工具,允许检查实体状态、调用服务等操作。

  1. 设置
    1. 通过 Smithery 安装
    2. 手动安装
  2. 启动服务器
    1. 可用工具
      1. 家庭助理 API 验证
      2. 获取实体状态
      3. 呼叫服务
    2. 发展
      1. 贡献
        1. 执照

          Related MCP Servers

          • -
            security
            A
            license
            -
            quality
            Access Home Assistant data and control devices (lights, switches, thermostats, etc).
            Last updated -
            6
            387
            TypeScript
            Apache 2.0
          • -
            security
            F
            license
            -
            quality
            Enables users to control Google Home smart plugs using the Smart Home API with OAuth2 authentication, offering real-time device state management and control operations.
            Last updated -
            1
            TypeScript
          • A
            security
            A
            license
            A
            quality
            Enables AI assistants to control SwitchBot devices, providing functionalities like device management, scene execution, and sensor information monitoring through the SwitchBot API.
            Last updated -
            3
            3
            JavaScript
            ISC License
          • 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

          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/guilhermelirio/homeassistant-mpc'

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