by Derpyu520
Bridge between QQ (SnowLuma OneBot v11) and DeepSeek Harness agents: social simulation, safe MCP tools, slang learning and more.
# Add to your Claude Code skills
git clone https://github.com/Derpyu520/qq-bridgeSee how qq-bridge compares with popular alternatives.
qq-bridge is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Derpyu520. Bridge between QQ (SnowLuma OneBot v11) and DeepSeek Harness agents: social simulation, safe MCP tools, slang learning and more. It has 263 GitHub stars.
qq-bridge's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Derpyu520/qq-bridge" and add it to your Claude Code skills directory (see the Installation section above).
qq-bridge is primarily written in JavaScript. It is open-source under Derpyu520 on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh qq-bridge against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
⚠️ Third-Party Software Notice
This skill is third-party open-source software developed and hosted independently on GitHub. SkillsLLM is an informational directory and does not control or maintain the underlying repository.
Any security checks, ratings, or warnings displayed by SkillsLLM are automated and limited in scope. They do not constitute a security certification or guarantee that the software is safe, error-free, or free from malicious code, vulnerabilities, compromised dependencies, or prompt-injection risks.
Review the source code, permissions, dependencies, and configuration before installing or running any third-party skill. Use is at your own risk. To the maximum extent permitted by applicable law, SkillsLLM is not liable for losses arising from third-party software.
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
English: README.en.md | 中文: README.md
📘 详细内外核说明书见 docs/PROJECT_GUIDE.md(架构、数据流、配置全解、调试与改进指南)。
🔒 QQ 会话的权限边界与安全承诺见 RULES.md。
把 QQ 消息接入 DSH agent:QQ 好友/群发来的消息会变成 DSH 会话里的用户消息,agent 的回复(含提问、工具审批)会发回 QQ。
⚠️ 当前版本
v0.1.5,适配 DSH 0.1.5-rc.1(在该版本上逐项实测)。使用 Cookie 鉴权、斜杠 RPC 和/api/remote.mux事件流;这一代协议自 DSH0.1.2-alpha.1起引入,与更早的点号 endpoint 协议不兼容——DSH0.1.1-rc.2及更早请改用 tagv0.1.0。默认分支
main就是本版本,git clone直接拿到,无需切换分支。
QQ 消息 ──► SnowLuma(OneBot v11 WS)──► 本桥接进程 ──► DSH Web API (127.0.0.1:3080/api)
▲ │
└── agent 回复/提问/审批 ┘
📽️ AI 仿真群友 - 项目介绍视频(约 11 MB)
视频改由 Release 附件托管,不在仓库里——只想安装桥接的人不必再下载这 11 MB(它此前占整个仓库体积的 88%)。
@snowluma/sdk 的 SnowLumaWebSocketClient(OneBot v11 WebSocket 客户端,自动重连)/api/<namespace>/<method> 斜杠 RPC、/api/remote.mux + session/follow 事件流;复用 AbstractApiClient 传输层但不再依赖旧版 zod value schema。会话模型由桥接按 config.json 的 dsh.model 逐会话 session.selectModel 固定(默认 deepseek-flash = DeepSeek-V41-Flash,多模态)~/.dsh/profiles/web/cordis.patch.yml 配置)接入三个 MCP server:
snowluma(桥接自带 src/mcp-snowluma-safe.js):QQ 动作安全子集(查状态/查群/查消息/发消息,发送强制白名单;发送工具支持可选 replyToMessageId 引用回复)snowluma-host(桥接自带 src/mcp-host-server.js):snowluma_status(默认只读探活);start_snowluma / stop_snowluma 需显式开启 snowluma.allowProcessControl: true 且仅在 closed-agent 模式可用web-search-safe(桥接自带 src/mcp-web-search-safe.js):只读 web_search / web_fetch(带 SSRF 防护),供 agent 查网络用语/资料state/sessions.jsonqq-chat agent preset(~/.dsh/.agent-presets/qq-chat/agent.cordis.yml),reserved2 使用 qq-chat-v2(~/.dsh/.agent-presets/qq-chat-v2/agent.cordis.yml);人格与默认 DSH 一致(coding agent),仅附加 QQ 场景规则;角色扮演是可选机制——由控制台或管理端设置 state/current-role.json 注入(群友无法更改)http://127.0.0.1:3100——切换运行模式(chat / closed-agent / reserved / reserved2)、设置角色、静默开关、查看活动日志、修改管理员/控制台令牌,全部即时生效;访问需要令牌(config.json 的 consoleToken,未配置时自动生成并打印在启动日志;控制台内可手动修改或重新生成)chat:白名单群 + 白名单私聊 → qq-chat 安全聊天closed-agent:仅私聊 owner(config.json 的 ownerQQ,可在控制台设置)→ 完整工具(默认用 DSH 自己声明的默认 preset,即 standard;可在控制台「closed-agent preset」下拉改为任意 DSH preset),可在 QQ 上操控 DSHreserved(一代仿真):仿真群友,观望/活跃/试探/退场状态机,选择性参与、按空格分句发送、主动收尾reserved2(二代仿真,运行 setup-dsh.mjs 后 DSH 默认):文本不自动转发,AI 通过 qq_get_unread_messages / qq_send_message 等工具自主看消息、发言、等待、设置唤醒/潜水;DSH 端使用 qq-chat-v2 presetask_user_question 提问时,问题会转发到 QQ,回复即自动应答/model)与 /reset(重置会话上下文)[引用 Derp:El Psy Kongroo是啥]机关的走狗),让 AI 判断这句话是对谁说的,不会把群友之间引用第三方的对话误当成指向自己;引用机器人自己时会被视为必回replyToMessageId,并新增专用 qq_reply 工具:AI 可以先用 qq_get_group_history 拿到真实消息 id,再引用/回复某条消息(是否允许 AI 主动使用由人格/策略决定;桥接会检测发送类工具调用并自动跳过该回合的重复自动转发)reserved)下,AI 可以只输出 [SILENT] 表示“潜水/不接话”,桥接会静默不发送reserved)按空格分句:AI 用空格表示拆成多条消息;中英文/数字之间的空格也会被当成分条信号,不想分条就不要加空格(reserved2 不适用,分条请用 qq_send_message 数组)http://127.0.0.1:3080)ws://127.0.0.1:3001 / http://127.0.0.1:3000,accessToken 视配置填写)npm install # 安装依赖(postinstall 会自动修补 @snowluma/sdk 的 ESM 打包 bug)
复制 config.example.json 为 config.json 后编辑:
Windows CMD 用户请用:
copy config.example.json config.json
⚠️ 真实
config.json与state/不会进入公开仓库,仓库只提供脱敏的config.example.json模板。
| 字段 | 说明 |
|---|---|
dsh.baseUrl |
DSH Web 地址,默认 http://127.0.0.1:3080 |
dsh.provider / dsh.model / dsh.reasoningEffort |
DSH 会话使用的模型/推理强度;若你的 DSH 没有示例中的模型,改成 DSH 设置页里可用的模型即可(选择失败只打日志,不阻塞启动) |
dsh.authToken |
DSH launch token(新版 DSH 用于换取 Cookie 的进程启动 token)。留空时桥接会自动从 ~/.dsh/guard/logs/server-*.out.log 发现;DSH 重启后遇到 401 也会自动重新发现并换 Cookie |
dsh.authHeader / dsh.authPrefix |
保留字段,当前新版 DSH 链路使用 Cookie 交换,不再直接发送该鉴权头 |
snowluma.wsUrl |
SnowLuma OneBot WebSocket 地址(如 ws://127.0.0.1:3001) |
snowluma.httpUrl |
OneBot HTTP API 地址(如 http://127.0.0.1:3000);不要填 WebSocket 端口,否则会报 HTTP 426 |
snowluma.accessToken |
OneBot accessToken,未配置留空 |
snowluma.launcherPath / homeDir |
SnowLuma 启动脚本与安装目录(供 agent 自动启动/停止) |
agentPreset |
QQ 会话使用的 DSH agent preset,默认 qq-chat(改性格见下文) |
socialV2.agentPreset |
reserved2 模式使用的 DSH agent preset,默认 qq-chat-v2 |
workspaceTitle |
QQ 会话在 DSH 界面中的归组名称,默认「QQ 聊天」 |
allow.private / allow.groups |
白名单(QQ 号/群号数组);留空且 allowAllWhenEmpty: true 时放行全部 |
deny.* |
黑名单,优先于白名单 |
ackMessage |
消息投递后的立即回复,空字符串关闭 |
sendDelayMs |
QQ 连续发送间隔,防止触发频率限制 |
consolePort |
本地控制台端口,默认 3100 |
consoleToken |
控制台访问令牌;留空时启动自动生成并保存到 state/console-token |
⚠️
allowAllWhenEmpty: true表示「白名单没填就全部放行」——把 agent 接入 QQ 等于把账号控制权交给了模型,建议先填白名单。
桥接和控制台能跑起来还不够,DSH 端还需要安装两个聊天 preset(qq-chat / qq-chat-v2)并挂载 MCP。单机新装同样必须执行这一步(不是只有「另一台设备」才需要),装完还要重启 DSH:
node scripts/setup-dsh.mjs
全新环境下脚本会把 DSH 默认模式设为
reserved2(二代仿真),并创建本地state/mode.json兜底;这样 AI 使用qq_send_message等工具收发消息时,DSH 会自动使用qq-chat-v2模式。如果本机已存在旧的state/mode.json或 DSH 设置值,脚本会保留不覆盖。之后可在桥接控制台(默认http://127.0.0.1:3100)顶部按钮切换模式,控制台会同时写入 DSH 设置与本地兜底文件。
详细步骤见 docs/DSH_SETUP.md。
共 6 步。DSH 已安装并运行,缺的是 SnowLuma 本体 + 桥接侧的 DSH 端安装(第 2、3 步最容易漏,漏了 QQ 上会毫无反应):
DSH(已运行,无需操作)
确认 http://127.0.0.1:3080 能打开即可。
装桥接并复制配置
git clone https://github.com/Derpyu520/qq-bridge.git
cd qq-bridge
npm install
Windows CMD 用 copy config.example.json config.json,其他平台用 cp config.example.json config.json。
示例模板里 allow.private / allow.groups 是空数组——空白名单 + allowAllWhenEmpty: false 时桥接不响应任何消息(这是刻意的 fail-closed 默认值)。白名单在第 5 步填。
装 DSH 端(preset + MCP),然后重启 DSH
node scripts/setup-dsh.mjs
装完必须重启 DSH——preset 与 MCP 只在 DSH 启动时加载。
跳过这步桥接不会崩,但群聊会话拿不到 qq-chat preset,桥接会拒绝建会话(有意的安全设计:绝不回退到带 bash/文件工具的默认 preset),表现同样是 QQ 上没反应。
下载并解压 SnowLuma
SnowLuma-v<版本>-win-x64.zip(完整版,自带 Node 运行时;Lite 版需本机 Node 22.13+)C:\SnowLuma),双击 launcher.bat首次引导(WebUI)+ 填写桥接配置
打开启动日志里的 WebUI 地址(README 写的是 http://localhost:5099,以你启动日志里实际打印的为准)
用启动日志中的初始密码登录,按引导:同意条款 → 设置密码 → 接入 QQ 进程(扫码登录)
在 WebUI 里配置 OneBot 连接:开启 WebSocket 服务端 和 HTTP API,分别记下端口(默认 WS 3001、HTTP 3000)和 accessToken(若配置了)
回到 config.json 填好 snowluma 段,并把 allow.private / allow.groups 换成你自己的 QQ 号 / 群号:
"snowluma": {
"wsUrl": "ws://127.0.0.1:3001",
"httpUrl": "http://127.0.0.1:3000",
"accessToken": "你在 WebUI 里配置的 token(没配置就留空)"
}
wsUrl 是 OneBot WebSocket 端口,httpUrl 是 OneBot HTTP API 端口(不要填成同一个 WS 端口,否则 MCP 工具会报 HTTP 426)。
启动桥接
npm start # 前台运行(崩溃不自动重启)
看到 SnowLuma 已连接 即成功;然后 QQ 上给机器人账号发条消息测试。
Windows 想要「崩溃自动重启」请改用 start.bat(见下节)。
npm start # 或双击 start.bat(守护模式:崩溃自动重启,关闭窗口即停止)
⚠️ 重要:
restart.bat(自动杀旧实例 → 清理锁 → 重新启动守护)config.json / roles/ / state/current-role.json 后重启桥接生效;修改 ~/.dsh/.agent-presets/qq-chat*/ 或 MCP 配置后重启 DSH 生效日志示例:
12:00:01 [bridge] SnowLuma 已连接:ws://127.0.0.1:3001
12:00:02 [bridge] 新会话 private:12345678 -> sess_xxxx
12:00:02 [bridge] 已投递 private:12345678: 你好
12:00:20 [bridge] agent 回复 (private:12345678) 42 字
验证 DSH 侧链路是否打通(会创建一个独立测试会话,不影响现有会话):
npm run self-test
预期输出:连接成功 → 测试会话创建 → prompt 被接受 → 打印 agent 回复。
qq-bridge/
config.example.json # 配置模板(脱敏占位符;真实 config.json 不入库)
docs/
PROJECT_GUIDE.md # 公开版项目说明书
dsh/agent-presets/ # qq-chat / qq-chat-v2 的 DSH agent preset 模板
plugins/qq-mode-console # DSH 插件:注册 qq-mode 设置命名空间(仅 host 半,UI 卡片未实现)
src/
bridge.js # 主程序
dsh-client.js # Node 版 DSH API 客户端(WS 下行)
md-to-plain.js # Markdown → QQ 纯文本
self-test.js # DSH 侧自测
scripts/ # 测试/运维脚本(含 postinstall 的 patch-snowluma-sdk.mjs)
patch-snowluma-sdk.mjs # 修补 SDK 的 ESM 打包 bug(postinstall 自动执行)
state/ # 运行时数据(不入库)
[图片] 等占位文本给 agent文字 (url) 形式)@snowluma/sdk 的 npm 发布版存在 ESM 扩展名 bug,本仓库通过 postinstall 补丁修复(见 scripts/patch-snowluma-sdk.mjs)SnowLuma 是独立第三方项目,与腾讯/QQ 无隶属关系,仅供学习与技术研究;使用前请阅读其 EULA 与《QQ 用户协议》。