| 1 | # An MCP-based Chatbot |
| 2 | |
| 3 | (English | [中文](README_zh.md) | [日本語](README_ja.md)) |
| 4 | |
| 5 | ## Introduction |
| 6 | |
| 7 | 👉 [Human: Give AI a camera vs AI: Instantly finds out the owner hasn't washed hair for three days【bilibili】](https://www.bilibili.com/video/BV1bpjgzKEhd/) |
| 8 | |
| 9 | 👉 [Handcraft your AI girlfriend, beginner's guide【bilibili】](https://www.bilibili.com/video/BV1XnmFYLEJN/) |
| 10 | |
| 11 | As a voice interaction entry, the XiaoZhi AI chatbot leverages the AI capabilities of large models like Qwen / DeepSeek, and achieves multi-terminal control via the MCP protocol. |
| 12 | |
| 13 | <img src="docs/mcp-based-graph.jpg" alt="Control everything via MCP" width="320"> |
| 14 | |
| 15 | ## Recent Updates |
| 16 | |
| 17 | - The mainline now targets ESP-IDF v6.0 or later, with v6.0.2 as the preferred stable SDK. The complete 157-variant release matrix has been validated on ESP-IDF v6.0.1. |
| 18 | - MQTT and BluFi cryptographic code has migrated to PSA Crypto. IDF 6 component splits and third-party dependency compatibility have also been addressed. |
| 19 | - Audio pipeline concurrency, MQTT/UDP packet validation, and release-matrix selection have been hardened. |
| 20 | - ESP-IDF v5.5 is retained only for legacy hardware paths, including pre-v3 ESP32-P4 silicon. See the [ESP-IDF 6.0 Migration Guide](docs/esp-idf-6-migration.md) for full compatibility and board-validation details. |
| 21 | |
| 22 | ### Features Implemented |
| 23 | |
| 24 | - Wi-Fi, wired Ethernet, USB RNDIS, and ML307/EC801E or NT26 Cat.1 4G networking; supported boards can switch between Wi-Fi and 4G |
| 25 | - Offline voice wake-up with [ESP-SR](https://github.com/espressif/esp-sr), including customizable wake words |
| 26 | - Two communication transports: [WebSocket](docs/websocket.md) and [MQTT + UDP](docs/mqtt-udp.md) |
| 27 | - Opus audio streaming with conventional streaming ASR + LLM + TTS pipelines and Realtime end-to-end voice models; AEC-capable hardware supports realtime full-duplex interaction |
| 28 | - Speaker recognition, identifies the current speaker [3D Speaker](https://github.com/modelscope/3D-Speaker) |
| 29 | - OLED / LCD displays with emoji and rich expression support, plus camera vision input on supported boards |
| 30 | - Battery display and power management |
| 31 | - 38 interface languages, with localized voice prompts where available and English fallback |
| 32 | - ESP32, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-S3, and ESP32-P4 chip platforms |
| 33 | - Wi-Fi provisioning through hotspot, acoustic signaling, or BluFi |
| 34 | - Device-side MCP for device control (Speaker, LED, Servo, GPIO, etc.) |
| 35 | - Cloud-side MCP to extend large model capabilities (smart home control, PC desktop operation, knowledge search, email, etc.) |
| 36 | - Customizable wake words, fonts, emojis, and chat backgrounds with online web-based editing ([Custom Assets Generator](https://github.com/78/xiaozhi-assets-generator)) |
| 37 | |
| 38 | ## Hardware |
| 39 | |
| 40 | ### Breadboard DIY Practice |
| 41 | |
| 42 | See the Feishu document tutorial: |
| 43 | |
| 44 | 👉 ["XiaoZhi AI Chatbot Encyclopedia"](https://ccnphfhqs21z.feishu.cn/wiki/F5krwD16viZoF0kKkvDcrZNYnhb?from=from_copylink) |
| 45 | |
| 46 | Breadboard demo: |
| 47 | |
| 48 |  |
| 49 | |
| 50 | ### Supports 137 Board Directories and 157 Release Variants (Partial List) |
| 51 | |
| 52 | - <a href="https://oshwhub.com/li-chuang-kai-fa-ban/li-chuang-shi-zhan-pai-esp32-s3-kai-fa-ban" target="_blank" title="LiChuang ESP32-S3 Development Board">LiChuang ESP32-S3 Development Board</a> |
| 53 | - <a href="https://github.com/espressif/esp-box" target="_blank" title="Espressif ESP32-S3-BOX3">Espressif ESP32-S3-BOX3</a> |
| 54 | - <a href="https://docs.m5stack.com/zh_CN/core/CoreS3" target="_blank" title="M5Stack CoreS3">M5Stack CoreS3</a> |
| 55 | - <a href="https://docs.m5stack.com/en/atom/Atomic%20Echo%20Base" target="_blank" title="AtomS3R + Echo Base">M5Stack AtomS3R + Echo Base</a> |
| 56 | - <a href="https://gf.bilibili.com/item/detail/1108782064" target="_blank" title="Magic Button 2.4">Magic Button 2.4</a> |
| 57 | - <a href="https://www.waveshare.net/shop/ESP32-S3-Touch-AMOLED-1.8.htm" target="_blank" title="Waveshare ESP32-S3-Touch-AMOLED-1.8">Waveshare ESP32-S3-Touch-AMOLED-1.8</a> |
| 58 | - <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILY |