bilibili-mcp
With this Bilibili MCP server, an MCP client can read Bilibili content/account data and perform guarded write actions; the provided schema exposes 29 tools (22 read-only, 7 write), while the README describes a newer 44-tool version.
Check login/account status, including nickname, UID, coins, level, and unread notification/message counts.
Browse rankings, popular videos, weekly must-watch issues/lists, and entry/precious lists.
Read video details, subtitles/transcripts, keyframe screenshots, comments, and related recommendations.
Search videos/users and inspect user profiles, uploads, followings, followers, and favorites.
Read notifications, private-message sessions/chat history, followed dynamic feed, watch history, and watch-later list.
Perform write actions: like/unlike videos, coin videos, favorite/unfavorite, post comments/replies, post dynamics, follow/unfollow users, and send private messages.
Writes default to dry-run and require confirm=true; authentication is supplied externally via cookies.
Note: the schema’s post_comment lists image_paths, but the README says API comment images are rejected and image comments must use a browser skill.
Provides tools for interacting with Bilibili, including read-only access to rankings, popular and weekly lists, video info, transcripts, keyframes, comments, related videos, search, user profiles, followings/followers, favorites, notifications, private messages, dynamic feed, history, and watch later. Also provides write operations for liking, coining, favoriting, commenting/replying, posting text/image dynamics, following/unfollowing users, and sending private messages, with writes defaulting to dry-run unless confirmed.
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., "@bilibili-mcp show me the top 10 videos on Bilibili's ranking list"
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.
bilibili-mcp
一个面向 DeepSeek Harness (DSH) 以及任意 MCP 客户端的 Bilibili MCP Server。
Node.js >= 20.10(推荐 24),零运行时依赖
stdio JSON-RPC 2.0,可直接接入 DSH、Claude Desktop、其他 MCP 客户端
25 个只读工具 + 19 个写工具
支持排行榜、热门、每周必看、视频信息/字幕/关键帧/九宫格/弹幕、评论、搜索、用户、关注、收藏夹管理、通知、私信、动态流
写操作默认 dry-run,只有
confirm=true才执行登录态由外部 skill/脚本注入,MCP 本身不读取浏览器、不解密 Cookie 数据库
本项目是个人向工具,不是 B 站官方 SDK。接口可能随 B 站调整而变化;使用前请阅读下方 安全说明。
npm beta
包名:@lobo777/bilibili-mcp(scoped,避免和已有的 bilibili-mcp 冲突)。
已发布 0.1.0-beta.8(npm dist-tag:beta):
npm install -g @lobo777/bilibili-mcp@beta
bili --help
bili-mcp是 stdio MCP server,不要直接在交互终端里裸跑;调试用biliCLI。
如果 npm registry 是镜像源(例如 npmmirror),安装时加:
npm install -g @lobo777/bilibili-mcp@beta --registry=https://registry.npmjs.org也可以从 GitHub 安装最新 main:
npm install github:nuko777/bilibili-mcp
npx bili --help不安装直接跑:
npx -y -p @lobo777/bilibili-mcp@beta bili --helpRelated MCP server: bili-cli
快速开始
直接从 npm 安装 beta:
npm install -g @lobo777/bilibili-mcp@beta
bili --help如果 npm registry 是镜像源(例如 npmmirror),加 --registry=https://registry.npmjs.org。
从源码运行:
git clone https://github.com/nuko777/bilibili-mcp.git
cd bilibili-mcp
npm test # 50 个离线测试,不需要登录
npm start # 启动 stdio MCP Server要求 Node.js >= 20.10(推荐 24)。可选安装 ffmpeg 并加入 PATH,或设置 BILI_FFMPEG,用于视频关键帧裁切。
接入 DSH
先全局安装 npm beta(见上),再在 DSH 的 profile patch 中加入:
- insert:
- id: mcp-bilibili
name: "@deepseek-ai/dsh-mcp-client"
config:
transport: stdio
serverName: bilibili
command: bili-mcp
args: []
toolCallTimeoutMs: 180000
failOnStartupError: false不想全局安装时,用 npx:
command: npx
args:
- "-y"
- "-p"
- "@lobo777/bilibili-mcp@beta"
- "bili-mcp"Windows 上如果客户端无法解析 .cmd,用 bili-mcp.cmd 或上面的 npx 写法。
重启/重载 MCP 连接后,工具会以 mcp__bilibili__* 出现。
接入其他 MCP 客户端
任何支持 stdio MCP 的客户端都可以使用(全局安装后):
{
"mcpServers": {
"bilibili": {
"command": "bili-mcp",
"args": []
}
}
}或使用 npx:
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "-p", "@lobo777/bilibili-mcp@beta", "bili-mcp"]
}
}
}登录态
MCP 只消费登录态,不提取登录态。推荐流程:
按
bilibili-loginskill 选择一种方式:有
agent-browser:打开海外登录页扫码,用统一脚本导入并校验;有
chrome-devtoolsMCP:从已登录页面的nav请求读取 Cookie;或由用户在自己的终端执行
node scripts/cookie.mjs --save --verify。
校验:
# agent-browser:直接管道
agent-browser cookies get | node scripts/cookie.mjs --save --verify
# 手动 / chrome-devtools:命令会等待 stdin,粘贴 Cookie 后 Ctrl-D / Ctrl-Z+Enter
node scripts/cookie.mjs --save --verify
# 非交互:从文件或 here-doc 读 stdin
cat cookie-header.txt | node scripts/cookie.mjs --save --verifyCookie 文件位置:
Windows:
%APPDATA%\bilibili-mcp\cookies.jsonmacOS/Linux:
~/.config/bilibili-mcp/cookies.json可用
BILI_CONFIG_DIR覆盖。
也支持环境变量:BILI_COOKIE(完整 Cookie 头,优先级最高),或 BILI_SESSDATA / BILI_JCT / BILI_DEDEUSERID / BILI_BUVID3 / BILI_BUVID4(与文件合并)。
运行中的 MCP 会检查 cookies.json 的 mtime,文件更新后自动重载;若客户端仍显示旧登录态,重连 MCP。完整 BILI_COOKIE 在进程生命周期内固定;只设置单项 BILI_* 环境变量时会与文件合并,文件更新仍会热重载。
每日首次调用
auth_status 仅在 bili_ticket 缺失或临近过期时刷新当前进程的票据,并返回 cookie_update 元数据(expires_at),不再返回 Cookie 值,避免票据进入 agent 上下文。写回本地用一条命令:
node scripts/cookie.mjs --refresh-ticket它会读取本地 cookies.json、强制刷新票据并写回,输出摘要(登录态、昵称、硬币、expires_at),不输出 Cookie 值。写回后 MCP 会按 mtime 热重载;bili_ticket 是约 3 天有效的辅助风控票据,刷新失败不影响登录态和只读工具;失败时 auth_status 会返回 cookie_update_error。
每日运营流程见 skills/bilibili-ops/SKILL.md。
详细步骤见 skills/bilibili-login/SKILL.md。
Skills
仓库 skills/ 下随包提供 4 个 DSH skill:
Skill | 用途 |
agent-browser 扫码或已登录浏览器注入 Cookie,处理 | |
单个视频的理解:元信息、字幕/关键帧选型、返回字段与取帧 | |
在浏览器中发布带图评论(MCP 拒绝 API 图片评论) | |
账号自主运营手册:人设、评论风格、互动边界与每日节奏 |
bilibili-ops 面向账号自主运营,其余三个面向用户请求;写工具都要传 confirm: true 才会真正执行。
架构与实现
MCP client (DSH / Claude Desktop / ...)
│ stdio JSON-RPC 2.0
▼
src/server.mjs
├─ initialize / tools/list / tools/call / ping
├─ Cookie 文件 mtime 检查与热重载
├─ 工具参数校验
└─ src/tools/index.mjs(44 个工具)
├─ src/api/* 业务 API 与字段归一化
├─ src/core/* HTTP、WBI、Cookie、配置、错误
└─ src/media/* 字幕、关键帧、播放流、ffmpeg零运行时依赖,单进程 stdio 接入。
写工具默认 dry-run;
confirm=true才发写请求;非 GET 请求默认不自动重试。Cookie 由外部 skill/脚本注入,MCP 不读取浏览器、不解密 Cookie 数据库。
认证与签名
Cookie 来源:
BILI_COOKIE完整头,或cookies.json+ 单项环境变量合并。CSRF:写请求使用表单字段
csrf(不是csrf_token)。WBI:
wts+w_rid;签名和最终 query 使用同一个编码函数,避免%20/+与!'()*二次编码不一致。bili_ticket:auth_status按需调用GenWebTicket刷新并只返回元数据;写回本地用node scripts/cookie.mjs --refresh-ticket。图片上传:手写 multipart 并显式设置
Content-Length;NodeFormData的 chunked 编码会被 B站 CSRF 解析拒绝。评论带图:MCP
post_comment只支持文本,image_paths会被拒绝;图片评论用浏览器脚本。视频评论的
Referer必须是视频页 URL;用默认首页会被判为低信任请求并进入state=17。
关键接口
功能 | 接口 |
登录态 |
|
用户信息 |
|
排行榜 |
|
综合热门 |
|
每周必看 |
|
视频详情 |
|
字幕 |
|
关键帧 | DASH |
评论 | 视频/动态读取 |
视频互动状态 |
|
点赞/投币/收藏 |
|
收藏夹管理 |
|
动态 |
|
弹幕 | 读取 |
私信 |
|
关注/粉丝 | 读取 |
分页与状态
动态流使用
offset游标;user_dynamics/dynamic_feed的page是便捷封装。视频/动态主评论使用 WBI 游标接口:
offset优先,page是便捷封装,每页固定 20 条;ps仅在传root读取楼中楼时生效。置顶评论单独放在
top_replies(is_top=true),不再合并进replies。其他列表使用
page/ps/limit;服务端对页码做整数截断。标签补齐默认前 20 条,失败时返回
tags_complete=false。视频评论写入的 Referer 已对齐视频页;OPUS 评论主体从
basic.comment_type/basic.comment_id_str解析。
关键帧
优先 DASH 流 + ffmpeg,按
times截帧。type:"frames"的显式times最多 12 个;需要更多时间点时用type:"grid"(最多 81 帧,grid 同样支持timeout_ms)。type:"grid"每 9 帧拼一张,最多 9 张;最后一张自动接近正方形并留黑位。单帧默认高度 720p,宽度按原视频比例计算;
labels控制左上角序号;可用timeout_ms放宽单帧超时,失败会自动降宽度重试一次。DASH 失败时回退
videoshot雪碧图;无 ffmpeg 时返回整张雪碧图。grid 模式也会回退到 videoshot 缩略图(需要 ffmpeg)。媒体缓存位于
BILI_CACHE_DIR或系统缓存目录。视频标识支持 BV 号、av 号、完整视频链接和
b23.tv/bili2233.cn/b23.wtf短链;短链只跟随 B站域名并限制总超时。
工具
读取(25)
类别 | 工具 |
账号 |
|
榜单 |
|
视频 |
|
评论 |
|
搜索/用户 |
|
社交 |
|
消息 |
|
动态/历史 |
|
写入(19)
工具 | 说明 |
| 视频点赞/取消点赞 |
| 评论点赞/取消点赞 |
| 动态点赞/取消点赞 |
| 投币 1–2 枚,可选同时点赞;不可撤销 |
| 收藏/取消收藏;支持 |
| 创建收藏夹 |
| 修改收藏夹名称/简介/公开状态 |
| 删除一个或多个收藏夹 |
| 视频/动态纯文本评论、楼中楼回复、@、可同时转发动态;带图会被拒绝,改按 |
| 删除自己的视频/动态评论;不可撤销 |
| 删除自己的动态;不可撤销 |
| 置顶/取消置顶自己的动态 |
| 修改昵称/签名;昵称消耗 6 硬币 |
| 添加/移除视频到稍后再看 |
| 发送视频弹幕 |
| 撤回自己发送的弹幕(通常限 2 分钟内) |
| 发布文本/图片动态、@ 用户(最多 10 个),或传 |
| 关注/取关 |
| 发送私信 |
所有写工具默认返回 dry_run;只有传入 "confirm": true 才会真正执行。发布评论、动态、私信属于公开/对外行为。
示例
mcp__bilibili__rank_list {"limit": 10, "include_tags": true}
mcp__bilibili__video_info {"video": "BV1xx411c7mD"}
mcp__bilibili__video_info {"video": "https://b23.tv/xxxxxxx"}
mcp__bilibili__video_transcript {"video": "BV1xx411c7mD"}
mcp__bilibili__video_frames {"video": "BV1xx411c7mD", "times": ["10%", "50%"], "max_images": 2}
mcp__bilibili__search {"keyword": "DeepSeek R1", "limit": 5}
mcp__bilibili__comments {"video": "BV1xx411c7mD", "sort": "time"}
mcp__bilibili__comments {"dynamic_id": "1261344079956934665", "sort": "time"}
mcp__bilibili__comments {"dynamic_id": "1261344079956934665", "root": "317957957297"}
mcp__bilibili__dynamic_detail {"dynamic_id": "1261344079956934665"}
mcp__bilibili__user_dynamics {"mid": "401742377"}
mcp__bilibili__user_dynamics {}
mcp__bilibili__video_frames {"video": "BV1dan166EHf", "type": "grid", "count": 9, "frame_height": 720}
mcp__bilibili__favorite_video {"video": "BV1dan166EHf", "folder_ids": ["4267463668", "4367445368"], "confirm": false}
mcp__bilibili__like_dynamic {"dynamic_id": "1261344079956934665", "like": true, "confirm": false}
mcp__bilibili__post_dynamic {"text": "分享视频", "video": "BV1w2Hw6KE1j", "confirm": false}
mcp__bilibili__post_dynamic {"text": "测试动态", "mention_user_ids": ["3747573468761409"], "confirm": false}
mcp__bilibili__post_comment {"dynamic_id": "1261344079956934665", "message": "测试", "mention_user_ids": ["3747573468761409"], "confirm": false}分页约定:
dynamic_feed优先使用offset游标;page是便捷封装。其他列表使用
page/ps/limit,具体见工具 schema。user_dynamics不传mid时读取自己的空间动态;传mid读取任意用户动态。popular_list使用 Web 热门页(/x/web-interface/popular),page/ps分页,每页最多 20 条;标签补齐默认只补前 20 条。标签补齐默认只补前 20 条;设置
include_tags=false可减少请求。
配置
环境变量 | 作用 |
| 完整 Cookie 头;优先级最高 |
| 单项 Cookie,与文件合并 |
| Cookie 配置目录 |
| 缓存目录(关键帧等) |
| ffmpeg 可执行文件路径 |
| 可选: |
| 开启真实网络测试 / 可逆写测试 |
测试
npm test # 50 个离线测试(WBI、Cookie、参数校验、MCP 协议等)
npm run test:live # 需要有效 Cookie;BILI_TEST_BVID 可选
npm run verify # 只读端到端检查;未设置 BILI_TEST_BVID 时跳过视频项真实写测试默认关闭,避免误操作:
BILI_LIVE_TEST=1 BILI_LIVE_WRITE=1 npm run test:liveRelease
发布流程已配置在 .github/workflows/release.yml:
更新
package.json版本号和下方 Changelog;提交并打 tag:
git tag vX.Y.Z && git push origin vX.Y.Z;GitHub Actions 会运行测试、
npm pack、上传 tarball、创建 GitHub Release;若仓库配置了
NPM_TOKENsecret,还会执行npm publish --provenance(已发布的版本会跳过);预发布版本发布后会把
latest一并指到该版本;一旦发布过正式版,latest就保持在正式版,不再被新的 beta 覆盖。
NPM_TOKEN 建议使用 npm Granular Access Token:对 @lobo777/bilibili-mcp 有 Read and write 权限,并启用 Bypass 2FA。不要使用过期或已泄露的 token。
已发布:v0.1.0-beta.8(prerelease,含 npm tarball)。
后续计划
视频语音转文字:无字幕时下载音频并接入 ASR;先做本地 whisper.cpp 选型。
视频投稿:高风险,先调研草稿/不公开方案,暂不自动发布。
欢迎 issue 讨论优先级。
已知限制
videoshot回退依赖 ffmpeg;未安装 ffmpeg 时返回整张雪碧图,不裁切单帧。danmaku按 6 分钟窗口读取 WBI 分段,最多 100 段;超长视频的弹幕可能被截断。单次工具返回的图片总量约 12MB base64;超出部分会被省略,并在结果末尾提示省略数量。
B 站接口可能随时调整;端点集中在
src/api/*,错误会带原始code便于更新。动态详情接口可用,但不同动态类型字段不同;评论主体需从
basic.comment_type/basic.comment_id_str解析。读取通知/聊天记录会触发 B站已读状态;
notifications的 feed 结果、messages的聊天记录都带read_side_effect/read_note;未读数查询和会话列表带read_side_effect:false/read_note。评论
state=11/17可能是审核、索引延迟或仅自己可见;返回pending_review,不要据此立即删除。post_comment不支持带图:传image_paths会直接拒绝,避免 API 图片评论仅自己可见。图片评论按bilibili-browser-commentskill 走 agent-browser(需 Node 24+ 和已安装的 agent-browser):node scripts/post-image-comment.mjs --url ... --image ... --text ...(自动注入 MCP Cookie、内部轮询、返回 rpid/has_image)。
明确不实现
每日签到、银瓜子兑换;
直播、付费/DRM 内容;
多账号池、批量自动化、绕过审核/风控。
安全
写操作
所有写工具默认 dry-run;只有
confirm=true才会真正执行。coin_video不可撤销;单稿最多 2 枚,执行前会检查当前已投数量。发布评论、动态、私信是公开/对外行为;执行前确认目标和文案。
评论/弹幕正文不要出现“脚本、自动化、MCP、测试、验证”等词,容易触发风控;用普通用户口吻。
服务端对非 GET 请求默认不自动重试,避免重复评论/私信/投币;客户端超时重试仍可能造成重复,重要写操作建议先 dry-run,执行后用读取工具确认。
删除评论/动态/收藏夹不可撤销;昵称修改会消耗 6 个硬币。
Cookie
Cookie 等价于账号密码。
MCP 不读取浏览器、不解密 Cookie 数据库、不做扫码登录。
登录态由外部 skill/脚本写入
cookies.json,或通过BILI_COOKIE提供。不要把 Cookie 写入仓库、README、截图、issue 或提交记录。
cookie.mjs默认输出的 Cookie 头是敏感数据;只写本地,不要公开或提交。配置文件应位于用户目录;POSIX 下尽量使用 0600,Windows 下以用户目录 ACL 为准。
使用
chrome-devtools读取nav请求时,完整 Cookie 会出现在工具输出/会话记录中;如果记录可能被导出或共享,请退出登录后重新登录或重新生成 Cookie。
图片上传
post_dynamic 的 image_paths 按设计允许读取本机任意可读图片路径,不限制目录。post_comment 的 image_paths 会在读取文件前直接拒绝。这是本地特权能力:
不要在不可信提示、不可信 agent 或远程调用下开放写工具。
只上传你明确知道路径和内容的图片。
服务端会校验扩展名、文件签名(PNG/JPEG/GIF)、单图 10MB、单次总量 25MB,并清洗 multipart 文件名;这些检查不限制目录。
上传成功后图片会进入 B站 BFS,属于公开内容的一部分。
网络与数据
工具返回 B站公开数据、账号相关数据(关注、收藏、私信、通知等);不要把私人数据提交到公开仓库。
媒体/关键帧缓存位于
BILI_CACHE_DIR或系统缓存目录;长期使用可手动清理。本项目不是 B站官方 SDK;使用时应遵守 B站服务条款和当地法律。
报告问题
如果发现安全问题,请通过仓库 issue 或维护者公开联系方式报告,不要在 issue 中粘贴 Cookie、SESSDATA、bili_jct 或完整请求头。
Changelog
0.1.0-beta.8 — 2026-11-13
auth_status刷新bili_ticket后只返回expires_at元数据,不再返回 Cookie 值;新增scripts/cookie.mjs --refresh-ticket一键刷新并写回本地bilibili-ops增加每日首次刷新票据的流程;bilibili-login补充写回提示新增
scripts/cookie.mjs:统一 stdin Cookie 过滤/合并入口,支持 agent-browser 逐行导出、Cookie 头和规范 JSON;默认纯过滤,--save或--refresh-ticket才写回本地移除旧的
save-cookie/import-cookie-file;Cookie 入口统一为scripts/cookie.mjs图片评论脚本更名为
scripts/post-image-comment.mjs(原post-image-comment-agent-browser.mjs)离线测试 50 项
0.1.0-beta.7 — 2026-11-12
收藏夹接口不再返回
fid:list_favorites/create_favorite_folder只暴露id(media_id);fid不被 fav API 接受,且可能撞上别人的同名 media_id(写操作报11010)popular_list只保留 Web 热门页:移除 H5 流(feed:"h5"、idx)和空转的personalized参数,H5 卡片字段本就不全bilibili-video-digest收敛为单个视频的理解(元信息、字幕/关键帧选型、返回字段与默认值、失败处理),参数范围交给工具 schema,130 → 37 行bilibili-ops重写为运营规范:三档交互策略、评论/楼中楼与带图规则、表情包配额、硬币余额上限 10、暗号与安全离线测试 41 项
0.1.0-beta.6 — 2026-11-03
notifications/messages归为只读工具,与 README 的读取分类一致新增
like_dynamic:动态点赞/取消点赞,默认 dry-run;dynamic_detail增加stat.liked;工具总数更新为 44(25 读 + 19 写)like_dynamic的请求按浏览器实际抓包实现:POST /x/dynamic/feed/dyn/thumb?csrf=...,JSON 体为{dyn_id_str, up, spmid}post_dynamic支持mention_user_ids,按浏览器抓包构造contents的type:2AT 组件;正文已有@昵称时就地转换,否则追加在末尾post_comment只在parent !== root(真正的楼中楼)时自动生成回复 @父作者 :前缀;直接回复顶层评论保持原文,符合浏览器实际请求bilibili-browser-comment脚本等待所有可观察的 fetchupload_bfs上传结束并校验图片预览;发布前拦截可观察到的 fetch/XHR/x/v2/reply/add,请求体没有非空且带 URL 的pictures时中止,避免静默发成纯文本评论图片评论合并为
scripts/post-image-comment.mjs单入口:自动注入 MCP Cookie、内部重试/轮询,返回rpid与has_image;移除独立页面脚本和 CDP CLIbilibili-ops/bilibili-video-digestskill 流程更新:按视频内容选择字幕或关键帧、补充弹幕/热门评论、动态阅读与发布后回读;明确 owner UID、@ 上下文、主动私信边界和日常节奏离线测试增加到 40 项,覆盖动态点赞、mention、楼中楼前缀和图片评论 guard
0.1.0-beta.5 — 2026-10-27
新增
bilibili-ops账号运营 skill;统一bilibili-login/bilibili-video-digest/bilibili-browser-comment的职责边界,README 增加 Skills 一览工具参数校验拒绝未知字段与显式
null,避免拼写错误和like:null之类被静默接受写工具 annotations 区分可逆与破坏性操作(点赞/收藏/关注等不再标记为 destructive)
编辑/删除收藏夹前强制读取最新快照,避免旧缓存覆盖并发修改
楼中楼作者查找支持分页;找不到父评论时不再错误回退根作者
video_frames的frames模式明确限制显式times为 12 个;grid仍最多 81 帧视频评论与浏览器一致:只使用 WBI 游标接口(
/x/v2/reply/wbi/main),不再使用 legacy/x/v2/reply;置顶评论单独返回top_replies;动态评论is_up修复video_frames的grid在 DASH 失败时回退到videoshot缩略图post_dynamic支持传video发布视频转发动态(scene:5+web_repost_src)H5 热门补 UP 名/播放量,并按 10 卡一桶翻页;
notifications补rpid/root_rpid/target_rpid;search支持min_play;video_frames支持timeout_ms和降宽度重试top_dynamic对新动态的4100001增加短延迟重试;create_favorite_folder的privacy按attr & 1归一化修复
delete_favorite_folder和favorite_video只传folder_id时被空folder_ids数组覆盖的问题buffer 响应会识别 HTTP 200 的 JSON 错误并抛错,WBI 过期时能正常刷新;HTTP 403/412 也会重试
评论
page上限为 20,避免一次请求逐页走完整评论区;top_replies与replies按 rpid 去重b23.tv/bili2233.cn短链解析只跟随 B站域名,并对整条重定向链使用总超时弹幕分段使用服务端
page_size,补充segments_fetched/total_estimated/truncated;修正59.96s显示为1:00.0dynamicTarget只对刚发布动态的 detail 索引缺失做 fallback,网络/WBI 错误不再被吞掉弹幕读取迁移到浏览器当前的 WBI 分段 protobuf 接口(
/x/v2/dm/web/view+/x/v2/dm/wbi/web/seg.so),不再使用 legacy/x/v1/dm/list.so用户信息改用
space/wbi/acc/info+relation/stat+space/upstat+space/navnum;粉丝列表改用/x/relation/fans;视频互动状态统一用archive/relation私信会话列表改用 WBI 签名请求;综合热门默认改为 Web 热门页,H5 流通过
feed:"h5"显式选择发送弹幕校验颜色、字号和模式范围;新增
recall_danmaku,使用/x/v2/dm/recall撤回弹幕删除动态只发送
dyn_id_str只设置单项 Cookie 环境变量时,
cookies.json仍会热重载图片返回超出体积预算时提示省略数量
缓存 ffmpeg 路径探测;清理未使用导出/导入和重复评论归一化代码
补充参数校验、缓存新鲜度、楼中楼分页、短链、WBI 评论等回归测试
0.1.0-beta.4 — 2026-10-24
修复
video_frames九宫格的times/count语义:grid 的显式时间不再被 12 个上限截断;不传count时按times数量推断修复
edit_favorite_folder未显式传privacy时的预览语义,避免把内部attr当作公开/私密状态发布/删除/置顶动态后清理动态流游标,避免自己的动态流短时间不更新
楼中楼子回复补充
state/is_upMCP
serverInfo.version改为读取package.json增加九宫格时间上限、子回复状态回归测试
图片评论:浏览器脚本走页面 UI;API
post_comment只支持纯文本,避免图片评论 shadow;文本评论支持sync_to_dynamic收藏夹写操作只返回可靠的
code/message,不再暴露无意义的success_num更新 skill 的描述/触发范围,清理 README 重复限制
0.1.0-beta.3 — 2026-10-24
修复 OPUS 动态评论主体:使用
basic.comment_type/basic.comment_id_str,不再硬编码type=17 + 动态IDpost_comment支持mention_user_ids,发送at_name_to_mid,显式 @ 用户楼中楼回复自动生成
回复 @父评论作者 : 正文格式;comments支持root读取完整楼中楼修复视频评论
state=17:评论写请求的 Referer 对齐视频/OPUS 页面 URL,而不是默认首页新增
delete_comment:删除自己的视频/动态评论,默认 dry-run;删除后清理读缓存新增
delete_dynamic:删除自己的动态,默认 dry-run;删除后清理读缓存新增
like_comment:视频/动态评论点赞与取消,默认 dry-run;操作后清理读缓存新增
top_dynamic:置顶/取消置顶自己的动态,默认 dry-runpopular_list默认改为 H5 热门流;新增personalized参数,true 时走 Web 个性化推荐流新增
update_profile:修改昵称/签名,默认 dry-run;昵称消耗 6 硬币新增
user_dynamics:读取指定用户/自己的空间动态流新增
dynamic_detail:按动态 ID 读取单条动态详情新增
toview_video:添加/移除视频到稍后再看收藏夹写操作:创建、修改、删除,以及
favorite_video多收藏夹新增
danmaku/send_danmaku:读取和发送视频弹幕,发送默认 dry-runvideo_frames支持type:"grid":每 9 帧拼一张,最多 9 张;最后一张自动接近正方形并留黑位,单帧 720p、保持原比例,可用times指定格子时间video_comments泛化为comments,支持视频/动态、楼中楼、state 与 @成员;传root读取完整楼中楼
0.1.0-beta.2 — 2026-10-21
GitHub Actions
Releaseworkflow:打 tag 后自动测试、打包、创建 GitHub Release,并通过仓库 secretNPM_TOKEN发布到 npm(已用v0.1.0-beta.2验证)补充 release 流程、npm beta 安装说明和版本化 Changelog
0.1.0-beta.1 — 2026-10-21
首个公开 beta 版本,npm dist-tag beta。
29 个 MCP 工具:22 个只读 + 7 个写操作
排行榜、综合热门、每周必看、入站必刷
视频详情、AI 字幕、关键帧截图、评论、相关推荐
搜索、用户信息/投稿、关注/粉丝、收藏夹、通知、私信、动态流、历史、稍后再看
点赞、投币、收藏、评论/回复/带图评论、文本/带图动态、关注、私信
写操作默认 dry-run,
confirm=true才执行;非 GET 请求默认不自动重试WBI 签名与最终 query 使用同一编码器;支持带空格/特殊字符的搜索
工具参数运行时校验;Cookie 文件 mtime 热重载;图片魔数/大小/文件名检查
修复评论
state=17的可见性提示、图片上传 multipart、CSRF 字段、分页和标签完整性等问题
目录
src/
server.mjs stdio MCP 入口
mcp/protocol.mjs JSON-RPC 结果/工具描述
tools/index.mjs 44 个工具 schema + 参数校验
core/ HTTP、WBI、bili_ticket、Cookie、配置、错误、格式化
api/ 榜单、视频、互动、关系、收藏、消息、动态
media/ 字幕、关键帧、播放流、ffmpeg
scripts/ 统一 Cookie 过滤/合并、只读验收、图片评论快捷脚本
skills/ 4 个 DSH skill(见 Skills 一节)
test/ 离线 / MCP / live 测试献词
献给我的小汐:https://space.bilibili.com/3747573468761409
License
MIT. 详见 LICENSE。
Available Tools
29 toolsauth_statusB站登录态与账号状态ARead-only
读取当前 B 站登录态、昵称、UID、硬币、等级、未读通知/私信数。MCP 不提取登录态;未登录时请使用 bilibili-login skill 从浏览器注入 Cookie。
Inputs: no named parameters.
coin_video投币ADestructive
给视频投 1-2 枚硬币。默认只预览;confirm=true 才执行。硬币不可撤销,请先确认余额与数量。
Inputs: video (required), confirm, multiply, select_like.
dynamic_feed关注动态流ARead-only
读取关注动态流,包含作者、文本、图片、视频卡片与互动数。支持翻页:用返回的 next_offset 作为 offset 继续,或直接传 page;B 站每页 20 条。
Inputs: page, type, offset.
favorite_video收藏 / 取消收藏ADestructive
把视频加入或移出指定收藏夹。默认只预览;confirm=true 才执行。不传 folder_id 时会返回可用收藏夹列表。
Inputs: video (required), confirm, favorite, folder_id.
follow_user关注 / 取关ADestructive
关注或取关某个用户。默认只预览;confirm=true 才执行。可逆。
Inputs: mid (required), follow, confirm.
history观看历史BRead-only
读取当前账号的观看历史(扩展能力)。
Inputs: ps.
like_video点赞 / 取消点赞ADestructive
点赞或取消点赞视频。默认只预览,不执行;confirm=true 才真正发送请求。可逆。
Inputs: video (required), like, confirm.
list_favorites收藏夹与收藏内容ARead-only
不传 folder_id 时列出收藏夹;传 folder_id 时读取该收藏夹的视频内容(支持分页)。
Inputs: ps, page, order, keyword, +1 more.
list_followers粉丝列表(扩展)BRead-only
获取当前账号(或指定用户)的粉丝列表。
Inputs: ps, mid, page.
list_followings关注列表ARead-only
获取当前账号(或指定用户)的关注列表,支持分页。
Inputs: ps, mid, page.
messages私信会话 / 聊天记录ARead-only
不传 talker_id 时列出私信会话;传 talker_id 时读取与该用户的聊天记录(按时间升序)。
Inputs: limit, talker_id.
notifications回复 / @ / 点赞通知ARead-only
读取 B 站消息中心通知。kind=unread 返回未读数;reply 返回“回复我的”;at 返回“@ 我的”;like 返回“收到的赞”。
Inputs: ps, kind, page.
popular_listB站综合热门BRead-only
获取 B 站综合热门视频(对应 /v/popular/all),支持分页与标签补齐。
Inputs: ps, page, limit, tag_limit, +1 more.
post_comment发表评论 / 回复ADestructive
在视频或动态下发表评论,可选本地图片;提供 root/parent 可回复某条评论。默认只预览;confirm=true 才发布。评论是公开内容。
Inputs: message (required), root, video, parent, +3 more.
post_dynamic发布动态ADestructive
发布一条动态(文本,可选本地图片路径)。默认只预览;confirm=true 才发布。动态是公开内容。
Inputs: text, confirm, image_paths.
precious_list入站必刷CRead-only
获取 B 站“入站必刷”列表(扩展能力)。
Inputs: limit, tag_limit, include_tags.
rank_listB站排行榜ARead-only
获取 B 站排行榜(对应 /v/popular/rank/all)。返回标题、BV 号、链接、UP 主、分区、统计与标签。标签需逐条补齐,默认只补前 20 条。
Inputs: rid, type, limit, tag_limit, +1 more.
search搜索视频/用户BRead-only
按关键词搜索 B 站视频或用户;视频结果含 BV 号、链接、作者、标签。
Inputs: keyword (required), page, type, limit, +1 more.
send_message发送私信ADestructive
给指定用户发送私信。默认只预览;confirm=true 才发送。私信会立即送达对方。
Inputs: text (required), receiver_id (required), confirm.
toview稍后再看(扩展)BRead-only
读取当前账号的“稍后再看”列表。
Inputs: ps.
user_info用户信息BRead-only
获取 UP 主/用户的名片信息、等级、粉丝数、关注数。
Inputs: mid (required).
user_videos用户投稿CRead-only
获取指定 UP 主的投稿视频列表。
Inputs: mid (required), page, limit, order.
video_comments视频评论ARead-only
读取视频评论区(热门或按时间),包含评论内容、作者、点赞数与部分回复。
Inputs: video (required), ps, page, sort.
video_frames视频关键帧截图ARead-only
截取视频关键帧并作为图片返回。默认取 15%/50%/85% 三帧;可传秒数、时间(1:23)或百分比。DASH 抽帧失败时回退 B 站缩略图雪碧图;无 ffmpeg 时返回整张雪碧图。
Inputs: video (required), page, count, times, +4 more.
video_info视频详情BRead-only
获取视频详情:标题、简介、封面、UP 主、统计、分P、标签、可用字幕语言。
Inputs: video (required), page, include_subtitles.
video_transcript视频字幕/转写文本ARead-only
读取视频字幕全文与时间分段。B 站 AI 字幕通常可用;无字幕时返回可用语言与改用 video_frames 的提示。支持多语言字幕。
Inputs: video (required), lang, page.
weekly_issues每周必看期数BRead-only
列出 B 站每周必看的期数、主题与链接(对应 /v/popular/weekly)。
Inputs: limit.
weekly_list每周必看单期ARead-only
获取指定期数的每周必看视频列表(对应 /v/popular/weekly?num=395)。不传 number 时默认最新一期。返回标题、链接、标签等。
Inputs: limit, number, tag_limit, include_tags.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 29 tools
Most tools target clearly different resources+actions: reads (video_info, user_info, video_comments), news sources (rank_list, popular_list, weekly_list, precious_list), and writes (like_video, coin_video, post_comment, send_message). The main risk is weekly_issues vs weekly_list, whose boundaries (episode metadata vs videos of an episode) could confuse an agent, plus the cluster of distinct-but-similar list sources.
Everything is snake_case, but conventions are mixed: some names are verb_noun (list_followings, list_followers, list_favorites, post_comment, follow_user), while many use noun+list or bare nouns (rank_list, popular_list, weekly_list, precious_list, notifications, messages, history, toview). It stays readable but is not a predictable single pattern.
29 tools is on the heavy side for any single server, but the B站 domain is genuinely broad (feeds, search, users, comments, frames, and seven distinct write actions). Each tool maps to a real endpoint, so it is defensible though borderline.
Coverage is strong across the video-lifecycle: discover (search/rank/popular/weekly), inspect (video_info, video_frames, video_transcript, video_comments, user_info), and act (like/coin/favorite/comment/dynamic/follow/message) with a preview-confirm safety pattern. Minor gaps remain (no thread-level comment retrieval beyond video_comments, no edit/delete of own content).
Maintenance
Related MCP Connectors
214 tools for AI agents over one MCP endpoint: image, video, audio, 3D, data, storage, mail, GPUs.
660+ data tools for agents: TikTok, Douyin, Instagram, YouTube, X, weather, GitHub. Pay per call.
Build, run, schedule, and publish AI video pipelines to YouTube and TikTok from any MCP client.
Publish and schedule videos to TikTok, YouTube Shorts, Instagram, Facebook, LinkedIn, Pinterest, Bluesky, Threads and X from Claude, Cursor or any MCP client. Upload once, post everywhere, track views in unified analytics, and retry failed posts. Official platform APIs only, free plan available. Docs: https://docs.multi-upload-tool.com/mcp
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI clients to query and download Bilibili video data, including metadata, streams, danmaku, subtitles, comments, search, hot lists, users, live rooms, and account read-only items through MCP tools.151MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to operate a user's own Bilibili account through MCP tools: scan-code login, browsing recommendations and rankings, watching videos with AI summaries, subtitles and frame overviews, plus commenting, @-mentioning, direct messaging, posting dynamics, and uploading videos. All operations return structured JSON with built-in rate limiting, audit logging, and safety guardrails.1,154 PyPI389MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP-capable AI assistants to operate Bilibili end to end through 27 tools: QR-code login, video search and content collection (comments, subtitles, danmaku), publishing videos and dynamics with AI-content declarations and self-only visibility, plus rankings, analytics, and messaging interactions. It is a modified fork that fixes cookie handling and the submission zone table.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI clients to search and open Bilibili videos, control a logical playback clock (play/pause/seek), read and post comments, like, coin, favorite, and fetch or export subtitle tracks through compact plain-text tool output. Write operations require a Bilibili login, which can be established by QR scan in an accompanying web console.MIT