Py Xiaozhi
A Python-based Xiaozhi AI for users who want the full Xiaozhi experience without owning specialized hardware.
What is Py Xiaozhi?
Py Xiaozhi is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to python-based xiaozhi ai for users who want the full xiaozhi experience without owning specialized hardware.
A Python-based Xiaozhi AI for users who want the full Xiaozhi experience without owning specialized hardware.
This server falls under the Cloud Services category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A Python-based Xiaozhi AI for users who want the full Xiaozh
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx py-xiaozhiConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Py Xiaozhi
py-xiaozhi is a Python implementation of the Xiaozhi AI assistant that runs on standard PC hardware, replicating the experience of the dedicated ESP32-based Xiaozhi device without requiring proprietary hardware. It provides real-time voice streaming with sub-20ms latency via the Opus codec, offline wake-word detection, multi-modal vision via camera capture, and an extensible MCP tool ecosystem covering music playback, weather, volume control, and application management. Developers and hobbyists who want to experiment with embodied AI, IoT integration, or voice-controlled agents on desktop hardware will find py-xiaozhi a complete starting point.
Prerequisites
- Python 3.10, 3.11, or 3.12 (3.13 not yet supported)
- Working microphone and speaker hardware
- 4 GB RAM minimum (8 GB recommended), modern CPU with AVX support
- uv package manager (recommended) or pip
- Stable internet connection for cloud AI backend
Clone the repository
Clone the py-xiaozhi source code to your local machine.
git clone https://github.com/huangjunsen0406/py-xiaozhi.git
cd py-xiaozhiInstall base dependencies
Install the core dependencies using uv sync. Add the --extra gui flag if you want the graphical desktop interface with PySide6.
# CLI mode only (minimal dependencies):
uv sync
# GUI mode (includes PySide6 and qasync):
uv sync --extra guiConfigure the application
Copy the example configuration and fill in your Xiaozhi backend credentials, WebSocket endpoint, and any optional API keys for weather or music services.
cp config/config.example.yaml config/config.yaml
# Edit config/config.yaml with your settingsDownload wake-word models (optional)
For offline wake-word detection, download the Sherpa-ONNX models referenced in the documentation. This step is optional; without it, wake-word detection is disabled.
# Follow the model download instructions in the documentation:
# https://github.com/huangjunsen0406/py-xiaozhi/blob/main/docs/
python scripts/download_models.pyRun the assistant
Start py-xiaozhi in your chosen mode. GUI mode opens a desktop window; CLI mode runs in the terminal with minimal dependencies.
# GUI mode (default):
python main.py
# CLI mode:
python main.py --mode cli
# Specify protocol:
python main.py --protocol websocketPy Xiaozhi Examples
Client configuration
py-xiaozhi acts as its own AI client rather than as a subprocess of Claude Desktop. If you want to expose its MCP tools to an external client, the server runs locally on WebSocket. The configuration below is for reference if integrating with an external MCP client.
{
"mcpServers": {
"py-xiaozhi": {
"command": "python",
"args": ["main.py", "--mode", "cli"],
"cwd": "/path/to/py-xiaozhi"
}
}
}Prompts to try
Speak or type these commands to py-xiaozhi to exercise the built-in MCP tools.
- "Play some jazz music"
- "Take a photo with the camera"
- "What's the weather like today?"
- "Turn the volume up to 80 percent"
- "Take a screenshot of my desktop"Troubleshooting Py Xiaozhi
No audio input detected or microphone not found
Verify your microphone is recognized by the OS before launching. On Linux, check with arecord -l. Ensure PyAudio or sounddevice can access the device and that no other application is holding the microphone exclusively.
Python version compatibility errors at startup
py-xiaozhi supports Python 3.10–3.12. If you have 3.13 installed, create a virtual environment with an earlier version: uv venv --python 3.12 && uv sync.
GUI fails to start with PySide6 import errors
GUI mode requires the extra dependencies. Re-install with uv sync --extra gui or pip install -e '.[gui]'. On Linux, also ensure libGL is installed: sudo apt-get install libgl1.
Frequently Asked Questions about Py Xiaozhi
What is Py Xiaozhi?
Py Xiaozhi is a Model Context Protocol (MCP) server that python-based xiaozhi ai for users who want the full xiaozhi experience without owning specialized hardware. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Py Xiaozhi?
Follow the installation instructions on the Py Xiaozhi GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Py Xiaozhi?
Py Xiaozhi works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Py Xiaozhi free to use?
Yes, Py Xiaozhi is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Py Xiaozhi Alternatives — Similar Cloud Services Servers
Looking for alternatives to Py Xiaozhi? Here are other popular cloud services servers you can use with Claude, Cursor, and VS Code.
Open WebUI
★ 138.2kUser-friendly AI Interface (Supports Ollama, OpenAI API, ...)
Anything LLM
★ 60.4kThe all-in-one AI productivity accelerator. On device and privacy first with no annoying setup or configuration.
LocalAI
★ 46.4kLocalAI is the open-source AI engine. Run any model - LLMs, vision, voice, image, video - on any hardware. No GPU required.
Nacos
★ 33.0kan easy-to-use dynamic service discovery, configuration and service management platform for building AI cloud native applications.
Xiaozhi ESP32
★ 26.7k本项目为xiaozhi-esp32提供后端服务,帮助您快速搭建ESP32设备控制服务器。Backend service for xiaozhi-esp32, helps you quickly build an ESP32 device control server.
Gateway
★ 11.8kA blazing fast AI Gateway with integrated guardrails. Route to 1,600+ LLMs, 50+ AI Guardrails with 1 fast & friendly API.
Browse More Cloud Services MCP Servers
Explore all cloud services servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Py Xiaozhi in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Py Xiaozhi?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.