npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nova-qqbot-mcp

v0.2.0

Published

QQ 官方机器人 MCP 服务(BYO:使用你自己的 AppID / AppSecret)

Readme

nova-qqbot-mcp

QQ 官方机器人 MCP 服务(BYO 模式)。把你自己的 QQ 机器人接进 Nova 的智能体。

为什么是「BYO」

走 QQ 开放平台官方通道,需要每个开发者自己的机器人凭据(AppID / AppSecret)。 市场清单里不放密钥,装完后由你在 mcp.json 里填 —— 密钥只留在本机。

旧版 NapCat / OneBot 通道已整体下架:它的许可证禁止商用,且非官方协议端违反 QQ 用户协议。

平台硬边界(不是实现问题)

| 能力 | 官方通道能做到吗 | |---|---| | 读历史聊天记录 | ❌ 官方无历史接口,只有「本进程在线期间收到的事件」 | | 好友列表 / 主动加好友 | ❌ 只有 FRIEND_ADD 事件;机器人不能被主动加 | | 群消息 | @ 机器人时必收;未 @ 的群消息需机器人后台开启「接收所有消息」 | | 回复消息 | ✅ 被动窗口:群 5 分钟 / 单聊 60 分钟,每条最多 5 次 | | 主动发消息 | ⚠️ 单聊 4 条/月/用户;群侧受频控(20 qpm、1000 条/群/天) | | 群信息 / 群成员 | ✅ 返回 openid 与昵称,没有 QQ 号 | | 撤回 | ✅ 仅自己发的、2 分钟内 | | 表情回应 | ❌ 群/单聊不支持 |

配置

启动时按以下优先级读凭据:

  1. 环境变量 QQ_BOT_APP_ID / QQ_BOT_APP_SECRET(Nova 从 mcp.json 的 env 注入)
  2. 包根目录的 .env 文件(本地调试用)

市场装完后,打开 Nova 的 mcp.json(Electron userData 目录下),找到 qqbot 条目:

{
  "servers": {
    "qqbot": {
      "command": "npx",
      "args": ["-y", "[email protected]"],
      "enabled": true,
      "readOnlyTools": ["qqbot_status", "qqbot_get_messages"],
      "exposeReadOnlyWithoutPath": true,
      "callTimeoutMs": 60000,
      "env": {
        "QQ_BOT_APP_ID": "你的 AppID",
        "QQ_BOT_APP_SECRET": "你的 AppSecret"
      }
    }
  }
}

凭据位置:QQ 开放平台 → 你的机器人 → 开发设置 → AppID 接入凭证。 注意平台不明文存储 AppSecret,「查看」按钮实际是重置(旧密钥立即作废)。

工具(13 个:7 读 + 6 写)

只读 7 个免审批直出,写 6 个走审批卡:

| 工具 | 类型 | 说明 | |---|---|---| | qqbot_status | 读 | 连接态、机器人昵称、缓冲条数、额度余量(排查先看它) | | qqbot_list_bindings | 读 | 24 小时窗口内有消息往来的会话 | | qqbot_get_messages | 读 | 事件缓冲,非全量历史 | | qqbot_search_messages | 读 | 缓冲内关键词检索 | | qqbot_get_group_info | 读 | 群基本信息 | | qqbot_get_group_members | 读 | 群成员(openid + 昵称) | | qqbot_get_member_info | 读 | 单个成员信息 | | qqbot_send_message | 写 | 文本;带 msg_id 即被动回复 | | qqbot_send_markdown | 写 | Markdown(含链接需先报备消息 URL) | | qqbot_send_ark | 写 | Ark 模板卡片(结构化通知) | | qqbot_send_image | 写 | 图片:公网 URL 或本机路径(≤10MB,base64) | | qqbot_send_file | 写 | 富媒体:1图片 / 2视频 / 3语音 / 4文件 | | qqbot_recall_message | 写 | 仅自己发的、2 分钟内 |

所有写工具都支持 reply_to_message_id(消息引用),msg_seq 由服务端自动递增。

本地状态与额度

  • 事件缓冲落盘在 QQ_BOT_DATA_DIR(缺省 ~/.nova-qqbot),按 AppID 分文件, 保留 24 小时滚动窗口 —— 进程重启后仍能读最近的会话;
  • 主动消息发送前先过本地额度预估:单聊 4 条/月/用户、群 20 qpm + 1000 条/天。 超额时直接返回可执行提示,不让平台回 22009。

多机器人实例

QQ_BOT_ACCOUNTS='[{"name":"主号","appId":"123","secret":"***"},{"name":"测试号","appId":"456","secret":"***"}]'

工具参数加 bot:"主号" 指定实例,缺省用第一个。

本地调试

npm install
# 用 .env 填 QQ_BOT_APP_ID / QQ_BOT_APP_SECRET
npm start

日志全部走 stderr(stdout 被 MCP 协议占用,不能污染)。

已知限制

  • 官方富媒体接口只有 url 与 file_data(base64) 两种入参,没有分片上传; 本机文件上限约 10MB,更大请改用公网 URL;
  • Gateway 断线采用「重连 + 重新 Identify」,重连瞬间的事件可能漏收;
  • 机器人后台未开启「接收所有消息」时,群里不 @ 它的消息收不到。