Bilibili MCP Server — Claude Code MCP server: features and setup
Give an AI agent access to Bilibili video search, subtitles, comments, and account collections. Node.js 20+ and account setup are required.
claude mcp add bilibili-mcp -- npx -y @xzxzzx/bilibili-mcpWhat Bilibili MCP Server does
The server lets an agent search for videos and creators, inspect video details, and browse a creator’s profile, uploads, series, and posts. It can retrieve subtitles, find matching phrases with timestamps, read comments and replies, and page through collections visible to the signed-in account. It connects as a local stdio server.
You need Node.js 20 or later. After adding the server to Claude Code, run npx -y @xzxzzx/bilibili-mcp@latest setup and then npx -y @xzxzzx/bilibili-mcp@latest check. Reconnect the client and call check_bilibili_credentials to verify the live session. Enter cookies in the local terminal; the configuration file is not guaranteed to receive OS-level encryption.
For videos without available subtitles, you can install a local faster-whisper model during setup and request ASR transcription. The feature is off by default and needs a ready model. Bilibili AI-generated subtitles may be inaccurate, so they should not be treated as human-verified quotations.
What it helps with
- find Bilibili videos by topic and select one by BVID
- retrieve subtitles with timestamps
- locate a phrase in a transcript and open its video moment
- read a video's comments and replies
- list videos in collections visible to the account
Example prompts for the agent
- Find Bilibili videos about discrete mathematics and return their titles, creators, lengths, and BVIDs.
- Read the subtitles for
BV1Eb411u7Fwwith timestamps and find mentions of functions. - Check my Bilibili login with
check_bilibili_credentials, then search for videos about programming.
How to install Bilibili MCP Server
Platform CLI
claude mcp add bilibili-mcp -- npx -y @xzxzzx/bilibili-mcpPlatform CLI
codex mcp add bilibili-mcp-server -- npx -y @xzxzzx/bilibili-mcpConfig file
{
"mcpServers": {
"bilibili-mcp-server": {
"command": "npx",
"args": [
"-y",
"@xzxzzx/bilibili-mcp"
]
}
}
}Config file
{
"servers": {
"bilibili-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@xzxzzx/bilibili-mcp"
]
}
}
}Platform CLI
gemini mcp add bilibili-mcp-server npx -y @xzxzzx/bilibili-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Bilibili MCP Server
How do I install Bilibili MCP Server in Claude Code?
Add it with claude mcp add bilibili-mcp -- npx -y @xzxzzx/bilibili-mcp. Then run npx -y @xzxzzx/bilibili-mcp@latest setup in a terminal to configure account access, and reconnect the client.
What does Bilibili MCP Server do?
It lets an agent search Bilibili videos and creators, retrieve video details, subtitles, and comments, and browse account collections.
What is required to transcribe a video with no subtitles?
Install a local ASR model during setup. The server uses faster-whisper, and transcription requires the model to be ready.