bilibili-mcp
Provides tools for accessing authorized Bilibili user data via the official open platform, including video management, stats, and parsing URLs.
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 stats for my latest video"
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
一个合规优先的 Bilibili MCP Server,通过哔哩哔哩官方开放平台访问已授权账号的数据。
本项目不调用逆向整理的非公开接口,不绕过登录、签名或风控,也不提供任意用户/视频的批量抓取能力。
能力
MCP 工具 | 作用 | 官方 Scope |
| 本地解析 BV/av/ep/ss、空间、直播间和短链 | 无 |
| 获取已授权用户昵称、头像和 OpenID |
|
| 获取已授权用户拥有或联合投稿的单个稿件 |
|
| 分页查询已授权用户的稿件列表 |
|
| 获取关注、粉丝和审核通过稿件数 |
|
| 获取播放、点赞、投币、收藏、评论等数据 |
|
所有工具均为只读工具;网络请求使用官方签名 2.0(HMAC-SHA256)。
Related MCP server: bilibili-mcp
前置条件
在哔哩哔哩开放平台完成开发者入驻并创建应用。
为应用申请所需 Scope。
按官方 OAuth 2.0 文档取得已授权用户的
access_token。Node.js 20 或更高版本。
官方开放平台可能要求企业资质,实际准入规则以官方页面为准。
安装与构建
git clone https://github.com/nameefef/bilibili-mcp.git
cd bilibili-mcp
pnpm install
pnpm run build准备环境变量:
export BILIBILI_CLIENT_ID="your_client_id"
export BILIBILI_APP_SECRET="your_app_secret"
export BILIBILI_ACCESS_TOKEN="authorized_user_access_token"没有凭证时服务仍可启动,但只能使用本地的 bilibili_parse_url 工具。
MCP 客户端配置
把绝对路径替换为你本机的仓库位置:
{
"mcpServers": {
"bilibili": {
"command": "node",
"args": ["/absolute/path/to/bilibili-mcp/dist/index.js"],
"env": {
"BILIBILI_CLIENT_ID": "your_client_id",
"BILIBILI_APP_SECRET": "your_app_secret",
"BILIBILI_ACCESS_TOKEN": "authorized_user_access_token"
}
}
}
}不要把真实密钥写入会提交到 Git 的配置文件;更推荐由系统密钥管理器或进程环境注入。
开发
pnpm run dev
pnpm run check使用 MCP Inspector:
pnpm dlx @modelcontextprotocol/inspector node dist/index.js限制与安全
仅使用官方开放平台文档公开的接口。
只能读取明确授权给当前应用的账号及稿件数据。
访问令牌和应用密钥只从环境变量读取,不会出现在 MCP 工具参数或返回值中。
API 返回的头像、封面等资源应按官方规则缓存和使用。
遇到
127007、127011等错误时,请检查应用 Scope 和用户授权状态。平台接口、准入条件和配额可能变化,请以官方文档为准。
共创者
nameefef——项目发起人与维护者
OpenAI Codex——架构、实现、测试与文档协作
Codex 是 AI 编程助手,不拥有可计入 GitHub Contributors 图表的个人账号;共同创作关系在项目文档和提交说明中明确记录。
许可证
MIT。Bilibili、哔哩哔哩及相关标识属于其权利人,本项目与哔哩哔哩官方无隶属或背书关系。
Available Tools
6 toolsbilibili_get_authorized_userGet authorized Bilibili userARead-onlyIdempotent
Get the nickname, avatar URL, and app-scoped OpenID of the user who authorized the configured official Bilibili Open Platform access token. Requires USER_INFO scope.
Inputs: response_format.
bilibili_get_user_statsGet authorized Bilibili user statisticsARead-onlyIdempotent
Get following, follower, and approved-video counts for the authorized user through the official Open Platform. Requires USER_DATA scope.
Inputs: response_format.
bilibili_get_videoGet an authorized user's Bilibili videoARead-onlyIdempotent
Get one video submission owned or co-authored by the authorized user through the official Open Platform. Requires ARC_BASE scope; it cannot read arbitrary videos.
Inputs: resource_id (required), response_format.
bilibili_get_video_statsGet statistics for an authorized user's Bilibili videoARead-onlyIdempotent
Get views, likes, coins, favorites, replies, danmaku, and shares for a video owned or co-authored by the authorized user. Requires ARC_DATA scope.
Inputs: resource_id (required), response_format.
bilibili_list_videosList the authorized user's Bilibili videosARead-onlyIdempotent
List paginated video submissions belonging to the authorized user through the official Open Platform. Requires ARC_BASE scope. Page size is limited to 1-50.
Inputs: page, status, page_size, response_format.
bilibili_parse_urlParse Bilibili URL or identifierARead-onlyIdempotent
Parse a public Bilibili BV/av/ep/ss identifier or HTTPS URL locally and return its resource type, id, and canonical URL. Does not contact Bilibili or resolve b23.tv redirects.
Inputs: input (required), response_format.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a clearly distinct purpose: URL parsing, authorized user info, single video retrieval, video listing, user stats, and video stats. There is no overlap or ambiguity between them.
All tool names follow the same bilibili_verb_noun pattern using snake_case. This makes the tool set predictable and easy to navigate.
With 6 tools, the server is well-scoped for a Bilibili-focused MCP covering URL parsing and authorized user data retrieval. Each tool earns its place with no redundancy.
The toolset covers the core lifecycle of reading authorized user data and video stats. Minor gaps exist such as no batch video stats or search functionality, but these are not critical given the server's purpose.
Maintenance
Related MCP Connectors
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
MCP server aggregating hot-search boards from 8 Chinese platforms (Weibo, Zhihu, Bilibili, Douyin).
MCP server for ByteDance Seedream AI image generation
Remote MCP server for China brand visibility, destination demand, and KOL discovery workflows.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn 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.125 npm198MIT
- 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.224GPL 3.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server powered by public Bilibili APIs so AI agents can search videos and read public video and creator metadata.MIT
- AlicenseBqualityCmaintenanceBilibili MCP server enabling video search, comment management, danmaku, user info, dynamics, live streaming analysis, and more via 31 tools.316,305 npm12MIT