参考:

0. 前置

使用咸鱼购买的 yunyi 模型中转服务,同时支持 GPT 和 Codex。

1. 环境准备

环境:Ubuntu 22.04.5。

1.1 查看网络信息

1
ip addr

示例输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 00:0c:29:08:51:3e brd ff:ff:ff:ff:ff:ff
altname enp2s1
inet 192.168.100.156/24 brd 192.168.100.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::84e5:14b0:8d63:fce6/64 scope link noprefixroute
valid_lft forever preferred_lft forever

1.2 关闭防火墙

1
sudo ufw status

示例输出:

1
状态:不活动

1.3 安装 nvm

1
2
3
4
5
6
7
8
9
sudo apt update
sudo apt install curl

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

source ~/.bashrc
source ~/.profile

nvm -v

示例输出:

1
0.39.1

1.4 安装 Node.js

1
2
3
4
5
nvm install 22
nvm use 22
nvm alias default 22

node -v

示例输出:

1
v22.22.0

1.5 安装 clawbot

1
curl -fsSL https://clawd.bot/install.sh | bash

2. 配置

2.1 安装

安装命令:

1
curl -fsSL https://clawd.bot/install.sh | bash

安装日志示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
tom@openclaw:~$ curl -fsSL https://clawd.bot/install.sh | bash

OpenClaw Installer
iMessage green bubble energy, but for everyone.

Detected: linux
Node.js v22.22.0 found
Git not found
Installing Git...
...
...
Git installed
Installing OpenClaw 2026.2.6-3...
npm install failed; cleaning up and retrying...
OpenClaw installed

OpenClaw installed successfully (2026.2.6-3)!
Cozy. I've already read your calendar. We need to talk.

Starting setup...

配置文件路径:~/.openclaw/openclaw.json

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{
"meta": {
"lastTouchedVersion": "2026.2.6-3",
"lastTouchedAt": "2026-02-26T16:06:19.767Z"
},
"wizard": {
"lastRunAt": "2026-02-26T16:06:19.752Z",
"lastRunVersion": "2026.2.6-3",
"lastRunCommand": "onboard",
"lastRunMode": "local"
},
"models": {
"mode": "merge",
"providers": {
"yunyi-codex": {
"baseUrl": "https://yunyi.rdzhvip.com/codex",
"apiKey": "替换为自己的",
"auth": "api-key",
"api": "openai-responses",
"headers": {},
"authHeader": false,
"models": [
{
"id": "gpt-5.2",
"name": "GPT 5.2",
"reasoning": true,
"input": [
"text",
"image"
],
"cost": {
"input": 0,
"output": 0,
"cacheRead": 0,
"cacheWrite": 0
},
"contextWindow": 128000,
"maxTokens": 32768
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "yunyi-codex/gpt-5.2"
},
"workspace": "替换为自己的",
"compaction": {
"mode": "safeguard"
},
"maxConcurrent": 4,
"subagents": {
"maxConcurrent": 8
}
}
},
"messages": {
"ackReactionScope": "group-mentions"
},
"commands": {
"native": "auto",
"nativeSkills": "auto"
},
"channels": {
"discord": {
"enabled": true,
"token": "替换为自己的",
"groupPolicy": "open"
},
"feishu": {
"enabled": false,
"connectionMode": "websocket",
"dmPolicy": "pairing",
"groupPolicy": "disabled",
"requireMention": true,
"domain": "feishu"
},
"kook": {
"enabled": true,
"token": "替换为自己的",
"dmPolicy": "pairing",
"groupPolicy": "open",
"requireMention": false
}
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "loopback",
"auth": {
"mode": "token",
"token": "替换为自己的"
},
"tailscale": {
"mode": "off",
"resetOnExit": false
}
},
"plugins": {
"entries": {
"discord": {
"enabled": true
},
"feishu": {
"enabled": false
},
"kook": {
"enabled": true
}
}
}
}

2.2 智能记忆系统

参考:

2.3 Searxng 搜索

参考:

2.4 Kook

参考:

2.5 skill

2.6 飞书

2.6.1 创建飞书机器人

创建飞书机器人

记录下 App IdApp Secret

2.6.2 配置 OpenClaw

1
openclaw config

2.6.3 配置 MCP 服务

前置条件:

  • 已订阅阿里云 Coding Plan
  • 已获取百炼 API Key,格式为 sk-xxx,不是 sk-sp-xxx
  • 已在百炼 MCP 广场开通联网搜索 MCP,每月 2000 次免费

安装步骤:

步骤 1:安装 MCPorter

1
npm install -g mcporter

步骤 2:启用 MCPorter 技能

1
openclaw config set skills.entries.mcporter.enabled true

步骤 3:添加 MCP 配置

1
2
cd ~/.openclaw/workspace
mcporter config add WebSearch https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp --transport http --header "Authorization=Bearer YOUR_API_KEY"

YOUR_API_KEY 替换为你的百炼 API Key。

步骤 4:验证安装

1
mcporter list

步骤 5:重启 Gateway

1
openclaw gateway restart

步骤 6:测试使用

在群里发送:用 mcporter 搜索阿里云的新闻

常见问题排查:

问题 原因 解决
连接失败 API Key 错误 确认使用百炼通用 Key(sk-xxx
连接失败 URL 错误 检查完整 URL:https://dashscope.aliyuncs.com/api/v1/mcps/WebSearch/mcp
连接失败 未开通服务 在百炼 MCP 广场确认已开通
无结果 额度用尽 每月 2000 次免费,用尽后需等待下月
模型不调用 未明确提及 提问时说明“用 websearch MCP 搜索…”

本站由 卡卡龙 使用 Stellar 1.29.1主题创建

本站访问量 次. 本文阅读量 次.