bilibili-mcp-server
Click on "Install 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-serversearch for 'Minecraft' videos"
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 Server
B 站的 MCP 服务。提供视频搜索、评论管理、弹幕字幕、用户信息、动态专栏、扫码登录、直播截图视觉分析等功能,共 31 个工具。
工具列表
类别 | 工具 | 数量 |
评论 |
| 3 |
搜索 |
| 2 |
视频 |
| 5 |
用户 |
| 7 |
内容 |
| 3 |
消息 |
| 2 |
直播 |
| 2 |
登录 |
| 2 |
系统 |
| 1 |
下载 |
| 3 |
弹幕 |
| 1 |
Related MCP server: BiliStalkerMCP
快速开始
环境要求
Node.js 22+
B 站账号(用于需要登录的操作)
ffmpeg(仅视频下载工具需要;macOS:
brew install ffmpeg,Windows:choco install ffmpeg,Linux:apt install ffmpeg)
安装
# 直接运行
npx bilibili-mcp-server
# 或全局安装
npm install -g bilibili-mcp-server
bilibili-mcp-server配置
支持环境变量或项目目录下的 .env 文件:
# 必填 - 从浏览器开发者工具 → Application → Cookies → bilibili.com 获取
export BILIBILI_SESSDATA=你的sessdata
export BILIBILI_BILI_JCT=你的bili_jct
export BILIBILI_DEDE_USER_ID=你的uid
# 可选 - Cookie 自动刷新
# 获取方式: bilibili.com → F12 → Console → 输入:
# console.log(localStorage.getItem('ac_time_value'))
export BILIBILI_REFRESH_TOKEN=你的refresh_token
# 可选 - 完整 Cookie(热搜等功能需要)
# export BILIBILI_FULL_COOKIE="buvid3=xxx; buvid4=xxx; _uuid=xxx; ..."
# 可选
export BILIBILI_AUTO_REFRESH=true
export BILIBILI_COOKIE_FILE=/path/to/cookie.json
export BILIBILI_DETECT_FILE=/path/to/detect.jsonMCP 客户端配置
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "bilibili-mcp-server"],
"env": {
"BILIBILI_SESSDATA": "你的sessdata",
"BILIBILI_BILI_JCT": "你的bili_jct",
"BILIBILI_DEDE_USER_ID": "你的uid"
}
}
}
}扫码登录
不想手动复制 Cookie 的话,可以调扫码登录:
调
bilibili_login获取二维码手机 B 站 App 扫码
调
bilibili_login_check检测登录状态登录成功自动保存 Cookie
工具说明
登录与认证
工具 | 功能 | 参数 |
| 生成扫码登录二维码 | - |
| 轮询扫码状态,登录成功自动保存 |
|
| 手动触发 Cookie 刷新 | - |
评论管理
工具 | 功能 | 参数 |
| 发布评论或回复 |
|
| 删除自己的评论 |
|
| 点赞/取消赞 |
|
视频与搜索
工具 | 功能 | 参数 |
| 搜索视频 |
|
| 视频详情 |
|
| 获取评论列表 |
|
| 获取字幕 |
|
| 获取弹幕 |
|
| 热门视频 |
|
| 热搜关键词 | - |
用户
工具 | 功能 | 参数 |
| 用户信息 |
|
| UP 主视频列表 |
|
| 收藏夹 |
|
动态与专栏
工具 | 功能 | 参数 |
| UP 主最新动态 |
|
| 专栏文章详情 |
|
| UP 主专栏列表 |
|
关注管理
工具 | 功能 | 参数 |
| 关注 UP 主 |
|
| 取消关注 |
|
| 关注列表 |
|
| 粉丝列表 |
|
关注/取关操作会被 B 站风控监控,不建议短时间内大量操作。
弹幕
工具 | 功能 | 参数 |
| 发送弹幕 |
|
弹幕发送是高风控操作,建议每天不超过 5 条。
下载
工具 | 功能 | 参数 |
| 下载视频(需 ffmpeg) |
|
| 下载专栏为 Markdown |
|
| 查看已下载列表 |
|
视频下载会自动下载 DASH 音视频并用 ffmpeg 合并为 mp4。默认保存到
./bilibili-downloads/。
消息通知
工具 | 功能 | 参数 |
| 检测新回复 |
|
| 查看未读通知 | - |
直播
工具 | 功能 | 参数 |
| 查询直播间信息 |
|
| 截取直播间当前画面(视觉分析) |
|
bilibili_live_screenshot会把关键帧截图作为图片返回给模型,让具备视觉能力的 AI 分析直播内容。如模型无视觉能力,仅返回文字元数据。
项目结构
src/
├── index.ts
├── env.ts
├── config.ts
├── api/
│ ├── http.ts
│ ├── bilibili.ts
│ ├── wbi.ts
│ ├── cookie.ts
│ ├── login.ts
│ └── danmaku.ts
├── tools/
│ ├── comment.ts
│ ├── video.ts
│ ├── user.ts
│ ├── content.ts
│ ├── message.ts
│ ├── login.ts
│ └── live.ts
└── types/
└── index.ts开发
npm install
npm run dev # 开发模式
npm run build # 构建
npm test # 测试许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityFmaintenanceAn MCP server that enables users to search Bilibili videos, access trending rankings, and retrieve detailed information about videos, content creators, and anime schedules. It allows AI applications to interact directly with Bilibili content via simple API interfaces.76188MIT
- Alicense-qualityAmaintenanceBiliStalkerMCP is a Bilibili MCP server designed to analyze a specific Bilibili user by providing tools to retrieve user profiles, videos, dynamics, articles, and followings.8MIT
- AlicenseBqualityDmaintenanceA MCP server providing 22 tools to interact with Bilibili API, enabling video info, search, user profile, comments, rankings, and messaging with login support for write operations.223GPL 3.0
- Alicense-qualityDmaintenanceAn MCP server powered by public Bilibili APIs so AI agents can search videos and read public video and creator metadata.MIT
Related MCP Connectors
MCP server for ByteDance Seedance AI video generation
MCP server for Hailuo (MiniMax) AI video generation
Markdown-first MCP server for Notion API with 8 composite tools and 39 actions.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Iseenope/bilibili-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server