Provides tools for simulating browser operations on Bilibili, enabling automated video uploading, metadata management (titles, descriptions, tags, and categories), and account login via QR code.
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 (Playwright)Upload /videos/vlog.mp4 with title 'My New Vlog' and tags travel, lifestyle"
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 (Playwright 版)
基于 Playwright 模拟浏览器操作实现的 Bilibili (B 站) MCP 服务器,支持视频上传功能。
特性
✅ 扫码登录 - 使用 Bilibili App 扫码登录
✅ 视频上传 - 模拟浏览器操作上传视频
✅ 自动填表 - 自动填写标题、简介、标签、分区
✅ Cookie 持久化 - 登录状态自动保存
✅ HTTP API - 提供 RESTful API 接口
目录结构
bilibili-mcp/
├── server-playwright.js # MCP HTTP 服务器 (端口 18061)
├── login-playwright.js # 扫码登录工具
├── package.json # 依赖配置
├── cookies.json # 登录状态 (自动生成)
└── README.md # 使用文档安装
cd bilibili-mcp
npm installPlaywright 浏览器会自动安装。
使用方法
1. 登录 Bilibili
# 在 bilibili-mcp 目录
npm run login
# 或
node login-playwright.js运行后会打开浏览器窗口,显示二维码:
打开 Bilibili App
点击右上角扫描图标
扫描浏览器中的二维码
在手机上确认登录
登录成功后会自动保存 cookies。
2. 启动 MCP 服务器
# 在 bilibili-mcp 目录
npm start
# 或
node server-playwright.js服务器运行在 http://localhost:18061
3. 发布视频
使用 curl 调用 API:
curl -X POST http://localhost:18061/api/v1/publish \
-H "Content-Type: application/json" \
-d '{
"title": "视频标题",
"content": "视频简介",
"video_path": "/path/to/video.mp4",
"tid": 174,
"tags": ["标签 1", "标签 2"],
"copyright": 1
}'API 接口
健康检查
GET http://localhost:18061/health检查登录状态
GET http://localhost:18061/api/v1/login/status发布视频
POST http://localhost:18061/api/v1/publish
Content-Type: application/json
{
"title": "视频标题",
"content": "视频简介",
"video_path": "/path/to/video.mp4",
"tid": 174,
"tags": ["标签 1", "标签 2"],
"copyright": 1
}参数说明:
title- 视频标题 (最多 80 字)content- 视频简介video_path- 本地视频文件绝对路径tid- 分区 ID (默认 174=生活 - 其他)tags- 标签数组copyright- 1=原创,2=转载
配置 MCP Client
在 MCP 配置中添加:
{
"mcpServers": {
"bilibili": {
"command": "node",
"args": ["/path/to/bilibili-mcp/server-playwright.js"]
}
}
}常见问题
1. 登录过期
Bilibili cookies 有一定的有效期,如果发布时提示未登录,需要重新运行登录工具:
node login-playwright.js2. 浏览器窗口
登录时会显示浏览器窗口(方便扫码)
上传视频时无头模式运行(不显示窗口)
技术栈
Playwright - 浏览器自动化
Express - HTTP 服务器
Node.js - 运行环境
参考
License
MIT
注意
本项目仅供学习和个人使用,请遵守 Bilibili 的使用条款和社区规范。
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.