Back to MCP directory
publicPublicdnsLocal runtime

OpenHue

一个通过Claude等LLM接口控制飞利浦Hue智能灯的MCP服务器项目

article

README

🚀 OpenHue MCP 服务器

OpenHue MCP 服务器借助 OpenHue CLI 实现对飞利浦 Hue 灯光的控制,同时支持与 Claude 及其他 LLM 接口进行交互,为您的灯光控制带来更加智能便捷的体验。

🚀 快速开始

在使用该服务器前,您需要完成一些先决条件的准备工作,并进行门桥设置。

先决条件

门桥设置

在使用服务器之前,需要通过 OpenHue CLI 设置与您的 Hue 门桥:

  1. 运行安装命令:
# 在 Linux/macOS 上:
docker run -v "${HOME}/.openhue:/.openhue" --rm --name=openhue -it openhue/cli setup

# 在 Windows(PowerShell)上:
docker run -v "${env:USERPROFILE}\.openhue:/.openhue" --rm --name=openhue -it openhue/cli setup
  1. 按照屏幕上的指示操作:
    • CLI 会搜索您的 Hue 门桥
    • 在提示时按下 Hue 门桥的链接按钮
    • 等待确认设置完成
  2. 通过列出灯光进行验证:
# 在 Linux/macOS 上:
docker run -v "${HOME}/.openhue:/.openhue" --rm --name=openhue -it openhue/cli get lights

# 在 Windows(PowerShell)上:
docker run -v "${env:USERPROFILE}\.openhue:/.openhue" --rm --name=openhue -it openhue/cli get lights

如果看到列出的灯光,说明设置完成,您可以开始使用 MCP 服务器。

📦 安装指南

  1. 克隆仓库:
git clone <your-repo-url>
cd claude-mcp-openhue
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build
  1. 运行服务器:
npm start

✨ 主要特性

此服务器通过 MCP 提供以下功能:

灯光控制

  • 列出所有灯光或指定灯光的信息
  • 开启/关闭灯光
  • 调整亮度和颜色

房间控制

  • 获取房间信息
  • 获取房间内所有灯光状态
  • 控制房间内的灯光

场景管理

  • 创建、删除和更新场景
  • 列出所有场景
  • 应用指定的场景

📚 详细文档

开发

项目结构

.
├── src/
│   └── index.ts    # 主服务器实现文件
├── build/          # 编译后的 JavaScript 文件夹
├── package.json
├── tsconfig.json
└── README.md

构建

npm run build

运行

npm start

故障排除

服务器无法连接

  1. 检查 Docker 是否在运行
  2. 验证 OpenHue 配置是否存在
  3. 查看 Claude 桌面版日志
  4. 尝试直接运行 OpenHue CLI

命令失败

  1. 检查 OpenHue CLI 权限
  2. 确认灯光/房间/场景名称正确
  3. 查看 Docker 容器日志
  4. 验证 Hue 门桥连接性

📄 许可证

MIT License

🤝 贡献

  1. 叉取仓库
  2. 创建功能分支
  3. 提交您的更改
  4. 推送到分支
  5. 提出新的 Pull Request
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