bilibili-mcp-js

MCP.Pizza Chef: 34892002

Bilibili is China's largest video community, and this free add-on gives a chat assistant a window into it. Eight tools cover keyword video search, the trending and music charts, full details for any single video, an anime airing calendar, and a creator's follower and view counts. No account or paid key is required. Two caveats worth knowing: the tool that lists a creator's videos is switched off in the code and errors every time, and the search tool's result-count setting is ignored. Titles come back mostly in Chinese.

Data
Web/Research

Use This MCP server To

Search Bilibili for videos on a topic I'm researching Check what is trending on Bilibili right now Look up a video's view count, length, and description Pull a creator's follower and following counts See which anime episodes air this week Compare how two Bilibili videos performed

README

Bilibili MCP

English 中文文档 日本語 Trust Score

简介

这是一个基于 Model Context Protocol (MCP) 的 B站视频搜索服务器。该服务器提供了简单的 API 接口,允许用户搜索 B站 的视频内容。提供LangChain调用示例、测试脚本。

鸣谢

功能特点

  • 搜索B站视频内容简介列表
  • 获取B站热门内容(综合热门、入站必刷、排行榜、全站音乐榜)
  • 获取B站视频详情信息(支持BV号或AV号)
  • 获取UP主信息(基本信息、粉丝数、关注数等)
  • 番剧时间表(时间范围内的番剧播出信息)

系统要求

  • Node.js >= 20.12.0

AI工具使用配置

以Trae为例

npm package

感谢HQHC发布的npm包

{
  "mcpServers": {
    "bilibili-search": {
    "command": "npx",
    "args": ["bilibili-mcp-js"],
    "description": "B站视频搜索 MCP 服务,可以在AI应用中搜索B站视频内容。"
    }
  }
}

本地编译使用

需要编译之后才可以使用. 先npm run build然后这里改成你build之后的dist文件夹路径,"args": ["d:\your-path\bilibili-mcp-js\dist\index.js"]

{
  "mcpServers": {
    "bilibili-search": {
      "command": "node",
      "args": ["d:\\your-path\\bilibili-mcp-js\\dist\\index.js"],
      "description": "B站视频搜索 MCP 服务,可以在AI应用中搜索B站视频内容。"
    }
  }
}

快速开始

如果要运行langchain例子,请先配置llm模型,修改.\example.ts文件。

const llm = new ChatOpenAI({
  modelName: "gpt-4o-mini",
  temperature: 0,
  openAIApiKey: "your_api_key", // 替换成你模型的密钥
  configuration: {
    baseURL: "https://www.api.com/v1", // 替换成你模型的API地址
  },
});

bun:

# 安装依赖
bun i
# stdio 模式
bun index.ts
# streamable http 模式
TRANSPORT=remote bun index.ts
TRANSPORT=remote PORT=8888 bun index.ts
# 测试脚本
bun test.js
# MCP Inspector
bun run inspector
# 运行langchain例子
bun build:bun
bun example.ts

npm:

# 安装依赖
npm i
# stdio 模式
npm run start
# streamable http 模式
TRANSPORT=remote npm run start
TRANSPORT=remote PORT=8888 npm run start
# 测试脚本
npm run test
# MCP Inspector
npm run inspector
# 运行langchain例子
npm run build
node dist/example.js

截图

Hosted deployment

A hosted deployment is available on Fronteir AI.

bilibili-mcp-js FAQ

Do I need a Bilibili account or a paid key?
No. The add-on quietly fetches the visitor cookies it needs on its own, so there is nothing to sign up for and nothing to pay.
Which apps does this work in?
Any assistant that lets you paste in a small server config, such as Claude Desktop, Cursor, or Trae. The project's own setup screenshot uses Trae.
How hard is setup?
You paste a short config block that launches it with npx. Node version 20.12 or newer has to be installed on your computer first.
Can I use this to list everything a creator has posted?
No. That tool is listed but deliberately disabled in the code and returns an error every time, because Bilibili blocks the request.
Can I use this to research a topic before making my own video?
Yes. Search by keyword, then pull view counts and descriptions for whichever results look worth studying.
Will the results be in English?
Mostly not. Titles, descriptions, and tags come back in Chinese, though your assistant can translate them for you on the spot.
Does asking for a specific number of results work?
No. The search tool accepts a result-count setting but never actually applies it, so you always get a full page back.
Can it change anything on Bilibili?
No. Every tool only reads. It cannot comment, like, upload, follow, or delete, so there is nothing it can break on your account.