Skip to main content

An MCP server to fetch Bilibili video information like subtitles, comments, and danmaku.

Project description

MCP Server for Bilibili Video Info

English 中文

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:

  1. stdio
{
    "mcpServers": {
        "bilibili-video-info-mcp": {
            "command": "uvx",
            "args": [
                "bilibili-video-info-mcp"
            ],
            "env": {
                "SESSDATA": "your valid sessdata"
            }
        }
    }
}
  1. 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"
        }
    }
}
  1. 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?

  1. Log in to the Bilibili website
  2. Open browser developer tools (F12)
  3. Go to Application/Storage -> Cookies
  4. 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:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilibili_video_info_mcp-0.2.0.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilibili_video_info_mcp-0.2.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

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

Hashes for bilibili_video_info_mcp-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5e78e6533fb222205a340586ffa3be96b563e95d5598e0b73c4dcb84a4ccf6fb
MD5 21036632a22f9d298518e44f18397e13
BLAKE2b-256 0723066c20a3298ff31e383ad11a80061d7eaffb62fa4d4294ee935cb08e981b

See more details on using hashes here.

File details

Details for the file bilibili_video_info_mcp-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bilibili_video_info_mcp-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea6d1c992a1646ee30af9bdeaca5bf7d37173ff80fd81fb836853d0152661971
MD5 7514d59b9b54de6d210e8a3de306e747
BLAKE2b-256 4466bfbb3c81c85378be1d11c1bd12b2173587f445c4c0ca8795b0983ecb9b82

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page