Tapo
v0.4.0通过 [Tapo MCP](https://github.com/mihai-dinculescu/tapo/tree/main/tapo-mcp) 控制 TP-Link Tapo 智能家居设备(灯、插头、电源条、中心和传感器、摄像头)。
运行时依赖
安装命令
点击复制技能文档
使用Tapo控制Tapo设备:npx mcporter call tapo.<工具>。 设置 您需要在网络中运行Tapo MCP服务器(v0.4.0或更高版本)(HTTP传输)。建议使用Bearer令牌身份验证。 添加Tapo服务器:npx mcporter config add tapo http:// \ --transport http \ --header "Authorization=Bearer " \ --scope home 验证:npx mcporter list tapo --schema 您应该看到list_devices、check_device、get_device_state、control_device和take_snapshot。 请参阅references/setup.md以获取完整的设置、配置管理和故障排除指南。 工具 list_devices 列出网络中的所有Tapo设备。 npx mcporter call tapo.list_devices 返回每个设备的id、name、model、ip、set_capabilities、get_capabilities和children(用于电源条和H100中心)。 check_device 验证设备ID是否与给定的IP匹配。 npx mcporter call tapo.check_device id="<设备ID>" ip="" get_device_state 获取设备的当前状态。自动先运行check_device。 # 设备信息 npx mcporter call tapo.get_device_state id="<设备ID>" ip="" capability='{"type": "DeviceInfo"}' # 触发日志(S200、T100、T110、T300中心的子设备)— 最新日志先显示 npx mcporter call tapo.get_device_state id="<子设备ID>" ip="<中心IP>" capability='{"type": "TriggerLogs", "page_size": 20, "start_id": 0}' # 最近24小时的温度/湿度记录(T310、T315中心的子设备) npx mcporter call tapo.get_device_state id="<子设备ID>" ip="<中心IP>" capability='{"type": "TemperatureHumidityRecords"}' control_device 控制设备。自动先运行check_device。 # 打开 npx mcporter call tapo.control_device id="<设备ID>" ip="" capabilities='[{"type": "OnOff", "value": true}]' # 关闭 npx mcporter call tapo.control_device id="<设备ID>" ip="" capabilities='[{"type": "OnOff", "value": false}]' # 设置亮度(1-100,仅限灯) npx mcporter call tapo.control_device id="<设备ID>" ip="" capabilities='[{"type": "Brightness", "value": 50}]' # 设置颜色(仅限彩色灯) npx mcporter call tapo.control_device id="<设备ID>" ip="" capabilities='[{"type": "Color", "value": "Coral"}]' # 同时设置多个功能 npx mcporter call tapo.control_device id="<设备ID>" ip="" capabilities='[{"type": "Color", "value": "Coral"}, {"type": "Brightness", "value": 50}]' take_snapshot 从Tapo摄像头捕获静态JPEG快照(~640x360)。自动先运行check_device。需要在服务器上配置TAPO_MCP_CAMERA_USERNAME和TAPO_MCP_CAMERA_PASSWORD(摄像头设置>高级设置>摄像头帐户,在Tapo应用程序中)。 npx mcporter call tapo.take_snapshot id="<设备ID>" ip="" 使用规则 如果您没有最近的设备列表,请始终先运行list_devices。缓存结果最长30分钟。使用设备ID和IP从列表中获取 — 永远不要猜测或硬编码这些值。对于电源条(例如P304M)和H100中心,子设备具有自己的ID。使用子设备ID和父设备IP。