TH

timcinel/homekit-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

10 stars 8 forks 质量 49 趋势 18MIT

家用设备 MCP

概览

HTTP基于HomeKit的模型上下文协议(MCP)服务器. 提供列出和管理HomeKit配件和房间的工具. 还有一个脚本 帮助管理家庭助理的配件 跨房间, 这是所有这一切的实际动机。 这作为macOS应用而非CLI工具执行,因为HomeKit需要一个签名的二进制,拥有适当的应享权利,只能通过Xcode项目实现. - macOS 13.0+ 有 HomeKit 设置 - Xcode (带有命令行工具) - Apple ID (可开发的自由级) - HomeKit 配件配置于 Home app 服务器将启动于 http://localhost:8080. 如果您宁可直接针对 HTTP 服务进行脚本编写, 请使用脚本/ homekitctl.py 中的轻量级 Python CLI 。 它只使用Python标准库,因此只要能通过HTTP到达Mac主机,它就可以从非macOS机上运行. CLI会谈默认为[T1].

概述(AI 翻译)

HTTP基于HomeKit的模型上下文协议(MCP)服务器. 提供列出和管理HomeKit配件和房间的工具.

也为HomeKit提供CLI.

还有一个脚本 帮助管理家庭助理的配件 跨房间, 这是所有这一切的实际动机。

这作为macOS应用而非CLI工具执行,因为HomeKit需要一个签名的二进制,拥有适当的应享权利,只能通过Xcode项目实现.

□ 先决条件

  • macOS 13.0+ 与 HomeKit 设置
  • Xcode(带有命令行工具)
  • 苹果ID(可开发的免费等级)
  • HomeKit 应用程序中配置的 HomeKit 配件

□ 快开始

服务器将从http://localhost:8080开始.

添加到 Claude 代码 :

□ 可用的 MCP 工具

  • 工具 * * 描述 * 参数 * * |-------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

get_all_rooms 列出所有有名字和UUID的家用设备 set_accessory_room 使用UUIDs ,[[T4],[[T5] 将附属设备移到另一个房间 get_accessory_by_name 找到一个名字的家用设备附属物name

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

HomeKit MCP … and CLI … and Room Plan/Apply script

HTTP-based Model Context Protocol (MCP) server for HomeKit. Provides tools to list and manage HomeKit accessories and rooms.

Also a CLI for HomeKit.

Also a script to help manage Home Assistant accessories across rooms, which is the actual motivation for all of this.

This is implemented as a macOS app rather than a CLI tool because HomeKit requires a signed binary with proper entitlements that can only be achieved through an Xcode project.

Prerequisites

  • macOS 13.0+ with HomeKit setup
  • Xcode (with Command Line Tools)
  • Apple ID (free tier sufficient for development)
  • HomeKit accessories configured in the Home app

Quick Start

git clone https://github.com/TimCinel/HomeKitSync.git
cd HomeKitSync
make build
make run

The server will start on http://localhost:8080.

Add to Claude Code:

claude mcp add --transport http homekit http://localhost:8080/mcp

Available MCP Tools

Tool Description Parameters
get_all_accessories List all HomeKit accessories with names, rooms, categories, and UUIDs None
get_all_rooms List all HomeKit rooms with names and UUIDs None
set_accessory_room Move an accessory to a different room using UUIDs accessory_uuid, room_uuid
get_accessory_by_name Find a HomeKit accessory by name name
get_room_by_name Find a HomeKit room by name name
set_accessory_room_by_name Move an accessory to a different room using names accessory_name, room_name
rename_accessory Rename a HomeKit accessory accessory_name, new_name
rename_room Rename a HomeKit room room_name, new_name
get_room_accessories Get all accessories in a specific room room_name
accessory_on Turn on an accessory (lights, switches) or open covers accessory_name
accessory_off Turn off an accessory (lights, switches) or close covers accessory_name
accessory_toggle Toggle an accessory between on/off or open/close accessory_name

Available CLI Tools

CLI Wrapper

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →