Skip to main content
Glama
OpenHue MCP Server

OpenHue MCP Server

by lsemenenko

OpenHue MCP 服务器

MCP 服务器可使用 OpenHue CLI 通过 Claude 和其他 LLM 接口控制飞利浦 Hue 灯。

先决条件

Related MCP server: Philips Hue MCP Service

桥接设置

在使用服务器之前,您需要使用 Hue Bridge 设置 OpenHue CLI:

  1. 运行安装命令:

# On Linux/macOS:
docker run -v "${HOME}/.openhue:/.openhue" --rm --name=openhue -it openhue/cli setup

# On Windows (PowerShell):
docker run -v "${env:USERPROFILE}\.openhue:/.openhue" --rm --name=openhue -it openhue/cli setup
  1. 按照屏幕上的说明进行操作:

    • CLI 将搜索您的 Hue Bridge

    • 出现提示时,按下 Hue Bridge 上的链接按钮

    • 等待确认设置完成

  2. 通过列出灯光来验证设置:

# On Linux/macOS:
docker run -v "${HOME}/.openhue:/.openhue" --rm --name=openhue -it openhue/cli get lights

# On 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 公开以下功能:

灯光控制

  • 列出所有灯光或获取特定灯光的详细信息

  • 打开/关闭灯

  • 调整亮度

  • 设置颜色

  • 控制色温

房间控制

  • 列出所有房间或获取房间详细信息

  • 同时控制房间内的所有灯光

  • 设置整个房间的亮度和颜色

场景管理

  • 列出可用场景

  • 使用不同模式激活场景

  • 按房间过滤场景

与 Claude Desktop 一起使用

  1. 打开您的 Claude Desktop 配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

  2. 添加服务器配置:

{
  "mcpServers": {
    "hue": {
      "command": "node",
      "args": ["/absolute/path/to/build/index.js"]
    }
  }
}
  1. 重启Claude桌面

  2. 查找锤子图标以验证服务器是否已连接

示例命令

连接后,您可以向 Claude 询问自然语言问题,例如:

  • “客厅里有什么灯?”

  • “把厨房里的灯都打开”

  • “将卧室灯光亮度设置为 50%”

  • “把办公室的灯换成蓝色”

  • “激活‘放松’场景”

  • “书房里有哪些场景可以拍摄?”

可用工具

获取灯光

列出所有灯光或获取特定灯光的详细信息

{
  lightId?: string;  // Optional light ID or name
  room?: string;     // Optional room name filter
}

控制灯

控制单个灯光

{
  target: string;    // Light ID or name
  action: "on" | "off";
  brightness?: number; // 0-100
  color?: string;     // Color name
  temperature?: number; // 153-500 Mirek
}

获取房间

列出所有房间或获取特定房间的详细信息

{
  roomId?: string;  // Optional room ID or name
}

控制室

控制房间内的所有灯光

{
  target: string;    // Room ID or name
  action: "on" | "off";
  brightness?: number;
  color?: string;
  temperature?: number;
}

获取场景

列出可用的场景

{
  room?: string;    // Optional room name filter
}

激活场景

激活特定场景

{
  name: string;     // Scene name or ID
  room?: string;    // Optional room name
  mode?: "active" | "dynamic" | "static";
}

发展

项目结构

.
├── src/
│   └── index.ts    # Main server implementation
├── build/          # Compiled JavaScript
├── package.json
├── tsconfig.json
└── README.md

建筑

npm run build

跑步

npm start

故障排除

服务器未连接

  1. 检查 Docker 是否正在运行

  2. 验证 OpenHue 配置是否存在

  3. 检查 Claude Desktop 日志

  4. 尝试直接运行 OpenHue CLI

命令失败

  1. 检查 OpenHue CLI 权限

  2. 验证灯光/房间/场景名称

  3. 检查 Docker 容器日志

  4. 验证 Hue Bridge 连接

执照

MIT 许可证

贡献

  1. 分叉存储库

  2. 创建你的功能分支

  3. 提交你的更改

  4. 推送到分支

  5. 创建新的 Pull 请求

Available Tools

6 tools
activate-sceneC

Activate a specific scene

Inputs: name (required), mode, room.

control-lightC

Control a specific Hue light

Inputs: action (required), target (required), brightness, color, +1 more.

control-roomC

Control all lights in a room

Inputs: action (required), target (required), brightness, color, +1 more.

get-lightsB

List all Hue lights or get details for a specific light

Inputs: lightId, room.

get-roomsB

List all rooms or get details for a specific room

Inputs: roomId.

get-scenesC

List all scenes or get details for specific scenes

Inputs: room.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: activate-scene targets scene activation, control-light and control-room handle light control at different granularities, and the get-* tools retrieve specific resource types. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb-noun pattern with hyphen separation (e.g., activate-scene, control-light, get-lights). The naming is uniform across all tools, with no deviations in style or convention, ensuring predictability and readability.

    Tool Count5/5

    With 6 tools, the server is well-scoped for managing Philips Hue devices. The count is appropriate, covering core operations like control and retrieval for lights, rooms, and scenes without being overly sparse or bloated, fitting typical home automation workflows.

    Completeness4/5

    The toolset provides solid coverage for the Hue domain, including control and retrieval for lights, rooms, and scenes. A minor gap exists in missing update or delete operations for scenes or rooms, but agents can still accomplish most common tasks with the available tools.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables control of Philips Hue lights through VS Code Copilot or Claude Desktop using natural language commands. Supports turning lights on/off, adjusting brightness, changing colors, and listing available lights on your Hue Bridge.
      2
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables control of Philips Hue lights through the Model Context Protocol, providing tools for turning lights on/off, setting brightness and color, and retrieving light status.
      1
      Apache 2.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      Controls Philips Hue lights based on Claude Code session events, using color animations to indicate Claude's status (thinking, working, success, etc.).
      10
      -