这是一个MCP服务器,通过OpenHue CLI使用Claude和其他LLM接口来控制Philips Hue灯光。
在使用服务器之前,你需要用你的Hue桥接器设置OpenHue CLI:
# 在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
按照屏幕上的指示操作:
通过列出你的灯光来验证设置:
# 在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服务器了。
git clone <your-repo-url>
cd claude-mcp-openhue
npm install
npm run build
npm start
此服务器通过MCP提供了以下功能:
打开你的Claude Desktop配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json添加服务器配置:
{
"mcpServers": {
"hue": {
"command": "node",
"args": ["/absolute/path/to/build/index.js"]
}
}
}
重启Claude Desktop
查看锤子图标以验证服务器是否已连接
一旦连接,你可以向Claude提出自然语言问题,例如:
列出所有灯光或获取特定灯光的详细信息
{
lightId?: string; // 可选的灯光ID或名称
room?: string; // 可选的房间名称过滤器
}
控制单个灯光
{
target: string; // 灯光ID或名称
action: "on" | "off";
brightness?: number; // 0-100
color?: string; // 颜色名称
temperature?: number; // 153-500 Mirek
}
列出所有房间或获取特定房间的详细信息
{
roomId?: string; // 可选的房间ID或名称
}
控制房间内所有灯光
{
target: string; // 房间ID或名称
action: "on" | "off";
brightness?: number;
color?: string;
temperature?: number;
}
列出可用场景
{
room?: string; // 可选的房间名称过滤器
}
激活特定场景
{
name: string; // 场景名称或ID
room?: string; // 可选的房间名称
mode?: "active" | "dynamic" | "static";
}
.
├── src/
│ └── index.ts # 主服务器实现
├── build/ # 编译后的JavaScript
├── package.json
├── tsconfig.json
└── README.md
npm run build
npm start
MIT许可证