Bilibili Api Mcp Server

by SMYB5431

300 downloads
Not rated
GitHub

Description

# Bilibili API MCP Server An MCP (Model Context Protocol) server for the Bilibili API, supporting a wide range of operations. ## Requirements - [uv](https://docs.astral.sh/uv/) – A fast, all-in-one project and dependency manager for Python. ## Usage ### Option 1: Install from…

About

# Bilibili API MCP Server An MCP (Model Context Protocol) server for the Bilibili API, supporting a wide range of operations. ## Requirements - [uv](https://docs.astral.sh/uv/) – A fast, all-in-one project and dependency manager for Python. ## Usage ### Option 1: Install from PyPI (Recommended) Configure the server in…

Details

Author
SMYB5431
Downloads
300
Categories
Developer Tools, API

- Intelligent video search and recommendation with rationales
- Search Bilibili users by name, sortable by followers
- Retrieve user’s latest posts, videos, and public collections
- Fetch danmaku (bullet comments) from any video
- Supports exact-match user lookup and fuzzy collection search

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Bilibili Api Mcp Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Use uvx bilibili-api-mcp-server as the command in any MCP client’s JSON configuration. Alternatively, clone the repository, install dependencies with uv sync, and point the client to the local installation. The server exposes multiple tools for searching, user content retrieval, and danmaku fetching.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "bilibili api mcp server": {
            "bilibili": {
                "type": "stdio",
                "isActive": true,
                "command": "uvx",
                "args": [
                    "bilibili-api-mcp-server"
                ]
            }
        }
    }
}

McpServers

{
    "bilibili": {
        "type": "stdio",
        "isActive": true,
        "command": "uvx",
        "args": [
            "bilibili-api-mcp-server"
        ]
    }
}

Bilibili API MCP Server

An MCP (Model Context Protocol) server for the Bilibili API, supporting a wide range of operations.

Requirements

- uv – A fast, all-in-one project and dependency manager for Python.

Usage

Option 1: Install from PyPI (Recommended)

Configure the server in any MCP client; it will be downloaded and started automatically.

{
  "mcpServers": {
    "bilibili": {
      "type": "stdio",
      "isActive": true,
      "command": "uvx",
      "args": [
        "bilibili-api-mcp-server"
      ]
    }
  }
}

> 💡 Tip: You can copy mcp-config.json from the project root as a ready-made configuration.

Option 2: Run Locally for Development

1. Clone the repository:

git clone https://github.com/SMYB5431/bilibili-api-mcp-server.git
cd bilibili-api-mcp-server

2. Install dependencies with uv:

uv sync

3. Configure the server in any MCP client:

{
  "mcpServers": {
    "bilibili": {
      "command": "uvx",
      "args": [
        "--directory",
        "/your-project-path/bilibili-api-mcp-server",
        "run",
        "bilibili.py"
      ]
    }
  }
}

Getting Started

Supported Operations

Basic Search

1. search_and_recommend_videos – Intelligent video search and recommendation.
- Sorts results by “comprehensive” ranking.
- Automatically filters out classroom videos (cheese links).
- Returns the top 15 videos (configurable).
- Provides recommendation rationales based on search results.
- Analyzes video quality and popularity.
- Generates concise content summaries and recommendation reports.

2. search_user – Search for Bilibili users, sortable by follower count.

3. get_user_id_by_name – Retrieve a user’s UID by username.
- Default mode: returns only the UID for quick identification.
- Detailed mode: returns full user profile and exact-match status.
- Exact-match priority: prioritizes exact username matches.
- Robust error handling with clear messages.

User Content Retrieval

4. get_user_dynamics – Fetch the latest posts from a user.
- Accepts username directly (e.g., “技术爬爬虾”).
- Configurable number of posts (default 10).
- Returns content, timestamp, and link for each post.

5. get_user_videos – Fetch the latest videos uploaded by a user.
- Accepts username directly.
- Configurable number of videos (default 10).
- Returns title, BV ID, view count, duration, and other details.

6. get_user_collections – Retrieve a user’s public collections.
- Accepts username directly.
- Returns collection title, video count, total views, and links.

7. get_collection_videos – List videos in a specific collection.
- Accepts collection name or ID.
- Configurable number of videos (default 10).
- Returns detailed video information (title, views, likes, coins).
- Supports fuzzy matching on collection names.

8. search_collection_by_keyword – Search for videos containing a keyword within all collections of a user.
- Returns matching collections and their video lists.
- Ideal for quickly locating topic-specific content.

Additional Features

9. get_video_danmaku – Retrieve danmaku (bullet comments) for a video.
- Accepts video URL or BV ID.
- Automatically extracts BV ID from URL.
- Supports multi-part videos.
- Returns detailed video info and full danmaku data.

Disclaimer

This project uses publicly available content from the Bilibili creator “技术爬爬虾” for demonstration purposes only.
It is intended solely for educational and research use and complies with Bilibili’s Terms of Service.
For any copyright concerns, please contact the project maintainer.

License

MIT

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.