xiaozhi-client 1.6.0-rc.0 → 1.6.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -3
- package/dist/cli.js +14 -19
- package/dist/cli.js.map +1 -1
- package/dist/mcpServerProxy.d.ts +5 -4
- package/dist/mcpServerProxy.js +7 -7
- package/dist/mcpServerProxy.js.map +1 -1
- package/dist/package.json +5 -4
- package/dist/services/mcpServer.d.ts +2 -1
- package/dist/services/mcpServer.js +9 -12
- package/dist/services/mcpServer.js.map +1 -1
- package/dist/webServerStandalone.d.ts +1 -0
- package/dist/webServerStandalone.js +39 -0
- package/dist/webServerStandalone.js.map +1 -0
- package/docs/examples-usage.md +647 -0
- package/docs/images/web-ui-preview.png +0 -0
- package/docs/migration-guide.md +299 -0
- package/docs/multi-endpoint-connection-management.md +324 -0
- package/package.json +5 -4
- package/dist/adaptiveMCPPipe.d.ts +0 -8
- package/dist/adaptiveMCPPipe.js +0 -12
- package/dist/adaptiveMCPPipe.js.map +0 -1
- package/dist/autoCompletion.d.ts +0 -10
- package/dist/autoCompletion.js +0 -3
- package/dist/autoCompletion.js.map +0 -1
- package/dist/modelScopeMCPClient.d.ts +0 -43
- package/dist/modelScopeMCPClient.js +0 -3
- package/dist/modelScopeMCPClient.js.map +0 -1
- package/dist/multiEndpointMCPPipe.d.ts +0 -30
- package/dist/multiEndpointMCPPipe.js +0 -8
- package/dist/multiEndpointMCPPipe.js.map +0 -1
- package/dist/streamableHttpMCPClient.d.ts +0 -47
- package/dist/streamableHttpMCPClient.js +0 -3
- package/dist/streamableHttpMCPClient.js.map +0 -1
- package/dist/webServer.d.ts +0 -37
- package/dist/webServer.js +0 -43
- package/dist/webServer.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://badge.fury.io/js/xiaozhi-client)
|
|
4
4
|
[](https://codecov.io/gh/shenjingnan/xiaozhi-client)
|
|
5
5
|
[](https://github.com/shenjingnan/xiaozhi-client/actions)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
<img src="https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docs/images/qq-group-qrcode.jpg" alt="QQ群" width="300"/>
|
|
9
9
|
|
|
@@ -11,6 +11,51 @@
|
|
|
11
11
|
|
|
12
12
|

|
|
13
13
|
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
1. [Xiaozhi Client](#xiaozhi-client)
|
|
17
|
+
1. [目录](#目录)
|
|
18
|
+
2. [功能特色](#功能特色)
|
|
19
|
+
3. [快速上手](#快速上手)
|
|
20
|
+
1. [全局安装 xiaozhi-client 命令行工具](#全局安装-xiaozhi-client-命令行工具)
|
|
21
|
+
2. [通过 npx 直接运行](#通过-npx-直接运行)
|
|
22
|
+
3. [使用 Docker 运行](#使用-docker-运行)
|
|
23
|
+
1. [前置要求](#前置要求)
|
|
24
|
+
2. [快速启动](#快速启动)
|
|
25
|
+
3. [获取小智接入点地址](#获取小智接入点地址)
|
|
26
|
+
4. [配置服务](#配置服务)
|
|
27
|
+
1. [方式一:通过 Web UI 配置(推荐)](#方式一通过-web-ui-配置推荐)
|
|
28
|
+
2. [方式二:直接编辑配置文件](#方式二直接编辑配置文件)
|
|
29
|
+
5. [常用操作](#常用操作)
|
|
30
|
+
6. [故障排除](#故障排除)
|
|
31
|
+
4. [可用命令](#可用命令)
|
|
32
|
+
5. [多接入点配置](#多接入点配置)
|
|
33
|
+
1. [配置方式](#配置方式)
|
|
34
|
+
1. [方式一:单接入点配置(字符串)](#方式一单接入点配置字符串)
|
|
35
|
+
2. [方式二:多接入点配置(字符串数组)](#方式二多接入点配置字符串数组)
|
|
36
|
+
2. [使用命令管理接入点](#使用命令管理接入点)
|
|
37
|
+
3. [示例配置](#示例配置)
|
|
38
|
+
4. [注意事项](#注意事项)
|
|
39
|
+
6. [ModelScope MCP 服务集成](#modelscope-mcp-服务集成)
|
|
40
|
+
1. [配置方式](#配置方式-1)
|
|
41
|
+
2. [使用前准备](#使用前准备)
|
|
42
|
+
3. [注意事项](#注意事项-1)
|
|
43
|
+
7. [自建服务端 JSON-RPC 消息格式规范](#自建服务端-json-rpc-消息格式规范)
|
|
44
|
+
1. [消息类型](#消息类型)
|
|
45
|
+
1. [1. 请求(Request)- 需要响应](#1-请求request--需要响应)
|
|
46
|
+
2. [2. 通知(Notification)- 不需要响应](#2-通知notification--不需要响应)
|
|
47
|
+
3. [3. 成功响应(Response)](#3-成功响应response)
|
|
48
|
+
4. [4. 错误响应(Error)](#4-错误响应error)
|
|
49
|
+
2. [重要注意事项](#重要注意事项)
|
|
50
|
+
3. [通信时序图](#通信时序图)
|
|
51
|
+
4. [常见错误](#常见错误)
|
|
52
|
+
8. [Web UI 配置界面](#web-ui-配置界面)
|
|
53
|
+
1. [功能特性](#功能特性)
|
|
54
|
+
2. [启动 Web UI](#启动-web-ui)
|
|
55
|
+
9. [作为 MCP Server 集成到其他客户端](#作为-mcp-server-集成到其他客户端)
|
|
56
|
+
1. [方式一:使用 stdio 模式(推荐)](#方式一使用-stdio-模式推荐)
|
|
57
|
+
2. [方式二:使用 HTTP Server 模式](#方式二使用-http-server-模式)
|
|
58
|
+
|
|
14
59
|
## 功能特色
|
|
15
60
|
|
|
16
61
|
- 支持 小智(xiaozhi.me) 官方服务器接入点
|
|
@@ -83,15 +128,48 @@ npx -y xiaozhi-client start
|
|
|
83
128
|
这个脚本会自动完成以下操作:
|
|
84
129
|
|
|
85
130
|
- 创建工作目录 `~/xiaozhi-client`
|
|
86
|
-
-
|
|
131
|
+
- 拉取指定版本的 Docker 镜像
|
|
87
132
|
- 停止并删除已存在的容器(如果有)
|
|
88
133
|
- 启动新的容器并配置端口映射
|
|
89
134
|
|
|
135
|
+
**基本使用:**
|
|
136
|
+
|
|
137
|
+
> 下载并运行启动脚本(默认使用最新版本)
|
|
138
|
+
|
|
90
139
|
```bash
|
|
91
|
-
# 下载并运行启动脚本
|
|
92
140
|
curl -fsSL https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker-start.sh | bash
|
|
93
141
|
```
|
|
94
142
|
|
|
143
|
+
> 无法访问 `Github` 可以使用 `Gitee` 替代
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
curl -fsSL https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker-start.sh | bash
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**指定版本运行:**
|
|
150
|
+
|
|
151
|
+
启动脚本现在支持灵活的版本指定方式:
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# 下载脚本
|
|
155
|
+
curl -fsSL https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker-start.sh -o docker-start.sh
|
|
156
|
+
|
|
157
|
+
# 下载脚本(Gitee)
|
|
158
|
+
curl -fsSL https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker-start.sh | bash
|
|
159
|
+
|
|
160
|
+
# 为脚本设置可执行权限
|
|
161
|
+
chmod +x docker-start.sh
|
|
162
|
+
|
|
163
|
+
# 使用默认版本 (latest)
|
|
164
|
+
./docker-start.sh
|
|
165
|
+
|
|
166
|
+
# 通过位置参数指定版本
|
|
167
|
+
./docker-start.sh v1.6.0
|
|
168
|
+
|
|
169
|
+
# 查看帮助信息
|
|
170
|
+
./docker-start.sh --help
|
|
171
|
+
```
|
|
172
|
+
|
|
95
173
|
**方式二:使用 Docker Compose**
|
|
96
174
|
|
|
97
175
|
首先获取 docker-compose.yml 文件:
|
|
@@ -100,6 +178,9 @@ curl -fsSL https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/doc
|
|
|
100
178
|
# 下载 docker-compose.yml 文件
|
|
101
179
|
curl -O https://raw.githubusercontent.com/shenjingnan/xiaozhi-client/main/docker-compose.yml
|
|
102
180
|
|
|
181
|
+
# 下载 docker-compose.yml 文件(Gitee)
|
|
182
|
+
curl -O https://gitee.com/shenjingnan/xiaozhi-client/raw/main/docker-compose.yml
|
|
183
|
+
|
|
103
184
|
# 使用 Docker Compose 启动
|
|
104
185
|
docker-compose up -d
|
|
105
186
|
|