bilibili-agent-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| BILIBILI_COOKIE | No | 浏览器里完整 Cookie 字符串(推荐)。例如 "SESSDATA=...; bili_jct=...; buvid3=..."。不配置则以游客身份运行。 | |
| BILIBILI_FFMPEG | No | ffmpeg 路径。用于下载后自动合并音视频并写入章节,需确保在 PATH 中或在此指定绝对路径。 | ffmpeg |
| BILIBILI_BILI_JCT | No | 配合 BILIBILI_SESSDATA 使用的 csrf token(bili_jct)。 | |
| BILIBILI_MCP_HOST | No | 远程 HTTP 模式监听地址。 | 127.0.0.1 |
| BILIBILI_MCP_PORT | No | 远程 HTTP 模式监听端口。 | 8787 |
| BILIBILI_SESSDATA | No | 只填 SESSDATA 和 BILIBILI_BILI_JCT 这两项也可以作为 BILIBILI_COOKIE 的替代方式。需要 Cookie 的功能包括:720P/1080P 及以上清晰度(部分需大会员)、AI 字幕、稍后再看 / 收藏 / 历史 / 动态。 | |
| BILIBILI_MCP_TOKEN | No | 远程 HTTP 模式访问密钥(至少 16 位)。默认自动生成并持久保存到 ~/.bilibili-agent-mcp/token,密钥不对一律返回 404。 | |
| BILIBILI_USER_AGENT | No | 自定义 User-Agent。 | Chrome 130 |
| BILIBILI_ALLOW_WRITE | No | 设置为 "true" 才开放会修改账号的工具(如稍后再看添加 / 移除的 bili_watch_later_edit)。默认关闭。 | false |
| BILIBILI_DOWNLOAD_DIR | No | 下载与导出目录。本服务只读写该目录下的文件;远程模式的文件下载接口同样只能访问该目录。 | ~/Downloads/bilibili |
| BILIBILI_MCP_PUBLIC_URL | No | 远程 HTTP 模式对外地址,用于生成带访问密钥的下载链接。默认从请求头识别。 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| bili_resolveA | 把任意 B 站链接或编号解析成结构化 ID(视频 aid/bvid、番剧 ep/ss、用户 mid、直播间号、专栏 cv),支持 b23.tv 短链,并做 av⇄BV 互转。对应 Bilibili-Evolved 的「BV号转换」「av号链接」。 |
| bili_video_infoA | 获取视频的标题、完整简介、封面、UP主、发布时间、时长、播放/点赞/投币/收藏等数据、标签、分P列表与合集信息;番剧链接返回剧集列表与评分。对应 Bilibili-Evolved 的「展开完整简介」「查看封面」「元数据」等功能。 |
| bili_video_streamsA | 列出视频可用清晰度、编码,并返回选中的 DASH 视频流/音频流直链(含体积估算)。直链必须带 Referer: https://www.bilibili.com/ 请求头才能下载,有效期约 2 小时。想直接存到本地请用 bili_download。 |
| bili_downloadA | 把视频下载到本机(默认 ~/Downloads/bilibili,可用 BILIBILI_DOWNLOAD_DIR 修改)。DASH 音视频会用 ffmpeg 自动合并为 mp4 并写入章节元数据;没有 ffmpeg 时保留分离文件。可附带下载封面、ASS/XML 弹幕、SRT 字幕。任务在后台运行,超过 wait_seconds 未完成会先返回任务 ID,之后用 bili_download_status 查询。对应 Bilibili-Evolved 的「下载视频」「下载音频」「下载弹幕」「下载字幕」「查看封面」。 |
| bili_download_statusA | 查询下载任务进度与结果文件路径。不传 job_id 时列出本次会话的全部任务。 |
| bili_danmakuA | 获取视频全部弹幕。mode=stats 返回总数、高频弹幕、弹幕密度与高能时间点(适合分析观众反应);mode=lines 返回带时间戳的弹幕文本(可按时间段过滤,过多时均匀抽样);mode=ass/xml/json 把完整弹幕保存为文件并返回路径(ASS 可直接被播放器加载)。对应 Bilibili-Evolved 的「下载弹幕」与弹幕转换器。 |
| bili_subtitlesA | 获取视频字幕(含 AI 生成字幕)。format=text 返回「[mm:ss] 台词」形式的文字稿,最适合让 AI 总结、翻译、提炼要点;srt/ass/json 可选择保存为文件。只传 input 不传 lang 时会同时列出全部可用字幕语言。注意:AI 字幕通常需要登录 Cookie。对应 Bilibili-Evolved 的「下载字幕」。 |
| bili_chaptersA | 获取视频的分段章节(UP主设置的看点 / 番剧 OP、ED 时间),可输出为 ffmetadata(ffmpeg 写入章节)或 OGM 章节格式。对应 Bilibili-Evolved 的「保存视频元数据」。 |
| bili_commentsA | 获取视频评论(热门或最新),包括置顶评论、点赞数、IP 属地与热门楼中楼。用 next_offset 翻页。对应 Bilibili-Evolved 的评论区相关功能。 |
| bili_searchB | 在 B 站搜索视频、用户、番剧、影视、直播间或专栏。对应 Bilibili-Evolved 的「搜索栏 / Launch Bar」。 |
| bili_hotA | search_words=当前热搜词;popular=综合热门视频;ranking=分区排行榜(可指定 region);weekly=每周必看。对应 Bilibili-Evolved 的「热搜」与排行入口。 |
| bili_userA | 获取用户资料:昵称、签名、等级、粉丝数、获赞、认证,并可附带最近投稿。参数可以是 UID、空间链接或视频链接(取 UP 主)。 |
| bili_live_roomB | 查询直播间标题、开播状态、人气、分区、开播时间。 |
| bili_accountA | 读取已登录账号的数据(需配置 BILIBILI_COOKIE):me=账号信息;watch_later=稍后再看列表;favorites=收藏夹(不传 folder_id 列出收藏夹,传了则列出内容);history=观看历史;feed=关注动态(默认只看视频)。对应 Bilibili-Evolved 的「稍后再看」「收藏」「历史」「动态过滤」等功能。 |
| bili_watch_later_editA | 把视频加入或移出「稍后再看」。会修改账号数据:需要 Cookie(含 bili_jct)且设置 BILIBILI_ALLOW_WRITE=true 才可用。 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| summarize_bilibili_video | 读取视频信息、字幕和弹幕,生成结构化总结 |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 15 tools
Each tool targets a distinct resource or stage of the pipeline: link resolution, metadata, stream URLs, download, download status, danmaku, subtitles, chapters, comments, search, hot lists, live rooms, and account data are all clearly separated by their descriptions. Minor overlap exists between bili_user and bili_account (arbitrary user vs. logged-in self), and between bili_video_info and bili_chapters (video_info also mentions collection/分P info), but the descriptions disambiguate these well enough.
All 15 tools share the bili_ prefix and snake_case, giving a predictable, scannable namespace. Most names are resource-oriented nouns (bili_user, bili_video_info, bili_danmaku, bili_search) with a couple of verb-style outliers (bili_download, bili_watch_later_edit), a minor deviation from a strict pattern but still coherent.
15 tools sits at the top of the comfortable range, but each covers a genuinely different capability (metadata, streams, download, danmaku, subtitles, chapters, comments, search, hot, live, account, watch-later edit) with little redundancy. Slightly heavy but well justified by the breadth of the Bilibili domain.
The read surface is remarkably complete for a Bilibili content/analysis agent: identity resolution, user profiles, video metadata, streams, downloads with async status, danmaku, subtitles, chapters, comments, search, hot/ranking, live rooms, and account data (favorites, history, feed, watch later). The only write operation is watch-later editing, which is intentionally gated; broader write actions (like/coin/favorite/follow) are absent but arguably out of scope for this read-focused server.