git clone https://github.com/hlym123/xiaozhi_mcp_examples.gitcd xiaozhi_mcp_examples
pip install -r irequirement先获取你设备的 MCP_ENDPOINT,进入 xiaozhi 控制台 ,点击配置角色,再点击右下角的 MCP接入点,复制。
export MCP_ENDPOINT=<you_mcp_endpoint>python mcp_pipe.py server.py# 发布消息测试
mosquitto_pub -h test.mosquitto.org -t esp32/temphumi -m '{"temperature":24.8,"humidity":55.3}'# 订阅消息测试
mosquitto_sub -h test.mosquitto.org -t "esp32/rgbled"# 订阅消息测试
mosquitto_sub -h test.mosquitto.org -t "esp32/fan"唤醒 xiaozhi,语音对话,说 “开灯,关灯,获取温湿度” 等命令测试。
硬件准备:
- 复制程序 m5_device.py 内容到编辑区
- 连接设备
- 运行程序



