Skip to content
HardwareLab

XiaoZhi ESP32

An MCP-based AI chatbot firmware that turns ESP32 boards into voice assistants.

Hardware:
ESP32-S3, I2S mic, speaker, optional LCD
Difficulty:
Intermediate
Creator:
78 (Xiage)

Firmware that turns ESP32 boards into MCP voice assistants

XiaoZhi ESP32
Image hot-linked from the original post.The creator’s demo videos are on bilibili, linked from the README; we only embed YouTube, X, Reddit or Vimeo.

By 78 (Xiage)

Likes on X
322 (X post)

What it does

An MCP-based AI chatbot firmware that turns ESP32 boards into voice assistants. It handles wake word and streaming speech, uses large models such as Qwen and DeepSeek, and controls IoT devices through MCP tools.

  • A voice chatbot for ESP32 boards that uses large models such as Qwen or DeepSeek and controls devices through MCP.
  • Offline wake word with ESP-SR (custom wake words), then streaming speech recognition, LLM and TTS over WebSocket or MQTT + UDP.
  • Device-side MCP controls speakers, LEDs, servos and GPIO; cloud-side MCP adds smart-home control, desktop operation, knowledge search and email.
  • Speaker recognition, OLED or LCD faces, camera vision on supported boards, and 39 interface languages.
  • Supports 138 board directories and 171 release variants.
  • Runs on ESP32, ESP32-C3, C5, C6, S3 and P4 chips.
  • Connects over Wi-Fi, wired Ethernet, USB RNDIS or Cat.1 4G, depending on the board.

What you need

Skill level
Intermediate
License
No license stated

Parts

  • ESP32-S3 board
  • I2S microphone
  • I2S speaker
  • 128×32 or 128×64 I2C OLED (SSD1306 or SH1106) [optional]
  • Push buttons (boot, touch, volume up and down) [optional]
  • Espressif ESP32-S3-BOX-3 [optional]
  • M5Stack CoreS3 [optional]
AI model or service
large models such as Qwen/DeepSeek, MCP, streaming ASR/TTS
Accounts needed
xiaozhi.me account

Prices, notes and sources: Parts and requirements

Parts and requirements

As an Amazon Associate HardwareLab earns from qualifying purchases.

PartSpec / notesNeededPrice
ESP32-S3 board Target chip of the bread-compact-wifi buildRequired
I2S microphone Required
I2S speaker Required
128×32 or 128×64 I2C OLED (SSD1306 or SH1106) Optional
Push buttons (boot, touch, volume up and down) Optional
Espressif ESP32-S3-BOX-3 OptionalView on Amazon
M5Stack CoreS3 OptionalView on Amazon
  • Computer for setup: For building: Cursor or VS Code with the ESP-IDF plugin, ESP-IDF v6.0.1 or later; Linux is faster than Windows
  • xiaozhi.me account: to use the Qwen real-time model for free (personal users)

Parts used: Espressif ESP32-S3-BOX-3 (Amazon)As an Amazon Associate HardwareLab earns from qualifying purchases.

Full build guide

Steps

Skill level
Intermediate
  1. Flash the ready-made firmware (Beginner’s Firmware Flashing Guide, Feishu)
  2. It connects to xiaozhi.me by default; register an account there
  3. Configure the model in the xiaozhi.me console

Full instructions: View original

How it works

Offline voice wake-up with ESP-SR, then Opus audio streaming over WebSocket or MQTT + UDP, with streaming ASR + LLM + TTS pipelines or realtime end-to-end voice models; MCP lets the model control devices.

LayerComponentRuns on
Wake wordESP-SR, offline Device
ServerOfficial xiaozhi.me server, by default xiaozhi.me
TransportWebSocket or MQTT + UDP, Opus audio Device
ToolsMCP on the device and in the cloud Device + Cloud

Setup effort

Skill level
Intermediate

Beginners can flash ready-made firmware without a development environment; building from source needs ESP-IDF v6.0.1 or later.

