Bilibili MCP logo

Bilibili MCP

Community
adoresever

B站 MCP Server - 支持搜索/评论/字幕/弹幕/回复

Publisheradoresever
Repositorybilibili-mcp
LanguagePython
Forks
32
Stars
159
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Bilibili MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    159 stars and 32 forks from the linked repository.

bilibili-mcp

B站(Bilibili)MCP Server —— 让 AI 助手直接操作B站。

支持 OpenClaw / Claude Code / Cursor / Cline 等所有 MCP 客户端。

27 个工具,覆盖登录认证、搜索采集、内容发布、数据分析、互动运营。

功能

登录认证

Tool功能说明
bili_login扫码登录生成二维码(base64图片),AI直接展示给用户扫码
bili_login_check登录状态检查轮询扫码状态,扫码成功后自动保存凭证
bili_check_credential凭证验证检查当前登录是否有效,返回用户名等信息

数据采集

Tool功能说明
bili_search搜索视频按关键词搜索,支持按播放量/最新/弹幕排序
bili_comments获取评论获取视频热门评论,含子评论
bili_subtitle获取字幕获取视频AI字幕(语音转文字)
bili_danmaku获取弹幕获取视频弹幕列表
bili_video_info视频详情获取播放量、评论数、收藏数等
bili_reply回复评论发表评论或回复评论(支持楼中楼)
bili_crawl批量采集搜索+评论+字幕一步到位

内容发布

Tool功能说明
bili_send_dynamic发图文动态发布文字/图文动态,支持定时发布、话题关联
bili_upload_video上传视频单P视频上传,支持封面、标签、分区选择
bili_upload_video_multi多P上传多分P视频合并投稿
bili_send_opus图文专栏发布图文长内容(Opus)
bili_video_zones分区查询获取常用分区ID,辅助视频上传

数据分析

Tool功能说明
bili_hot_videos热门视频获取当前B站热门视频列表
bili_hot_buzzwords热搜关键词获取B站热搜词/热门话题
bili_weekly_hot每周必看获取每周必看推荐视频
bili_rank排行榜全站及17个分区排行榜
bili_user_info用户信息获取UP主粉丝数、等级、总播放量等
bili_user_videos用户视频获取UP主投稿列表,支持排序和搜索

互动运营

Tool功能说明
bili_favorite_lists收藏夹列表获取自己或他人的收藏夹
bili_favorite_content收藏夹内容获取收藏夹内视频,支持搜索
bili_send_message发私信给指定用户发送文字私信
bili_unread_messages未读消息获取私信、@、回复、点赞等未读数
bili_received_replies收到的回复获取评论回复通知
bili_received_at_and_likes@和点赞获取@提及和点赞通知

快速开始

1. 克隆项目

bash
git clone https://github.com/adoresever/bilibili-mcp.git
cd bilibili-mcp

2. 安装依赖

bash
pip install -r requirements.txt

需要 Python 3.10+,视频上传自动截取封面需要 ffmpeg。

3. 登录

方式一:通过 AI 工具登录(推荐)

接入 MCP 后,直接对 AI 说"登录B站",AI 会调用 bili_login 生成二维码展示给你扫码,全程无需终端操作。

方式二:命令行登录

bash
python bili_login.py

4. 测试运行

bash
npx @modelcontextprotocol/inspector python mcp_server.py

接入 AI 工具

OpenClaw

bash
npm i -g mcporter
npx mcporter config add bilibili-mcp "python /path/to/bilibili-mcp/mcp_server.py"

或直接把 GitHub 链接粘贴到 OpenClaw 对话框,让它自动配置。

Claude Code

在项目目录创建 .mcp.json:

json
{
  "mcpServers": {
    "bilibili-mcp": {
      "command": "python",
      "args": ["/path/to/bilibili-mcp/mcp_server.py"]
    }
  }
}

Cursor / Cline

在设置中添加 MCP Server,command 填 python,args 填 mcp_server.py 的完整路径。

使用示例

接入后,你可以直接用自然语言让 AI 操作:

  • "登录B站"(AI会展示二维码给你扫)
  • "搜索B站上关于AI Agent的热门视频"
  • "获取这个视频的评论,分析用户需求"
  • "获取视频字幕,总结视频内容"
  • "帮我回复这条评论"
  • "批量采集OpenClaw相关视频的评论和字幕"
  • "帮我发一条B站动态,配上这几张图片"
  • "把这个视频上传到B站科技区"
  • "看看B站现在什么最火"
  • "获取科技区排行榜前10的视频"
  • "分析这个UP主的粉丝和投稿数据"
  • "我有多少未读私信和回复?"
  • "看看我的收藏夹里有什么"

技术栈

项目结构

bilibili-mcp/
├── mcp_server.py          # MCP Server 主文件(27个tool)
├── bili_login.py           # 命令行扫码登录(备用)
├── bili_credential.json    # 登录凭证(自动生成,勿提交)
├── requirements.txt        # Python 依赖
├── README.md               # 项目说明
├── LICENSE                 # MIT 开源协议
└── .gitignore              # Git 忽略文件

注意事项

  • 首次使用通过 AI 对话即可完成登录,无需终端操作
  • 凭证保存在本地,不会上传
  • 请求间隔自动控制,避免频率过快
  • 回复评论/发私信功能请谨慎使用,遵守B站社区规则
  • 视频上传未指定封面时,自动从视频第3秒截取(需要ffmpeg)
  • 本项目仅用于学习和研究

License

MIT

Installation

TypingMind
{
  "mcpServers": {
    "adoresever-bilibili-mcp": {
      "command": "python",
      "args": [
        "mcp_server.py"
      ]
    }
  }
}

Use Bilibili MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Bilibili MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Bilibili MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Bilibili MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "adoresever-bilibili-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Bilibili MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Bilibili MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Bilibili MCP to help me with this task?
Bilibili MCP
Sure. I read it.
Here is what I found using Bilibili MCP.

Frequently asked questions

What is the Bilibili MCP MCP server used for?

Bilibili MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Bilibili MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Bilibili MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Bilibili MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Bilibili MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Bilibili MCP MCP to TypingMind?

Bilibili MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Bilibili MCP MCP provide in TypingMind?

Bilibili MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Bilibili MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Bilibili MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