Bilibili MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add bilibili-mcp-db67 -- npx bilibili-mcp-js
README.md

An MCP server for searching Bilibili videos and accessing trending content.

Bilibili MCP

简介

这是一个基于 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

截图

Tools (5)

search_videosSearch for Bilibili video content based on keywords.
get_trendingRetrieve popular content including rankings and trending lists.
get_video_detailsGet detailed information about a specific video using its BV or AV ID.
get_creator_infoRetrieve information about a content creator including follower counts.
get_anime_scheduleGet the anime broadcast schedule for a specific time range.

Environment Variables

TRANSPORTSets the transport mode (e.g., remote for HTTP)
PORTSets the port for remote transport mode

Configuration

claude_desktop_config.json
{"mcpServers": {"bilibili-search": {"command": "npx", "args": ["bilibili-mcp-js"]}}}

Try it

Search for the latest trending videos on Bilibili today.
Find the video details for BV1xxxxxxxxx.
Get the anime broadcast schedule for this week.
Show me the profile information for the Bilibili creator with ID 123456.

Frequently Asked Questions

What are the key features of Bilibili MCP Server?

Search Bilibili video content lists. Access trending content including rankings and music charts. Retrieve detailed video information via BV or AV IDs. Fetch creator profiles including follower and following counts. Query anime broadcast schedules.

What can I use Bilibili MCP Server for?

Integrating Bilibili video search into AI-powered research assistants. Automating the retrieval of trending video data for content analysis. Building AI agents that can provide updates on anime release schedules. Quickly fetching creator statistics for influencer research.

How do I install Bilibili MCP Server?

Install Bilibili MCP Server by running: npx bilibili-mcp-js

What MCP clients work with Bilibili MCP Server?

Bilibili MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Bilibili MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare