Xiaozhi Client is a versatile AI utility built on the Model Context Protocol. It connects to the official XiaoZhi AI service while simultaneously functioning as a standard MCP server. You can integrate it with Cursor, Cherry Studio, or any other MCP-compatible environment to centralize all your configurations in one place and share them across different devices.
The client gives you total control over tool visibility, allowing you to aggregate multiple MCP servers into a single interface. You can switch between locally hosted backends and remote ModelScope MCP services with ease. The stack includes a modern Web UI and a robust CLI, eliminating the need for manual JSON editing.
xiaozhi create <my-app> --template hello-world.xiaozhi start -d.Install the CLI tool:npm i -g xiaozhi-client
Initialize a new project:xiaozhi create my-app --template hello-world
Navigate to the project directory:cd my-app
Install the necessary dependencies for the example MCP servers:pnpm install
Edit the xiaozhi.config.json file and set the mcpEndpoint to the value provided by xiaozhi.me.
Launch the service:xiaozhi start
Create your project:npx -y xiaozhi-client create --template hello-world
Enter the new directory:cd hello-world
Install dependencies:pnpm install
Add your mcpEndpoint to xiaozhi.config.json.
Launch the client:npx -y xiaozhi-client start
xiaozhi --helpxiaozhi startxiaozhi start --daemonxiaozhi attachxiaozhi statusxiaozhi stopxiaozhi restartxiaozhi mcp listxiaozhi mcp list --toolsXiaozhi Client can communicate with several XiaoZhi AI endpoints simultaneously.
Configuration File Method
For a single endpoint:
{
"mcpEndpoint": "wss://api.xiaozhi.me/mcp/your-endpoint-id"
}
For multiple endpoints:
{
"mcpEndpoint": [
"wss://api.xiaozhi.me/mcp/endpoint-1",
"wss://api.xiaozhi.me/mcp/endpoint-2",
"wss://api.xiaozhi.me/mcp/endpoint-3"
]
}
Command Line Management
xiaozhi endpoint listxiaozhi endpoint add wss://api.xiaozhi.me/mcp/new-endpointxiaozhi endpoint remove wss://api.xiaozhi.me/mcp/old-endpointxiaozhi endpoint set wss://... endpoint-2Complete Configuration Example
{
"mcpEndpoint": [
"wss://api.xiaozhi.me/mcp/305847/abc123",
"wss://api.xiaozhi.me/mcp/468832/def456"
],
"mcpServers": {
"calculator": {
"command": "node",
"args": ["./mcpServers/calculator.js"]
},
"datetime": {
"command": "node",
"args": ["./mcpServers/datetime.js"]
}
}
}
Every endpoint initializes an independent MCP process. This ensures that a failure in one endpoint does not affect the others. It is recommended to keep this list concise to maintain optimal performance.
Xiaozhi Client is compatible with MCP services hosted on the ModelScope platform.
To integrate, add an SSE entry to your xiaozhi.config.json:
{
"mcpServers": {
"amap-maps": {
"type": "sse",
"url": "https://mcp.api-inference.modelscope.net/caa0bd914d9b44/sse"
}
}
}
Prerequisites
Obtain a ModelScope API Token from your account dashboard.
Configure the token using one of these two methods:
Option A (Config File):
{ "modelscope": { "apiKey": "your-token-here" } }
Option B (Environment Variable):
export MODELSCOPE_API_TOKEN="your-token-here"
Launch the service with xiaozhi start. Note that the token in the configuration file takes precedence over the environment variable.
If you are developing a custom MCP backend, ensure it follows the JSON-RPC 2.0 standard.
Message Formats
Standard Request (requires a response):
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {},
"id": 1
}
Currently supported methods include: initialize, tools/list, tools/call, and ping.
Notification (requires no response):
{
"jsonrpc": "2.0",
"method": "notifications/initialized"
}
Notifications must not include an id field.
Success Response:
{
"jsonrpc": "2.0",
"result": {},
"id": 1
}
Error Response:
{
"jsonrpc": "2.0",
"error": {
"code": -32600,
"message": "Invalid Request"
},
"id": 1
}
All JSON-RPC messages must be terminated with a newline character (\n).
Standard Interaction Flow
initialize request.initialize request.notifications/initialized message (without an id).The client includes a dedicated Web UI for visual management.
To open the interface, run:
xiaozhi ui
Starting with version 1.5.0, Xiaozhi Client can function as a standard MCP server for other tools like Cursor or Cherry Studio. Once configured in xiaozhi.config.json, all connected clients will access the same toolset, and you can define exactly which tools are exposed.
Method 1: stdio Mode (Recommended)
Install the client globally:
npm install -g xiaozhi-client
Add the following to your AI client's MCP configuration:
{ "mcpServers": { "xiaozhi-client": { "command": "xiaozhi", "args": ["start", "--stdio"] } } }
To use a custom configuration path, set the XIAOZHI_CONFIG_DIR environment variable:
{ "mcpServers": { "xiaozhi-client": { "command": "xiaozhi", "args": ["start", "--stdio"], "env": { "XIAOZHI_CONFIG_DIR": "/path/to/your/config/directory" } } } }
Method 2: HTTP Server Mode
This mode is ideal for Docker deployments.
Launch the HTTP server:
xiaozhi start --serverxiaozhi start --server 8080xiaozhi start --server --daemonThen, connect via SSE in your chosen client:
{
"mcpServers": {
"xiaozhi-client": {
"type": "sse",
"url": "http://localhost:3000/sse"
}
}
}
Tencent HunyuanVideo-1.5: 8.3B Video Model Runs on 14GB GPUs
Jules Extension for Gemini CLI: Asynchronous Tasks and Automated GitHub PRs
SpikingBrain: 100x Faster LLM Inference via Spike Sparsity
DeepDoc Turns Local Files Into AI Research Reports (No Cloud Needed)
Infinite Radio: The AI DJ That Adapts Music Genres to Your Screen
Open Deep Research: Customizable AI Agents for Automated Report Generation
Cogency: Build AI Agents in Python with Transparent ReAct Loops
Twenty CRM Local Setup and Docker Deployment Guide for Developers
SerenityOS Build Guide: A C++ Unix-Like System for x86, Arm, and RISC-V
MemoryOS: Equip AI Agents with Persistent Recall via a Memory Hierarchy
Microsoft’s NLWeb: Converting Any Website into a Conversational Interface
Cuby Text: Open-Source Block-Based Knowledge Management