# xiaozhi-esp32

> An MCP-based chatbot 一个基于MCP的聊天机器人

- Type: agent or tool
- Field: IoT & Hardware
- Repository: https://github.com/78/xiaozhi-esp32
- GitHub stars: 34035
- Licence: MIT
- Language: C++
- Last push: 2026-11-29
- Page: https://imutechz.in/agents/xiaozhi-esp32

## What it is
XiaoZhi ESP32 is an MCP-based voice chatbot firmware for Espressif chips (ESP32, ESP32-C3/C5/C6, ESP32-S3, ESP32-P4). It connects to large models like Qwen or DeepSeek via WebSocket or MQTT+UDP, runs offline wake-word detection with ESP-SR, streams Opus audio for ASR-LLM-TTS or realtime end-to-end voice pipelines, and exposes device-side MCP for GPIO, servo, LED, speaker control plus cloud-side MCP for smart-home, desktop, search, and email actions. The project supports 138 board variants, 39 UI languages, OLED/LCD with emoji, camera vision, battery management, and Wi-Fi/4G/Ethernet/USB-RNDIS networking.

## Features
- Offline wake-word with customizable phrases via ESP-SR
- Dual transport: WebSocket and MQTT+UDP with Opus streaming
- Device-side MCP for Speaker, LED, Servo, GPIO control
- Cloud-side MCP extending LLM to smart home, PC, search, email
- Speaker recognition using 3D-Speaker embeddings
- 39 interface languages with localized voice prompts

## Best for
- DIY voice assistants on ESP32-S3/ESP32-P4 hardware
- Embedded devices needing local wake-word and cloud LLM
- Multi-modal bots with display, camera, and sensor control
- MCP-enabled smart-home or robotics prototypes

## Pros
- Wide board support (138 directories, 171 build variants)
- Full-duplex realtime voice on AEC-capable hardware
- Web-based asset generator for wake words, fonts, emojis
- Battery, power management, and 4G fallback built-in

## Cons
- Requires ESP-IDF v6.0.1+ (v6.1 recommended); ESP-IDF 5.x unsupported
- ESP32-S3 builds need IDF 6.1 or later
- Complex toolchain and hardware bring-up for beginners

Tags: esp32, esp32-s3, esp32-p4, mcp, voice-assistant, wake-word, opus-audio, iot
