qq-mcp-bridge
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@qq-mcp-bridgefetch pending QQ private messages and reply to the latest sender"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
qq-mcp-bridge
把 QQ 官方机器人(bot.q.qq.com)接入 DeepSeek Harness 的 MCP 桥。
只做两件事:
能力 | 说明 |
私聊收发 | 用户私聊机器人 → 消息落到本地队列 → DSH 用 |
主动推送 | DSH 随时可调 |
不包含群聊消息。需要群聊请自行增加
send_group_message工具,并注意每个工具 schema 都会进入每次模型请求。
需要什么
在 QQ 开放平台 注册开发者、创建机器人并通过审核;
记下 AppID、ClientSecret(WebSocket 鉴权用;不是 QQ 密码);
Node.js >= 22.4;
本机网络能访问
api.bot.qq.com。
Related MCP server: qq-onebot-mcp
安装(DSH bundle)
npx -p @deepseek-ai/dsh dsh plugin --profile web add qq-mcp-bridge@0.1.0重启 DSH 后,工具以 mcp__qq__* 出现。
包通过 cordis.patch.yml 注册 @deepseek-ai/dsh-mcp-client:
- insert:
- id: qq-mcp
name: '@deepseek-ai/dsh-mcp-client'
config:
serverName: qq
transport: stdio
command: npx
args: ['-y', '-p', 'qq-mcp-bridge@0.1.0', 'qq-mcp-bridge']配置(不要把 AppSecret 提交进 Git)
复制示例:
New-Item -ItemType Directory -Force "$env:USERPROFILE\.qq-mcp-bridge" | Out-Null
Copy-Item .\config.example.json "$env:USERPROFILE\.qq-mcp-bridge\config.local.json"编辑 %USERPROFILE%\.qq-mcp-bridge\config.local.json:
{
"appId": "你的 AppID",
"clientSecret": "你的 ClientSecret",
"appToken": "",
"apiBase": "https://api.bot.qq.com"
}读取顺序:
QQ_CONFIG_FILE指定的文件;包根目录的
config.local.json;%USERPROFILE%\.qq-mcp-bridge\config.local.json。
也支持环境变量 QQ_BOT_APPID / QQ_BOT_CLIENT_SECRET / QQ_BOT_APP_TOKEN,但 DSH 启动 MCP 子进程时会清洗含 SECRET/TOKEN 的父环境变量,所以最稳的是本地 config.local.json,或在 DSH profile 的 env 块显式注入。
没有凭证时服务自动进入 mock 模式:不发网络请求,可用于验证 MCP 协议。
工具
工具 | 用途 |
| 取用户发来的待处理私聊消息 |
| 回复;带 |
| 查看机器人身份、mock/网关状态、待处理队列、已知联系人 |
主动推送需要 user_openid。它只能从对方发来的消息里获得;QQ 不提供“按 QQ 号查 openid”。同一个用户在不同机器人下的 openid 不同。
本地运行 / 自检
node src/mcp-server.js # stdio MCP
node src/doctor.js # 配置与连通性诊断
npm test # selftest + gateway 状态机测试Waker 插件(可选,本机 profile 使用):
- insert:
- id: qq-waker
name: '<qq-mcp-bridge 包路径>/waker/index.js'
config:
sessionId: '<目标 DSH 会话 ID>'
bridgeDir: '<qq-mcp-bridge 包路径>'
env:
QQ_BOT_APPID: '<你的 AppID>'
QQ_BOT_CLIENT_SECRET: '<你的 ClientSecret>'Waker 会持有 WebSocket,将入站消息直接注入指定会话;如果只用 MCP 工具,不需要它。
安全边界
本仓库不包含任何真实 AppID/AppSecret/openid/会话 ID;
state/、config.local.json、日志、测试抓包已被.gitignore排除;消息队列和联系人只写本机;
只支持 QQ 官方机器人私聊,不读取个人 QQ 协议,不模拟登录。
License
MIT
Available Tools
3 toolsbot_infoA
查询 QQ 机器人自身信息与桥接状态:机器人身份、是否处于 mock 模式、网关连接状态、待处理消息条数。用于排查配置问题。
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations the description carries the full burden, and it does disclose the concrete informational content an agent will receive (mock-mode flag, gateway connectivity, pending-message backlog). The query verb implies a side-effect-free read, though permissions and any side effects are never stated explicitly. For a parameterless diagnostic read this is adequate disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences: the first front-loads what is queried and the fields exposed, the second supplies the use case. No filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple parameterless info tool with no annotations and no output schema, the description is nearly complete—it enumerates the return content that the missing output schema would otherwise supply (mock mode, gateway status, pending count) and gives the troubleshooting context. Only explicit read-only/no-side-effect wording is absent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool takes zero parameters, so the baseline is 4 and there is nothing for the description to elaborate. No misleading parameter hints are present.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (查询/query) and resource (the QQ bot's own info and bridge status), then enumerates the exact fields returned: identity, mock mode, gateway connection, pending message count. This clearly separates it from the sibling tools send_private_message and fetch_messages, which handle message I/O rather than self-diagnostics.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
"用于排查配置问题" gives a clear context for using the tool (configuration troubleshooting), which is more than nothing. However it names no alternatives and gives no when-not conditions or prerequisites, so the guidance stays at the implied-usage level.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
fetch_messagesA
取出 QQ 用户发给机器人的待处理单聊消息。消息由后台 WebSocket 网关接收并排队,本工具只读取队列。队列为空是正常情况,说明当前没有新消息。
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | 最多取几条,默认 10。 | |
| consume | No | 是否在读取后从队列移除,默认 true。设为 false 只窥视不移除,便于重复查看。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It adds useful architecture context (WebSocket gateway queues messages; this tool only reads them) and sets expectations for empty results, but it omits the key side effect documented only in the schema: consume defaults to true, so reads remove messages from the queue by default. Saying '只读取队列' while the default behavior is destructive is a meaningful understatement of impact.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences, all front-loaded with the core action first, then the queue mechanics, then the empty-result caveat. Every sentence carries information an agent needs; there is no filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a two-optional-parameter read tool with no annotations or output schema, the description conveys where messages come from, what reading means, and why an empty result is expected. It could go slightly further by describing the shape of a returned message or the polling expectation, but nothing critical to correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% (limit and consume are both documented with defaults and behavior), so the schema already does the work. The description adds no syntax, format, or default information beyond it, making the baseline 3 appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('取出 QQ 用户发给机器人的待处理单聊消息') and narrows the scope with '本工具只读取队列', which cleanly separates it from the sibling send_private_message. An agent can tell what it returns without opening the schema.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Gives clear operating context: messages arrive via a backend WebSocket gateway and are queued, so this tool is the read path for them. It also warns that an empty queue is normal, preventing the agent from treating an empty result as a failure. It never names an alternative or exclusion explicitly, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_private_messageA
向指定 QQ 用户发送单聊消息。既可用于被动回复(传入刚才收到的 msg_id),也可用于主动推送(不传 msg_id,例如任务完成或定时提醒)。user_openid 与 msg_id 都来自 fetch_messages 或 bot_info 的返回值。
| Name | Required | Description | Default |
|---|---|---|---|
| msg_id | No | 可选。要回复的那条入站消息的 msg_id。传入即为被动回复,可绕过主动消息频率限制;不传即为主动推送。 | |
| content | Yes | 消息文本内容。 | |
| user_openid | Yes | 接收者的用户 openid。同一用户在不同机器人下的 openid 不同,必须用 bot_info 的 contacts.known 或 fetch_messages 返回值;不要自己编造。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden. It discloses the two behavioral modes, but the critical consequence – that passive replies bypass proactive-message rate limits – is buried in the msg_id schema description rather than the tool description, and failure modes (e.g., reply-window limits for proactive sends) are not disclosed at all.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three tight sentences, front-loaded with purpose followed by mode selection and parameter provenance; the final sentence partly duplicates the schema's parameter descriptions, which is the only thing keeping it from a 5.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with no annotations and no output schema, it covers the essentials: what it does, the two modes, and where required IDs come from. Missing rate-limit and delivery-failure context keeps it from being fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameters are already well documented; the description only adds that user_openid and msg_id originate from fetch_messages/bot_info returns, which is useful provenance but largely redundant with the schema's own wording.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('向指定 QQ 用户发送单聊消息') and immediately distinguishes the two operating modes (passive reply vs. proactive push), which is the key thing separating this from sibling read tools fetch_messages/bot_info.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly gives the condition that selects each mode: pass msg_id for a reply to a just-received message, omit it for scheduled/proactive pushes with examples (task completion, reminders). No explicit 'when not to use' or named alternative tool, so it falls short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
bot_info - First observed
fetch_messages - First observed
send_private_message
TDQS
Scored across 3 tools
The three tools cover three clearly distinct roles: sending a message, draining the inbound message queue, and inspecting bot/bridge status. There is no plausible way to confuse send_private_message with fetch_messages or bot_info, and the descriptions reinforce the send/receive/observe split.
send_private_message and fetch_messages both follow a consistent snake_case verb_noun pattern and pair naturally as outbound/inbound counterparts. bot_info breaks the pattern by using a bare noun with no verb, which is a minor deviation but a readable one.
Three tools is lean but appropriate for a thin WebSocket-to-MCP bridge whose job is just relay plus status. The surface is not padded, though it sits near the lower bound where an agent might want one or two more capabilities.
The core poll-then-reply loop is covered, but the surface stops at private chat: there is no group/conversation messaging, no media or non-text sending, no history or message-lookup beyond the live queue, and no acknowledgement semantics for processed messages. These are notable gaps for a general QQ bot bridge even if private-only was intentional.
Maintenance
Related MCP Connectors
Telegram bridge for your MCP-compatible agent. Bidirectional, no LLM in our stack.
AI agent messaging with durable inboxes, contacts and tasks. Connect through MCP with OAuth.
1Human-input bridge for AI agents with voice-first answer links, MCP tools, and HTTP APIs.
Command your AI agents by voice: PTT rooms, channels, direct messages, agent email, memory (mRAG).
Related MCP Servers
- AlicenseBqualityBmaintenanceConnects QQ via NapCat OneBot v11 to an Astral Code app-server, exposing MCP tools for sending messages, files, images, and fetching conversation history.101Apache 2.0
- FlicenseAqualityBmaintenanceEnables MCP hosts to bridge with QQ via NapCat/OneBot 11, allowing whitelisted private messages to reach an agent with full tool access while group mentions are answered by a sandboxed pure LLM without system access.8-
- AlicenseAqualityCmaintenanceEnables interaction with QQ through official bot APIs or personal accounts bridged via NapCat/OneBot v11, including status checks, target listing, bounded context retrieval, and plain-text sending to allowlisted conversations.5MIT
- AlicenseAqualityCmaintenanceExposes NapCat/OneBot v11 QQ-bot APIs as MCP tools for any MCP client, and includes an LLM-driven QQ bot with memory, knowledge base, tool calling, web search, multimodal recognition, and permission controls.45MIT