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"
}
}
}
XunLong Review: AI Content Engine That Writes Reports, Fiction & Decks
HackGPT Enterprise Review: AI-Native Pentesting for Security Teams
AoxVPN 8.8 Member Day Sale | No-Log VPN Featuring IEPL Private Lines
One API Setup Guide: Manage LLM Keys and Access 100+ AI Models
Any-LLM Review: A Unified Python Interface for Every AI Model
Grok CLI: AI-Powered Terminal Assistant for Files and Bash Commands
Common Ground: Multi-Agent Collaboration That Actually Works
Transformers Library: Installation, Pipeline API, and Model Examples
Paperless GPT: Smarter OCR and Auto-Tagging for Paperless-NGX
AG-UI Protocol: The Open Standard for Connecting AI Agents to Frontends
Cuby Text: Open-Source Block-Based Knowledge Management
Spacedrive: An Open-Source Cross-Platform File Manager