Get the FREE Ultimate OpenClaw Setup Guide →

bilibili-api

用于哔哩哔哩 API 的 MCP(模型上下文协议)服务器,支持多种操作。

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio smyb5431-bilibili-api-mcp-server uvx bilibili-api-mcp-server

How to use

This MCP server provides a set of Bilibili API operations accessible via the MCP protocol. It can be used to perform advanced searches, user lookups, and content retrieval such as videos, dynamics, collections, and danmaku data. The server is intended to be run through uv (the project management tool) and exposed to MCP clients either directly via a configured MCP configuration or by launching the server through uvx as shown in the example. Available operations include: search_and_recommend_videos for intelligent video search and recommendations; search_user and get_user_id_by_name for user discovery and identification; get_user_dynamics, get_user_videos, and get_user_collections for user-related content; get_collection_videos and search_collection_by_keyword for accessing collections and their contents; and get_video_danmaku for retrieving video danmaku data. Use these tools to build rich content workflows for video discovery, monitoring, and analysis on Bilibili data. When configuring clients, you can reference either the in-repo mcp-config.json example or the specific runtime command shown below to start the server via uvx.

How to install

Prerequisites:

  • uv (the project management tool) installed on your system
  • Access to a network to fetch dependencies

Option A: Use via PyPI (recommended by project)

  1. Ensure uv is installed and available in your environment.
  2. In any MCP client, configure the server using the following, which will automatically download and enable the server:
{
  "mcpServers": {
    "bilibili": {
      "type": "stdio",
      "isActive": true,
      "command": "uvx",
      "args": [
        "bilibili-api-mcp-server"
      ]
    }
  }
}

Option B: Local development run

  1. Clone the repository and enter the project:
git clone https://github.com/SMYB5431/bilibili-api-mcp-server.git
cd bilibili-api-mcp-server
  1. Install dependencies via uv:
uv sync
  1. In any MCP client, configure this server to run from your project path:
{
  "mcpServers": {
    "bilibili": {
      "command": "uvx",
      "args": [
        "--directory",
        "/your-project-path/bilibili-api-mcp-server",
        "run",
        "bilibili.py"
      ]
    }
  }
}
  1. Start using the server through your MCP client once the configuration is loaded.

Additional notes

Tips and notes:

  • The server is designed to be run with uv/uvx and can be configured via an mcp-config.json example file in the project root.
  • If you prefer PyPI-based usage, the recommended option is to run uvx with the package name, which will download and launch the server automatically.
  • You can customize the mcp configuration per client; the example in the README demonstrates a typical setup. Ensure the directory paths in your local environment reflect your actual project structure.
  • No special environment variables are strictly required to run the server, but you may add placeholders under env if your deployment environment needs them. For example, if you later introduce API keys or rate limit controls, you could configure: "env": { "BILI_API_KEY": "<your-key>" }

Related MCP Servers

Sponsor this space

Reach thousands of developers