Back to MCP directory
publicPublicdnsLocal runtime

mcp-philips-hue

一个用于控制飞利浦Hue智能灯光的MCP服务器,支持灯光开关、亮度调节和颜色设置等功能

article

README

🚀 mcp-philips-hue

这是一个用于控制飞利浦Hue智能灯的MCP(模型上下文协议)服务器,可帮助你轻松管理和控制飞利浦Hue智能灯的各项功能。

🚀 快速开始

本项目是一个用于控制飞利浦Hue智能灯的MCP服务器。要使用该服务器,你需要完成以下几个步骤:获取Hue API密钥、安装项目、进行配置,之后就可以使用提供的命令来控制灯光了。

✨ 主要特性

  • get_lights - 列出所有连接到你的Hue桥接器的灯光。
  • set_brightness - 为单个或所有灯光调整亮度(范围0 - 254)。
  • set_color - 使用十六进制代码、颜色名称或色温来改变灯光颜色。
  • toggle_light - 打开或关闭灯光。

📦 安装指南

从npm安装(推荐)

npx mcp-philips-hue

从源代码安装

git clone https://github.com/m2ai-mcp-servers/mcp-philips-hue.git
cd mcp-philips-hue
npm install
npm run build

📚 详细文档

获取Hue API密钥

  1. 在https://discovery.meethue.com/ 找到你的桥接器IP地址。
  2. 访问 http://<桥接器IP>/debug/clip.html
  3. 按下你的Hue桥接器上的链接按钮。
  4. 在30秒内,向 /api 发送POST请求,请求体为:{"devicetype":"mcp-server#user"}
  5. 从响应中复制 username,这就是你的API密钥。

配置

环境变量

export HUE_BRIDGE_IP=192.168.1.x
export HUE_API_KEY=your-api-key-here

Claude桌面配置

在你的 claude_desktop_config.json 中添加以下内容:

{
  "mcpServers": {
    "philips-hue": {
      "command": "npx",
      "args": ["-y", "mcp-philips-hue"],
      "env": {
        "HUE_BRIDGE_IP": "192.168.1.x",
        "HUE_API_KEY": "your-api-key-here"
      }
    }
  }
}

颜色选项

命名颜色

红色、绿色、蓝色、黄色、橙色、紫色、粉色、白色、青色、品红色

色温

  • warm(2200K)
  • soft(2500K)
  • neutral(3500K)
  • cool(5000K)
  • daylight(6500K)
  • 或者直接指定开尔文值:2700K4000K 等。

开发

# 监听模式
npm run dev

# 运行测试
npm test

# 构建
npm run build

测试

npm test

💻 使用示例

列出所有灯光

get_lights

设置亮度

set_brightness light_id="1" brightness=200
set_brightness light_id="all" brightness=100

设置颜色

# 使用十六进制颜色
set_color light_id="1" color="#FF0000"

# 使用颜色名称
set_color light_id="1" color="blue"

# 使用色温
set_color light_id="1" color="warm"
set_color light_id="all" color="2700K"

切换灯光状态

toggle_light light_id="1" state=true
toggle_light light_id="all" state=false

📄 许可证

本项目采用MIT许可证。


GRIMLOCK - 自主MCP服务器工厂自主构建

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client