xiaozhi-esp32

78MIT活跃维护

基于 MCP 协议、跑在 ESP32 上的聊天机器人固件,让单片机也能接入大模型对话与工具调用。

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

v2.5.2发布于 2026-10-11 20:49 UTC33,006star +164 / 7 天7,802fork同步于 2026-11-10 17:21 UTC

怎么上手

由 README 提炼,执行前请确认
安装 ESP-IDF v6.0.1 及以上(推荐 release/v6.1 分支),在 ESP-IDF 目录执行 git submodule update --init --recursive 并 source export.sh,再在项目目录运行 idf.py fullclean 后重新构建
硬件要求按 README 说明

面向 ESP32、ESP32-C3、ESP32-C5、ESP32-C6、ESP32-S3、ESP32-P4 芯片平台,支持 138 个开发板目录、171 个发布变体,含 ESP32-S3-BOX-3、M5Stack CoreS3、SenseCAP Watcher 等;README 未提及显存或 GPU 要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 ESP32 的 MCP 语音聊天机器人固件,把大模型语音交互落到硬件上

基于 MCP 协议、跑在 ESP32 上的聊天机器人固件,让单片机也能接入大模型对话与工具调用。

核心能力

  • 用 ESP-SR 实现离线语音唤醒,唤醒词可自定义
  • 支持 WebSocket 与 MQTT+UDP 两种通信传输
  • Opus 音频流配 ASR+LLM+TTS 管线与实时端到端语音模型
  • 设备端 MCP 控制扬声器、LED、舵机、GPIO 等外设
  • 云端 MCP 扩展智能家居、桌面操作、知识搜索等能力

容易踩的坑

