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
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.
| Part | Spec / notes | Needed | Price |
|---|---|---|---|
| ESP32-S3 board | Target chip of the bread-compact-wifi build | Required | |
| 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 | Optional | View on Amazon | |
| M5Stack CoreS3 | Optional | View 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.
Steps
- Skill level
- Intermediate
- Flash the ready-made firmware (Beginner’s Firmware Flashing Guide, Feishu)
- It connects to xiaozhi.me by default; register an account there
- 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.
| Layer | Component | Runs on |
|---|---|---|
| Wake word | ESP-SR, offline | Device |
| Server | Official xiaozhi.me server, by default | xiaozhi.me |
| Transport | WebSocket or MQTT + UDP, Opus audio | Device |
| Tools | MCP 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.
Hardware
- ESP32-S3
- I2S mic
- speaker
- optional LCD
Credits and links
- 78 (Xiage): Creator
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.
Markdown
[](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>Related builds
All 44 in Voice Assistants & CompanionsESP32-S3 voice frontend
An ESP32-S3 voice frontend that keeps GPIO and network actions local.
- ESP32-S3
- INMP441 I2S mic
- MAX98357A amp/speaker (Gerbers optional)
Intermediate
KALO ESP32 Voice Chat AI Friends
Chat with several custom AI friends on an ESP32.
- ESP32
- mic
- speaker
Intermediate76
ESP32 AI LLM
ESP32 voice chat with 15 LLMs, wake word and live on-screen text.
- ESP32/ESP32-S3
- mic
- display
Intermediate572


ElatoAI
Realtime AI Speech powered by 100+ Voice AI models on ESP32, with Secure WebSockets and Edge Functions.
- ESP32-S3
- speaker
Intermediate · Our suggestion2.1K
Sources
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L11
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L25-L27
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L34-L35
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L28-L31
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L50
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L32
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L24
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L14-L19
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L137-L142
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L36
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.json#L2-L4
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L14-L16
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L17-L19
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L37-L47
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/main/boards/bread-compact-wifi/config.h#L32-L35
- github.com/78/xiaozhi-esp32/blob/8dc6d4588368a2091bf4f577e8b03a491c28fd71/README.md?plain=1#L53
- github.com/78/xiaozhi-esp32/blob/8dc6d4588368a2091bf4f577e8b03a491c28fd71/README.md?plain=1#L54
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L110
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L114-L119
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L25
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L26-L27
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L106-L131
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L17
- github.com/78/xiaozhi-esp32/blob/e0d2390a1ca415473508bbc0c66eaf1d8dc04e37/README.md?plain=1#L40-L44