Limits and caveats

  • Current code needs ESP-IDF v6.0.1 or later; ESP-IDF 5.x is no longer supported.
  • The firmware connects to the official xiaozhi.me server by default.
  • The breadboard tutorial is a Feishu document.

Like this build? Get the weekly builds

Every Thursday: the 5 best gadget hacks you can copy. Free.

Built something? Submit a build

The creator's config

Copied word for word from the creator's repository, at the commit linked in each source.

  • Audio pin map (config.h)

    #define AUDIO_I2S_MIC_GPIO_WS   GPIO_NUM_4
    #define AUDIO_I2S_MIC_GPIO_SCK  GPIO_NUM_5
    #define AUDIO_I2S_MIC_GPIO_DIN  GPIO_NUM_6
    #define AUDIO_I2S_SPK_GPIO_DOUT GPIO_NUM_7
    #define AUDIO_I2S_SPK_GPIO_BCLK GPIO_NUM_15
    #define AUDIO_I2S_SPK_GPIO_LRCK GPIO_NUM_16

Use-case ideas

  • Deploy a server on your own computer with one of the listed open-source projects (Python, Java or Go).
  • Customize wake words, fonts, emojis and chat backgrounds with the web-based assets generator.

Why it's interesting

What stands out is how far the firmware has spread: the README lists 138 board directories and 171 release variants across ESP32, ESP32-C3, C5, C6, S3 and P4, from the Espressif ESP32-S3-BOX-3 and M5Stack CoreS3 to Waveshare and LILYGO boards, plus a breadboard build. Wake-up runs on the device with ESP-SR and custom wake words, while streaming speech recognition, the LLM (such as Qwen or DeepSeek) and TTS are reached over WebSocket or MQTT + UDP. MCP works on both sides: device-side for speakers, LEDs, servos and GPIO, cloud-side for smart-home control and search. Setup gotcha: current code needs ESP-IDF v6.0.1 or later, and 5.x is no longer supported. By default it connects to the official xiaozhi.me server, where personal accounts can use the Qwen real-time model for free; for running a server on your own computer the README lists four open-source projects, one of them XiaoZhi ESP32 Server (Python), also listed here.

Source: github.com/78/xiaozhi-esp32#readme

Hardware

  • ESP32-S3
  • I2S mic
  • speaker
  • optional LCD

More ESP32 builds

Credits and links

This page is a short summary written by HardwareLab. Build steps, code and photos belong to the creator; follow “View original” for the full project.

Featured? Add this badge

Built this? Paste the badge into your README. It links back to this page.

Featured on HardwareLab

Markdown

[![Featured on HardwareLab](https://hardwarelab.dev/badge.svg)](https://hardwarelab.dev/projects/xiaozhi-esp32/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w)

HTML

<a href="https://hardwarelab.dev/projects/xiaozhi-esp32/?utm_source=badge&utm_medium=referral&utm_campaign=launch_2w"><img src="https://hardwarelab.dev/badge.svg" alt="Featured on HardwareLab" width="188" height="20"></a>

Sources

  1. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L11
  2. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L25-L27
  3. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L34-L35
  4. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L28-L31
  5. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L50
  6. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L32
  7. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L24
  8. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L14-L19
  9. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L137-L142
  10. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L36
  11. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.json#L2-L4
  12. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L14-L16
  13. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L17-L19
  14. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L37-L47
  15. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L32-L35
  16. github.com/78/xiaozhi-esp32/blob/8dc6d4588368a2091bf4f577e8b03a491c28fd71/README.md?plain=1#L53
  17. github.com/78/xiaozhi-esp32/blob/8dc6d4588368a2091bf4f577e8b03a491c28fd71/README.md?plain=1#L54
  18. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L110
  19. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L114-L119
  20. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L25
  21. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L26-L27
  22. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L106-L131
  23. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L17
  24. github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L40-L44