Get the FREE Ultimate OpenClaw Setup Guide →

bilibili-video-info

Bilibili Video info MCP Server,可以获取视频的弹幕、字幕和评论区信息

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lesir831-bilibili-video-info-mcp uvx bilibili-video-info-mcp \
  --env SESSDATA="your valid sessdata"

How to use

This MCP server retrieves video metadata from Bilibili, including subtitles, danmaku (bullet comments), and user comments from a given video URL. It exposes three capabilities that you can invoke via MCP tools: get_subtitles, get_danmaku, and get_comments. By default, the server runs in stdio mode, but it also supports streaming modes such as Server-Sent Events (sse) and streamable-http, allowing clients to subscribe to real-time data streams. To use stdio mode, start the server with uvx as shown in the installation guide and provide your SESSDATA cookie via environment variables to access restricted data. For real-time access, you can run the server in sse or streamable-http mode and point your MCP client to the appropriate URL, for example /sse or /mcp endpoints depending on the mode. Then, configure your client to call the tools with a video URL, and the server will return the corresponding data structures.

How to install

Prerequisites:

  • uvx (Python uv/uvx runtime) installed on your system
  • Access to a valid Bilibili SESSDATA cookie if you need restricted data

Installation and setup steps:

  1. Install uvx (if not already installed)

    • Follow the uvx installation guide for your platform (e.g., pipx install uvx or an equivalent method).
  2. Prepare environment variables

    • Create a .env file or export the required variables in your session. At minimum: SESSDATA=your_valid_sessdata_value
  3. Run in stdio mode (default microservice entry)

    • This runs the MCP server via uvx in stdio mode, suitable for integrations that wire the MCP protocol over standard I/O.
    • Example: uvx run --env .env bilibili-video-info-mcp
  4. Optional: run in sse mode

    • Prepare environment, then start in sse mode: uvx run --env .env bilibili-video-info-mcp sse
    • Then configure your MCP client to connect to the provided /sse URL.
  5. Optional: run in streamable-http mode

    • Prepare environment, then start in streamable-http mode: uvx run --env .env bilibili-video-info-mcp streamable-http
    • Then configure your MCP client to connect to the provided /mcp URL.

Notes:

  • Ensure your network allows access to Bilibili and that SESSDATA is valid for the operations you perform.
  • If you encounter authentication errors, double-check that SESSDATA is exported to the environment read by uvx.

Additional notes

Tips and common issues:

  • SESSDATA: This value is required for accessing certain data endpoints. Store it securely and do not commit it to version control.
  • When using sse or streamable-http modes, the MCP client must handle streaming responses and reconnection logic in case of network interruptions.
  • The toolset includes get_subtitles, get_danmaku, and get_comments. Each tool expects a JSON payload with a video URL. Examples are provided in the README.
  • Supported Bilibili link formats include standard video URLs (BV prefix), short links (b23.tv), and any URL containing a BV number.
  • If you see rate-limit or 429-like responses, consider adding delays between repeated requests or using a valid session to increase reliability.

Related MCP Servers

Sponsor this space

Reach thousands of developers