Skip to main content
Glama

Philips Hue MCP Server

by ThomasRohde

飞利浦 Hue MCP 服务器

用于控制飞利浦 Hue 智能照明系统的强大的模型上下文协议 (MCP) 接口。

目录

概述

该服务器利用模型上下文协议 (MCP),实现 Claude 等 AI 助手与您的飞利浦 Hue 照明系统之间的无缝集成。借助它,您可以使用自然语言控制智能灯,访问详细的照明信息,并通过标准化的 AI 友好界面创建高级照明设置。

特征

  • 完整的灯光控制:打开/关闭、调节亮度、改变颜色、设置色温

  • 综合组管理:同时控制多个灯,创建自定义组

  • 场景处理:应用现有场景,创建快速自定义照明场景

  • 基于活动的预设:用于阅读、放松、集中注意力等的现成设置

  • 特殊效果:访问动态灯光效果,如颜色循环

  • 自然语言控制:通过对话进行照明控制的专门提示

  • 安全本地集成:直接连接到本地网络上的 Hue 桥

快速入门

# Install dependencies pip install phue mcp # Run the server python hue_server.py # Install in Claude Desktop mcp install hue_server.py --name "My Hue Lights"

然后在 Claude 中,首先说:“我想控制我的飞利浦 Hue 灯。你能告诉我有哪些可用的灯吗?”

设置

先决条件

  • Python 3.9+

  • 本地网络上的飞利浦 Hue 桥接器

  • 飞利浦 Hue 灯与您的桥梁配对

安装

  1. 克隆此存储库或下载hue_server.py文件

  2. 安装所需的依赖项:

pip install phue mcp

首次运行

  1. 运行服务器:

python hue_server.py
  1. 出现提示时,按下 Hue 桥上的链接按钮以授权连接

  2. 您的连接详细信息将保存在~/.hue-mcp/config.json中以供将来使用

与 Claude 一起使用

选项 1:在 Claude Desktop 中安装

如果您已安装 Claude Desktop:

mcp install hue_server.py --name "Philips Hue Controller"

选项 2:使用 MCP 检查器进行测试

对于开发和测试:

mcp dev hue_server.py

API 参考

资源

资源

描述

hue://lights

有关所有灯光的信息

hue://lights/{light_id}

有关特定灯光的详细信息

hue://groups

所有灯组信息

hue://groups/{group_id}

有关特定群体的信息

hue://scenes

所有场景信息

工具

工具

描述

get_all_lights

获取所有灯光的信息

get_light

获取特定灯光的详细信息

get_all_groups

获取所有灯光组的信息

get_group

获取有关特定组的信息

get_all_scenes

获取所有场景的信息

turn_on_light

打开特定的灯

turn_off_light

关闭特定的灯

set_brightness

调节灯光亮度(0-254)

set_color_rgb

使用 RGB 值设置灯光颜色

set_color_temperature

设置灯光色温(2000-6500K)

turn_on_group

打开一组中的所有灯

turn_off_group

关闭一组中的所有灯

set_group_brightness

调整组亮度(0-254)

set_group_color_rgb

设置组内所有灯光的颜色

set_scene

将场景应用到组

find_light_by_name

按名称搜索灯光

create_group

创建新的灯光组

quick_scene

应用自定义设置来创建场景

refresh_lights

更新灯光信息缓存

set_color_preset

将颜色预设应用于灯光

set_group_color_preset

将颜色预设应用于组

alert_light

让灯光短暂闪烁

set_light_effect

设置颜色循环等动态效果

提示

迅速的

描述

control_lights

自然语言灯光控制

create_mood

为活动设置情绪照明

light_schedule

了解调度选项

示例

控制单盏灯

# Turn on a light turn_on_light(1) # Set a light to 50% brightness set_brightness(1, 127) # Change a light color to purple set_color_rgb(1, 128, 0, 128) # Set reading mode set_color_preset(1, "reading")

与团体合作

