Bilibili Video Info Mcp

by lesir831

336 downloads
Not rated
GitHub

About

Bilibili Video Info Mcp is an MCP (Model Context Protocol) server that retrieves subtitles, danmaku (barrage), and comments from Bilibili videos. It is designed for users who want to integrate Bilibili video information into AI-powered workflows.

Details

Author
lesir831
Downloads
336
Categories
Media

- Fetches video subtitles via get_subtitles tool.
- Retrieves danmaku (barrage) via get_danmaku tool.
- Gets video comments via get_comments tool.
- Uses Bilibili session cookie for authentication.
- Supports standard and shortened Bilibili URLs.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Bilibili Video Info Mcp
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Configure your MCP client with the command uvx and arguments ["bilibili-video-info-mcp"]. Set the environment variable SESSDATA to your valid Bilibili session cookie. Invoke the tools get_subtitles, get_danmaku, or get_comments by providing the video URL as the url argument.

get_subtitles

获取B站视频的字幕内容 Args: url: B站视频链接,例如 https://www.bilibili.com/video/BV1x341177NN Returns: 列表形式的字幕内容,按语言分组

get_danmaku

获取B站视频的弹幕内容 Args: url: B站视频链接,例如 https://www.bilibili.com/video/BV1x341177NN Returns: 列表形式的弹幕内容

get_comments

获取B站视频的热门评论 Args: url: B站视频链接,例如 https://www.bilibili.com/video/BV1x341177NN Returns: 列表形式的热门评论

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "bilibili video info mcp": {
            "bilibili-video-info-mcp": {
                "command": "uvx",
                "args": [
                    "bilibili-video-info-mcp"
                ],
                "env": {
                    "SESSDATA": "your valid sessdata"
                }
            }
        }
    }
}

McpServers

{
    "bilibili-video-info-mcp": {
        "command": "uvx",
        "args": [
            "bilibili-video-info-mcp"
        ],
        "env": {
            "SESSDATA": "your valid sessdata"
        }
    }
}

MCP Server for Bilibili Video Info

这是一个 MCP (Model Context Protocol) Server应用,可以获取 Bilibili 视频的字幕、弹幕和评论信息。

MCP 工具列表

1. 获取视频字幕列表

{
  "name": "get_subtitles",
  "arguments": {
    "url": "https://www.bilibili.com/video/BV1x341177NN"
  }
}

2. 获取视频弹幕

{
  "name": "get_danmaku",
  "arguments": {
    "url": "https://www.bilibili.com/video/BV1x341177NN"
  }
}

3. 获取视频评论

{
  "name": "get_comments",
  "arguments": {
    "url": "https://www.bilibili.com/video/BV1x341177NN"
  }
}

使用方法

MCP 客户端配置

{
"mcpServers": {
"bilibili-video-info-mcp": {
"command": "uvx",
"args": [
"bilibili-video-info-mcp"
],
"env": {
"SESSDATA": "your valid sessdata"
}
}
}
}

常见问题

1. 找不到 SESSDATA 怎么办?

1. 登录 Bilibili 网站
2. 打开浏览器开发者工具 (F12)
3. 进入 Application/Storage -> Cookies
4. 找到 SESSDATA 对应的值

2. 报错 "SESSDATA environment variable is required"

确保已经设置了环境变量:

export SESSDATA="你的SESSDATA值"

3. 视频链接支持哪些格式?

支持标准的 Bilibili 视频链接,例如:
- https://www.bilibili.com/video/BV1x341177NN
- https://b23.tv/xxxxx (短链接)
- 包含 BV 号的任何链接

许可证

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.