An MCP server to fetch Bilibili video information like subtitles, comments, and danmaku.
Project description
MCP Server for Bilibili Video Info
A Bilibili MCP Server that can retrieve subtitles, danmaku (bullet comments), and comments information from videos using the video URL.
Usage
This MCP server supports three transport methods:
- stdio
{
"mcpServers": {
"bilibili-video-info-mcp": {
"command": "uvx",
"args": [
"bilibili-video-info-mcp"
],
"env": {
"SESSDATA": "your valid sessdata"
}
}
}
}
- sse (Server-Sent Events) run bilibili-video-info-mcp in sse mode
cp .env.example .env
uvx run --env .env bilibili-video-info-mcp sse
then config your mcp client
{
"mcpServers": {
"bilibili-video-info-mcp": {
"url": "http://{your.ip.address}:$PORT$/sse"
}
}
}
- streamable-http (HTTP Streaming) run bilibili-video-info-mcp in streamable-http mode
cp .env.example .env
uvx run --env .env bilibili-video-info-mcp streamable-http
then config your mcp client
{
"mcpServers": {
"bilibili-video-info-mcp": {
"url": "http://{your.ip.address}:$PORT$/mcp"
}
}
}
}
MCP Tools List
1. Get Video Subtitles
{
"name": "get_subtitles",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
2. Get Video Danmaku (Bullet Comments)
{
"name": "get_danmaku",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
3. Get Video Comments
{
"name": "get_comments",
"arguments": {
"url": "https://www.bilibili.com/video/BV1x341177NN"
}
}
FAQ
1. How to find SESSDATA?
- Log in to the Bilibili website
- Open browser developer tools (F12)
- Go to Application/Storage -> Cookies
- Find the value corresponding to SESSDATA
2. Error "SESSDATA environment variable is required"
Make sure you have set the environment variable:
export SESSDATA="your SESSDATA value"
3. What video link formats are supported?
Standard Bilibili video links are supported, such as:
- https://www.bilibili.com/video/BV1x341177NN
- https://b23.tv/xxxxx (short links)
- Any link containing a BV number
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bilibili_video_info_mcp-0.2.0.tar.gz.
File metadata
- Download URL: bilibili_video_info_mcp-0.2.0.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e78e6533fb222205a340586ffa3be96b563e95d5598e0b73c4dcb84a4ccf6fb
|
|
| MD5 |
21036632a22f9d298518e44f18397e13
|
|
| BLAKE2b-256 |
0723066c20a3298ff31e383ad11a80061d7eaffb62fa4d4294ee935cb08e981b
|
File details
Details for the file bilibili_video_info_mcp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: bilibili_video_info_mcp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea6d1c992a1646ee30af9bdeaca5bf7d37173ff80fd81fb836853d0152661971
|
|
| MD5 |
7514d59b9b54de6d210e8a3de306e747
|
|
| BLAKE2b-256 |
4466bfbb3c81c85378be1d11c1bd12b2173587f445c4c0ca8795b0983ecb9b82
|