ESP-IDF 5.x 已不再支持,最低需 v6.0.1;应使用 release/v6.1 分支而非 v6.1 发布标签,否则 ESP32-C3 可能出现 Wi-Fi 初始化失败;固件默认连接官方 xiaozhi.me 服务器,自建服务需另找第三方服务端项目。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.5.2
  1. v2.5.2最新正式版2026-10-11 · 2026-10-11 20:49 UTC

    188 firmware variants for 154 board directories, built with ESP-IDF 6.1.0.

    Source: 49b4380b3faa0ceadd28a3e78aaf0f311c46c57e. Build and validation.

    Each firmware ZIP contains merged-binary.bin. SHA-256 checksums and the complete variant manifest are attached. Builds and package checks do not replace physical hardware validation.

    What's Changed

    New Contributors

    Full Changelog: https://github.com/78/xiaozhi-esp32/compare/v2.5.0...v2.5.2

    All 188 firmware builds succeeded in the linked workflow run. Its final publication step was recovered manually after separately verifying the SHA-256 digests of all 190 uploaded attachments.

  2. v2.5.02026-09-10 · 2026-09-10 18:38 UTC
    查看更新说明

    What's Changed

    New Contributors

    Full Changelog: https://github.com/78/xiaozhi-esp32/compare/v2.4.2...v2.5.0

  3. v2.4.22026-08-06 · 2026-08-06 01:03 UTC
    查看更新说明

    Firmware Builder (New)

    A new firmware builder is available at: https://xiaozhi.me/console/firmware-builder

    What's Changed

    New Contributors

    Full Changelog: https://github.com/78/xiaozhi-esp32/compare/v2.4.0...v2.4.2

  4. v2.4.02026-07-19 · 2026-07-19 11:44 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/78/xiaozhi-esp32/compare/v2.3.0...v2.4.0

  5. v2.2.62026-04-19 · 2026-04-19 19:32 UTC
    查看更新说明

    What's Changed

    New Contributors

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    An MCP-based Chatbot

    (English | 中文 | 日本語)

    Introduction

    👉 Human: Give AI a camera vs AI: Instantly finds out the owner hasn't washed hair for three days【bilibili】

    👉 Handcraft your AI girlfriend, beginner's guide【bilibili】

    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.

    Recent Updates

    • The project now requires ESP-IDF v6.0.1 or later. ESP-IDF release/v6.1 is the recommended SDK branch. ESP-IDF 5.x is no longer supported. The current matrix contains 171 variants; ESP32-S31 builds require IDF 6.1 or later.
    • MQTT and BluFi cryptographic code has migrated to PSA Crypto. IDF 6 component splits and third-party dependency compatibility have also been addressed.
    • Audio pipeline concurrency, MQTT/UDP packet validation, and release-matrix selection have been hardened.
    • ESP32-P4 Rev1 and Rev3 are both supported on IDF 6 with ESP-SR 2.4.7.

    Features Implemented

    • Wi-Fi, wired Ethernet, USB RNDIS, and ML307/EC801E or NT26 Cat.1 4G networking; supported boards can switch between Wi-Fi and 4G
    • Offline voice wake-up with ESP-SR, including customizable wake words
    • Two communication transports: WebSocket and MQTT + UDP
    • 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
    • Speaker recognition, identifies the current speaker 3D Speaker
    • OLED / LCD displays with emoji and rich expression support, plus camera vision input on supported boards
    • Battery display and power management
    • 39 interface languages, with localized voice prompts where available and English fallback
    • ESP32, ESP32-C3, ESP32-C5, ESP32-C6, ESP32-S3, and ESP32-P4 chip platforms
    • Wi-Fi provisioning through hotspot or BluFi
    • Device-side MCP for device control (Speaker, LED, Servo, GPIO, etc.)
    • Cloud-side MCP to extend large model capabilities (smart home control, PC desktop operation, knowledge search, email, etc.)
    • Customizable wake words, fonts, emojis, and chat backgrounds with online web-based editing (Custom Assets Generator)

    Hardware

    Breadboard DIY Practice

    See the Feishu document tutorial:

    👉 "XiaoZhi AI Chatbot Encyclopedia"

    Breadboard demo:

    Breadboard Demo

    Supports 138 Board Directories and 171 Release Variants (Partial List)

    • LiChuang ESP32-S3 Development Board
    • Espressif ESP32-S3-BOX-3
    • M5Stack CoreS3
    • M5Stack AtomS3R + Echo Base
    • Magic Button 2.4
    • Waveshare ESP32-S3-Touch-AMOLED-1.8
    • LILYGO T-Circle-S3
    • XiaGe Mini C3
    • CuiCan AI Pendant
    • WMnologo-Xingzhi-1.54TFT
    • SenseCAP Watcher
    • ESP-HI Low Cost Robot Dog

    Software

    Firmware Flashing

    For beginners, it is recommended to use the firmware that can be flashed without setting up a development environment.

    The firmware connects to the official xiaozhi.me server by default. Personal users can register an account to use the Qwen real-time model for free.

    👉 Beginner's Firmware Flashing Guide

    Development Environment

    • Cursor or VSCode
    • Install the ESP-IDF plugin. The minimum SDK is ESP-IDF v6.0.1; ESP-IDF release/v6.1 is recommended. ESP-IDF 5.x is not supported.
    • Linux is better than Windows for faster compilation and fewer driver issues
    • This project uses Google C++ code style, please ensure compliance when submitting code

    Use the release/v6.1 branch rather than the v6.1 release tag: an ESP32-C3 Wi-Fi initialization failure with that tag is reported in #2344. After switching SDK revisions, run git submodule update --init --recursive in the ESP-IDF directory, source its export.sh, and run idf.py fullclean in this project before rebuilding.

    Developer Documentation

    Large Model Configuration

    If you already have a XiaoZhi AI chatbot device and have connected to the official server, you can log in to the xiaozhi.me console for configuration.

    👉 Backend Operation Video Tutorial (Old Interface)

    Related Open Source Projects

    For server deployment on personal computers, refer to the following open-source projects:

    Other client projects using the XiaoZhi communication protocol:

    Custom Assets Tools:

    About the Project

    This is an open-source ESP32 project, released under the MIT license, allowing anyone to use it for free, including for commercial purposes.

    We hope this project helps everyone understand AI hardware development and apply rapidly evolving large language models to real hardware devices.

    If you have any ideas or suggestions, please feel free to raise Issues or join our Discord or QQ group: 1095994019

    Star History