bilibili MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bilibili MCP Server search for bilibili videos about machine learning"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bilibili MCP Server
A MCP server for Bilibili API integration
English | 简体中文
Model Context Protocol (MCP) Server for the bilibili.com API.
Features
User Info
Get user information by
midSearch video information by
bvidSearch videos by keywords
Related MCP server: Bilibili API MCP Server
使用方法
Streamable HTTP 模式
bilibili-mcp-server支持两种运行模式:
stdio模式(默认):通过标准输入输出与MCP客户端通信
streamable-http模式:通过HTTP协议提供MCP服务,支持SSE(Server-Sent Events)
Streamable HTTP 模式使用
要使用streamable-http模式,请使用以下命令启动服务器:
# 基本启动
node dist/streamable-http.js
# 指定端口
HTTP_API_PORT=8080 node dist/streamable-http.js
# 启用访问令牌认证
HTTP_API_TOKEN=your-secret-token HTTP_API_PORT=8080 node dist/streamable-http.js服务器启动后,可以通过以下端点访问:
MCP API端点:
http://localhost:PORT/mcp如果启用了令牌认证,客户端需要在请求头中添加:
Authorization: Bearer your-secret-token
环境变量
HTTP_API_COOKIE(可选):设置此环境变量以提供您的Bilibili Cookie用于认证请求。这有助于避免因Bilibili的反机器人措施导致的"请求失败,封控检测问题"。示例格式:SESSDATA=您的SESSDATA值; buvid3=您的buvid3值HTTP_API_TOKEN(可选):用于streamable-http模式的访问令牌认证。如果设置此环境变量,客户端请求时需要提供Bearer token进行身份验证。示例:your-secret-tokenHTTP_API_PORT(可选):streamable-http服务器监听的端口号,默认为3000。示例:8080
cookie 可以在浏览器上获取。
注意:如果您使用的是 Chrome 浏览器,请确保已登录 Bilibili 账号。
Claude Desktop
Refer to the official documentation
config for npm (recommended)
{
"mcpServers": {
"bilibili": {
"command": "npx",
"args": ["-y", "@masx200/bilibili-mcp-server"],
"env": {
"HTTP_API_COOKIE": "您的SESSDATA值; buvid3=您的buvid3值"
}
}
}
}or
config for local cloned repo
{
"mcpServers": {
"bilibili": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/bilibili-mcp-server/dist/index.js"
],
"env": {
"HTTP_API_COOKIE": "您的SESSDATA值; buvid3=您的buvid3值"
}
}
}
}Save the configuration and restart. You will see the new bilibili MCP option
as shown below:
Demo Vedio
https://github.com/user-attachments/assets/813dece6-c9b5-4bc5-96c1-c3b4d284cc76
Local Development
Install dependencies
pnpm ibuild
pnpm build
# or
pnpm devdebug for local repo, see above.
Publishing
To publish a new version to npm:
# For patch version update (0.0.x)
pnpm publish:patch
# For minor version update (0.x.0)
pnpm publish:minor
# For major version update (x.0.0)
pnpm publish:majorThese commands will automatically:
Bump the version in package.json
Build the project
Publish to npm registry
Credits
Available Tools
3 toolsget_user_infoA
Get information about a Bilibili user
Inputs: mid (required).
get_video_infoB
Get detailed information about a Bilibili video
Inputs: bvid (required).
search_videosB
Search for videos on Bilibili
Inputs: keyword (required), page, count.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool targets a distinct resource and action: user info, video info, and searching videos. There is no overlap or ambiguity between them.
Names follow a mostly consistent pattern with 'get_' prefix for retrieving specific resources and 'search_' for the search operation. Minor deviation: search_videos doesn't include '_info' suffix, but overall the style is clear.
Three tools is on the lower end but acceptable for a focused read-only server covering user and video lookup plus search. It feels intentionally minimal rather than incomplete.
The set covers basic needs for retrieving user info, video details, and searching, but notable gaps include listing a user's uploaded videos, fetching comments, or trending content. Still, the core read-only workflows are supported.
Related MCP Connectors
Track Bilibili creators and get the latest updates on videos, dynamics, and articles. Fetch user p…
Bilibili (B站) data without login: video stats, comments, danmaku, creators, trending, hot searches.
Bilibili videos for AI agents: search, creators, trending, stats, tags and danmaku comments.
Bilibili public video, article, dynamic, creator, comments, reactions, and transcript tools.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Bilibili (B站) platform through API and web scraping. Supports video search, article search, video info retrieval, comment fetching, danmaku extraction, and article content access.4-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Bilibili (哔哩哔哩) through its API, supporting video search and recommendations, user search, dynamic feeds, video collections, and danmaku retrieval through natural language.5-
- AlicenseAqualityBmaintenanceEnables agents to search, explore trending content, retrieve video metadata and hot comments, and obtain subtitle transcripts for summarisation on Bilibili, with an anonymous tier and an optional account tier for personalized feeds.104MIT
- AlicenseBqualityBmaintenanceEnables reading public Bilibili video information — keyword search, UP profiles and uploads, video details and parts, comments and replies, danmaku, subtitles, and frame snapshots — through an MCP interface, with optional Bilibili login for authenticated features such as comments and subtitles.16104 PyPI3Apache 2.0