bilibili-mcp
Provides tools for parsing Bilibili video links, retrieving video details (title, cover, description, uploader info), obtaining download links (1080P), and parsing collection videos.
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-mcpGet video details for https://b23.tv/XhtfoyZ"
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
一个用于解析哔哩哔哩(Bilibili)视频的 Model Context Protocol (MCP) 服务器,支持视频信息提取、下载链接获取和合集解析等功能。
功能特性
✅ 解析 Bilibili 视频链接(支持 b23.tv 短链接)
✅ 获取视频详细信息(标题、封面、简介、用户信息等)
✅ 获取视频下载链接(1080P 画质)
✅ 支持合集视频解析
✅ 获取合集视频列表
Related MCP server: Bilibili-Api
安装
方式一:使用 npx(推荐)
无需安装,直接运行:
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "mcp-server-bilibili"]
}
}
}方式二:全局安装
npm install -g mcp-server-bilibili然后在配置文件中使用:
{
"mcpServers": {
"bilibili": {
"command": "mcp-server-bilibili"
}
}
}方式三:从源码运行
# 克隆仓库
git clone https://github.com/fysh1010/bilibili-mcp.git
cd bilibili-mcp
# 安装依赖
npm install
# 构建
npm run build然后在配置文件中使用:
{
"mcpServers": {
"bilibili": {
"command": "node",
"args": ["E:\\path\\to\\bilibili-mcp\\build\\index.js"]
}
}
}配置 Claude Desktop
Windows
打开 Claude Desktop 配置文件:
%APPDATA%\Claude\claude_desktop_config.json添加以下配置:
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "mcp-server-bilibili"]
}
}
}重启 Claude Desktop
macOS
打开 Claude Desktop 配置文件:
~/Library/Application Support/Claude/claude_desktop_config.json添加以下配置:
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "mcp-server-bilibili"]
}
}
}重启 Claude Desktop
Linux
打开 Claude Desktop 配置文件:
~/.config/Claude/claude_desktop_config.json添加以下配置:
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "mcp-server-bilibili"]
}
}
}重启 Claude Desktop
可用工具
1. parse_bilibili_video
解析 Bilibili 视频链接,获取完整信息。
参数:
url(必填): Bilibili 视频链接,支持 b23.tv 短链接
示例:
请解析这个 Bilibili 视频:https://b23.tv/XhtfoyZ返回数据:
{
"code": 200,
"msg": "解析成功!",
"data": {
"title": "视频标题",
"cover": "封面图片URL",
"description": "视频简介",
"url": "视频下载链接",
"user": {
"name": "UP主名称",
"avatar": "UP主头像URL"
},
"videos": [
{
"title": "视频标题",
"duration": 视频时长(秒),
"durationFormat": "04:45:58",
"url": "视频下载链接",
"index": 1
}
],
"totalVideos": 2
}
}2. get_bilibili_video_info
获取 Bilibili 视频的详细信息。
参数:
url(必填): Bilibili 视频链接
示例:
获取这个视频的详细信息:https://b23.tv/XhtfoyZ3. get_bilibili_download_urls
获取 Bilibili 视频的下载链接列表。
参数:
url(必填): Bilibili 视频链接
示例:
获取这个视频的下载链接:https://b23.tv/XhtfoyZ4. get_bilibili_basic_info
获取 Bilibili 视频的基本信息。
参数:
url(必填): Bilibili 视频链接
示例:
获取这个视频的基本信息:https://b23.tv/XhtfoyZ5. get_bilibili_collection
获取 Bilibili 合集中的所有视频列表信息。
参数:
url(必填): Bilibili 视频链接(合集链接)
示例:
获取这个合集的所有视频:https://b23.tv/XhtfoyZ使用示例
示例 1:解析单个视频
用户输入:
帮我解析这个 Bilibili 视频:https://b23.tv/XhtfoyZClaude 会自动调用:
parse_bilibili_video工具
返回结果: 视频的完整信息,包括标题、封面、下载链接、UP主信息等。
示例 2:获取下载链接
用户输入:
获取这个视频的下载链接:https://b23.tv/XhtfoyZClaude 会自动调用:
get_bilibili_download_urls工具
返回结果: 视频下载链接列表,包括合集中的所有视频。
示例 3:查看合集视频
用户输入:
这个合集有哪些视频?https://b23.tv/XhtfoyZClaude 会自动调用:
get_bilibili_collection工具
返回结果: 合集中的所有视频列表,包括每个视频的标题和时长。
测试
使用 MCP Inspector 测试工具:
npm run inspector这会启动一个交互式测试界面,您可以测试所有可用的工具。
开发
项目结构
bilibili-mcp/
├── src/
│ ├── BilibiliApi.ts # Bilibili API 封装层
│ └── index.ts # MCP 服务器主入口
├── build/ # 编译输出目录
├── package.json # 项目配置
├── tsconfig.json # TypeScript 配置
└── README.md # 项目说明构建项目
npm run build监听模式开发
npm run watchAPI 说明
本 MCP Server 使用第三方 API:https://api.bugpk.com/api/bilibili
支持的特性:
✅ 解析 Bilibili 短视频
✅ 画质为 1080P
✅ 支持合集视频
✅ 支持 b23.tv 短链接
注意事项
视频链接格式:支持完整的 Bilibili 链接和 b23.tv 短链接
画质限制:当前仅支持 1080P 画质
API 限制:使用第三方 API,可能会有调用频率限制
版权说明:请遵守 Bilibili 的用户协议和版权规定,仅用于个人学习和研究目的
故障排除
问题:无法连接到 MCP Server
解决方案:
检查 Claude Desktop 配置文件是否正确
确认网络连接正常
查看 Claude Desktop 日志获取详细错误信息
问题:解析视频失败
解决方案:
确认视频链接格式正确
检查视频是否为公开视频
确认第三方 API 服务是否正常
问题:npx 命令执行缓慢
解决方案:
使用全局安装方式:
npm install -g mcp-server-bilibili或者从源码运行
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
联系方式
致谢
Available Tools
5 toolsget_bilibili_basic_infoB
获取 Bilibili 视频的基本信息,包括标题、封面、简介、用户信息等
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bilibili 视频链接 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are absent, so the description carries the full burden of behavioral disclosure. It lists output fields but does not explicitly state read-only nature, side effects, authentication needs, or error behaviors. The verb "获取" implies read-only but is not explicit.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that is direct and informative, front-loading the action and primary resource. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple one-parameter tool with no output schema, the description covers the basic purpose and output fields. However, it does not disambiguate from sibling tools or explain the return format fully, making it only partially complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100% for the single 'url' parameter. The tool description adds no extra parameter meaning beyond what the schema already provides, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool gets basic Bilibili video info, listing specific fields (title, cover, description, user info). However, it does not distinguish from the similarly named sibling 'get_bilibili_video_info', so it lacks differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool vs. alternatives such as parse_bilibili_video or get_bilibili_video_info. There are no exclusions, prerequisites, or alternative references.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_bilibili_collectionB
获取 Bilibili 合集中的所有视频列表信息
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bilibili 视频链接(合集链接) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, and the description does not disclose behavioral traits such as output format, pagination limits, authentication requirements, or side effects. It simply describes a read operation without additional context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that communicates the core purpose without unnecessary words. It is front-loaded and easy to understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one parameter and no output schema, the description is minimally viable but lacks details about the return format, potential limitations, or prerequisites. The absence of annotations and output schema means the description should carry more weight, but it remains somewhat incomplete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description covers 100% of the single parameter (url) by explicitly stating it is a Bilibili collection link. The tool description adds no extra semantic meaning beyond what the schema already provides, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states that the tool retrieves all video list information from a Bilibili collection. It uses a specific verb (获取/get) and resource (Bilibili 合集), distinguishing it from sibling tools that focus on single video parsing, info, or download URLs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives like get_bilibili_video_info or parse_bilibili_video. The description only states what the tool does, without any exclusions or context for choosing it.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_bilibili_download_urlsA
获取 Bilibili 视频的下载链接列表,支持合集视频
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bilibili 视频链接 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full behavioral burden. It only states the action and a feature, but does not disclose authentication requirements, return format, potential large responses for collections, error handling, or any side effects. This is a minimal disclosure that leaves significant behavioral unknowns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, focused sentence that front-loads the primary action. It avoids unnecessary fluff and every phrase adds value, making it appropriately concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the simple one-parameter schema and no output schema, the description gives the basic purpose but omits details about the returned download link list (e.g., format, quality options, ordering) and error behavior. It meets the minimum viable standard but has clear gaps for an agent to use it confidently without further inference.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% for the 'url' parameter, which is described as 'Bilibili 视频链接'. The tool description adds the collection video support, but does not clarify whether the URL must be a collection URL or how collection handling affects the parameter. Baseline is 3 because the schema handles parameter meaning, but no extra semantic depth is added.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's function: '获取 Bilibili 视频的下载链接列表' (get the list of download links for Bilibili videos). It uses a specific verb and resource, and mentions support for collection videos, which distinguishes it from sibling tools focused on parsing, info, or basic info.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage (to retrieve download links) and notes support for collection videos, but does not explicitly state when to use this tool versus siblings like get_bilibili_video_info or get_bilibili_collection. No exclusions or alternatives are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_bilibili_video_infoA
获取 Bilibili 视频的详细信息,包括标题、封面、简介、用户信息、视频列表等
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bilibili 视频链接 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must carry the full burden of behavioral disclosure. It describes what information is retrieved (title, cover, etc.) and, by using '获取' (get), implies a read-only operation with no side effects. However, it does not mention error behaviors, authentication requirements, rate limits, or any potential side effects. The transparency is adequate for a simple info retrieval but lacks deeper behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the main action ('获取 Bilibili 视频的详细信息') and then provides a list of example data fields. Every word earns its place, with no redundancy or fillers. It is appropriately sized for a tool with one parameter and simple purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the low complexity (1 parameter, no output schema, no annotations), the description is fairly complete. It lists key return elements (title, cover, introduction, user info, video list) with an 'etc.' to indicate more. It differentiates from siblings like 'basic info' and 'download URLs', providing enough context for an agent to understand the tool's place. A minor gap is the lack of explicit return format, but the field list offers sufficient clarity for this simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema already describes the only parameter 'url' with 'Bilibili 视频链接' (Bilibili video link), achieving 100% schema description coverage. The description does not add extra meaning about the parameter format, constraints, or how the URL should be crafted. Since the schema fully covers the parameter, the added value from the description is minimal, aligning with the baseline score of 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '获取 Bilibili 视频的详细信息' (Get detailed Bilibili video information) and enumerates specific data fields (title, cover, description, user info, video list). This makes it distinct from siblings like 'get_bilibili_basic_info' (basic info) and 'get_bilibili_download_urls' (download URLs), establishing a unique resource and granularity.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage context by specifying 'detailed information' in contrast to sibling 'basic info', but it does not explicitly state when to use this tool versus alternatives or provide exclusions. There is no direct guidance on prerequisites or conditions, making the usage guidance implicit rather than explicit.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
parse_bilibili_videoC
解析 Bilibili 视频链接,获取视频的完整信息,包括标题、封面、视频链接、用户信息、合集视频列表等
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Bilibili 视频链接,支持 b23.tv 短链接和完整链接 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It does not state that the tool is read-only, makes network requests, or any rate limits or side effects. The description only says it 'parses' and 'gets' information, leaving key behavioral aspects undisclosed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that front-loads the main purpose and lists key output fields. It contains no redundant information, though it could benefit from a more structured breakdown.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, so the description must explain return values. It mentions several important fields (title, cover, video link, user info, collection playlist) but doesn't detail the structure or any edge cases. Given the tool's low complexity, this is adequate but leaves room for improvement.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides 100% coverage for the single 'url' parameter, including support for b23.tv short links and full links. The description doesn't add extra meaning beyond what the schema offers, so the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it parses Bilibili video links and retrieves complete video information, listing specific fields like title, cover, video link, user info, and collection video list. It distinguishes itself as a comprehensive parser, but doesn't explicitly name sibling tools as alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus sibling tools like get_bilibili_video_info or get_bilibili_collection. The description lacks any context about preferred use cases or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
get_bilibili_basic_info - First observed
get_bilibili_collection - First observed
get_bilibili_download_urls - First observed
get_bilibili_video_info - First observed
parse_bilibili_video
TDQS
Scored across 5 tools
The tools parse_bilibili_video, get_bilibili_video_info, and get_bilibili_basic_info all return overlapping video information (title, cover, user info), making it unclear which one an agent should select. The remaining two tools are distinct, but the majority of the surface has ambiguous boundaries.
All tool names follow a consistent verb_bilibili_noun pattern with snake_case, which is good. The only minor deviation is the use of both 'parse' and 'get' as verbs, but the overall pattern remains predictable and readable.
Five tools is a reasonable number for a video information server, fitting well within the ideal 3-15 range. However, the functional overlap among three of the tools suggests the count could be trimmed without losing capability.
The server covers the key read operations expected for Bilibili video content: basic info, detailed info, download URLs, and collection listing. Minor gaps exist, such as the lack of search or user profile tools, but these are not critical for the apparent purpose.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server aggregating hot-search boards from 8 Chinese platforms (Weibo, Zhihu, Bilibili, Douyin).
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for Studex tools, notifications, and profile integrations
Related MCP Servers
- AlicenseAqualityDmaintenanceA Bilibili MCP Server that can retrieve subtitles, danmaku (bullet comments), and comments information from videos using the video URL.320MIT
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server that provides services for the bilibili.com API, supporting functions such as obtaining user information and video search.31Apache 2.0
- AlicenseNot gradedqualityFmaintenanceAn 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.47 npm192MIT
- 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