Tapo
Control Tapo devices using npx mcporter call tapo.<tool>.
Setup
You need a Tapo MCP server running on your network (HTTP transport). Bearer token auth is recommended.
- 1. Add the Tapo server:
CODEBLOCK0
- 2. Verify:
npx mcporter list tapo --schema
You should see
list_devices,
check_device,
get_device_state, and
control_device.
See references/setup.md for the full walkthrough, config management, and troubleshooting.
Tools
list_devices
List all Tapo devices on the network.
CODEBLOCK2
Returns each device's id, name, model, ip, set_capabilities, get_capabilities, and children (for power strips).
check_device
Verify a device ID matches at a given IP.
CODEBLOCK3
getdevicestate
Get a device's current state. Automatically runs check_device first.
CODEBLOCK4
control_device
Control a device. Automatically runs check_device first.
CODEBLOCK5
Usage rules
- 1. Always run
list_devices first if you don't have a recent device list. Cache results for up to 30 minutes. - Use the device
id and ip from the list — never guess or hardcopy these values. - For power strips (e.g. P304M), children have their own
id. Use the child id with the parent's ip.
Tapo
使用 npx mcporter call tapo.<工具> 控制 Tapo 设备。
设置
你需要在网络上运行一个 Tapo MCP 服务器(HTTP 传输)。建议使用 Bearer 令牌认证。
- 1. 添加 Tapo 服务器:
bash
npx mcporter config add tapo http://MCPIP> \
--transport http \
--header Authorization=Bearer \
--scope home
- 2. 验证:
bash
npx mcporter list tapo --schema
你应该能看到 listdevices、checkdevice、getdevicestate 和 control_device。
完整指南、配置管理和故障排除请参见 references/setup.md。
工具
list_devices
列出网络上的所有 Tapo 设备。
bash
npx mcporter call tapo.list_devices
返回每个设备的 id、name、model、ip、setcapabilities、getcapabilities 以及 children(针对电源排插)。
check_device
验证指定 IP 上的设备 ID 是否匹配。
bash
npx mcporter call tapo.checkdevice id=ID> ip=
getdevicestate
获取设备的当前状态。会自动先运行 check_device。
bash
npx mcporter call tapo.getdevicestate id= ip= capability={type: DeviceInfo}
control_device
控制设备。会自动先运行 check_device。
bash
开启
npx mcporter call tapo.control
device id=ID> ip= capabilities=[{type: OnOff, value: true}]
关闭
npx mcporter call tapo.controldevice id=ID> ip= capabilities=[{type: OnOff, value: false}]
设置亮度(1-100,仅限灯光设备)
npx mcporter call tapo.controldevice id=ID> ip= capabilities=[{type: Brightness, value: 50}]
设置颜色(仅限彩色灯光设备)
npx mcporter call tapo.controldevice id=ID> ip= capabilities=[{type: Color, value: Coral}]
同时设置多个功能
npx mcporter call tapo.controldevice id=ID> ip= capabilities=[{type: Color, value: Coral}, {type: Brightness, value: 50}]
使用规则
- 1. 如果没有最近的设备列表,请始终先运行 list_devices。结果可缓存最多 30 分钟。
- 使用列表中的设备 id 和 ip——切勿猜测或硬拷贝这些值。
- 对于电源排插(例如 P304M),子设备有自己的 id。使用子设备的 id 配合父设备的 ip。