bilibili-mcp is an MCP tool for fetching Bilibili's popular ranking, based on FastMCP and Bilibili's public API. It helps users call popular video data in real time within MCP-compatible clients.
Purpose The main purpose of this tool is to fetch information about videos on Bilibili's popular ranking, returning up to top_k entries (maximum 10).
Main capabilities
- Uses httpx to implement asynchronous requests
- Registered as a standard MCP tool via FastMCP
- Supports communication with MCP clients via stdio (e.g., Cursor)
- FastMCP automatically exposes a tool named get_popular
Usage
- Make sure to use Python >= 3.12 and install the required dependencies.
- The main code file can be bilibili_mcp.py, and the project structure includes this file.
- After starting the MCP Server, register it with Cursor or another MCP client to call it.
Applicable scenarios Suitable for developers and researchers who want to fetch Bilibili popular ranking video data in an MCP client.
Limitations
- For learning and research only
- The Bilibili API is a public API; avoid accessing it too frequently when using it
- The default User-Agent is "qwq", and it can be changed to a more reasonable string according to the actual situation