# Turn off all lights in living room (group 2) turn_off_group(2) # Create a new group create_group("Bedroom", [3, 4, 5]) # Set all kitchen lights to energizing mode set_group_color_preset(3, "energize")

创建场景

# Apply an existing scene set_scene(2, "abc123") # Group 2, scene ID abc123 # Create a quick relaxing scene for the living room quick_scene("Evening Relaxation", group_id=2, rgb=[255, 147, 41], brightness=120)

高级选项

使用自定义设置运行服务器:

python hue_server.py --host 0.0.0.0 --port 8888 --log-level debug

故障排除

  • 未找到桥接器:如果自动发现不起作用,您有两个选择:

    1. 使用网桥的 IP 地址手动编辑脚本中的BRIDGE_IP变量

    2. 手动创建配置文件:

      # Create the config directory mkdir -p ~/.hue-mcp # Create a config.json file with your bridge IP echo '{"bridge_ip": "192.168.1.x"}' > ~/.hue-mcp/config.json

      将“192.168.1.x”替换为您的实际 Hue 桥接器 IP 地址

  • 连接问题:删除~/.hue-mcp/config.json并重新启动服务器以重新进行身份验证

  • 灯光控制不工作:使用refresh_lights工具更新灯光信息缓存

  • 群组或场景未显示:重新启动网桥和服务器以同步所有数据

工作原理

该服务器使用phue Python 库连接到您的飞利浦 Hue 桥接器,并通过模型上下文协议 (MCP) 公开功能。当像 Claude 这样的 AI 连接时:

  1. 服务器使用存储的凭证与您的网桥进行身份验证

  2. 它提供描述您的照明设置的资源

  3. 它展示了克劳德可以用来控制灯光的工具

  4. 它提供提示,帮助 Claude 了解如何与灯光互动

为了确保安全和隐私,与 Hue 系统的所有通信都在您的网络内本地进行。

贡献

欢迎贡献!请随意:

  • 在问题跟踪器中报告错误并建议功能

  • 提交带有改进的拉取请求

  • 分享您如何在智能家居设置中使用它的示例

执照

该项目在 MIT 许可下可用。

-
security - not tested
-
license - not tested
-
quality - not tested

local-only server

The server can only run on the client's local machine because it depends on local resources.

模型上下文协议接口,使 Claude 等 AI 助手能够通过自然语言命令控制飞利浦 Hue 智能照明系统。

  1. 目录
    1. 概述
      1. 特征
        1. 快速入门
          1. 设置
            1. 先决条件
            2. 安装
            3. 首次运行
          2. 与 Claude 一起使用
            1. 选项 1:在 Claude Desktop 中安装
            2. 选项 2:使用 MCP 检查器进行测试
          3. API 参考
            1. 资源
            2. 工具
            3. 提示
          4. 示例
            1. 控制单盏灯
            2. 与团体合作
            3. 创建场景
          5. 高级选项
            1. 故障排除
              1. 工作原理
                1. 贡献
                  1. 执照

                    Related MCP Servers

                    • A
                      security
                      -
                      license
                      A
                      quality
                      Enables control of Philips Hue lights through Claude and other LLM interfaces using the OpenHue CLI.
                      Last updated -
                      6
                      9
                      MIT License
                      • Apple
                      • Linux
                    • A
                      security
                      -
                      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
                      197
                      MIT License
                      • Apple
                      • Linux
                    • A
                      security
                      -
                      license
                      A
                      quality
                      A Model Context Protocol service that enables remote management and control of NodeMCU/ESP8266 IoT devices with AI assistant integration through Claude Desktop.
                      Last updated -
                      4
                      1
                      MIT License
                    • -
                      security
                      -
                      license
                      -
                      quality
                      A Model Context Protocol (MCP) server that allows AI assistants like Claude to control real smart bulbs via UDP network communication, featuring voice commands, AI reasoning, and direct hardware control.
                      Last updated -
                      1

                    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/ThomasRohde/hue-mcp'

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