Sponsored by Deepsite.site

Bilibii Mcp Server

Created By
tree8 months ago
这是一个基于Model Context Protocol (MCP)的服务,用于查询B站用户的粉丝数量。通过提供B站用户ID,可以获取该用户的粉丝数。
Content

Bilibili 粉丝数查询 MCP 服务

这是一个基于Model Context Protocol (MCP)的服务,用于查询B站用户的粉丝数量。通过提供B站用户ID,可以获取该用户的粉丝数。

功能特点

  • 通过用户ID直接查询B站用户粉丝数
  • 支持MCP协议,可与Claude、GPT等大模型集成
  • 支持错误处理和详细日志记录

安装方法

前置要求

  • Node.js v16.0.0 或更高版本
  • npm 或 yarn 包管理器

安装步骤

  1. 克隆或下载本仓库
  2. 进入项目目录并安装依赖
cd bilibili-mcp-server
npm install

使用方法

启动服务器

npm start

启动成功后,终端会显示:

Starting Bilibili follower count MCP server...
MCP server connected and running!
Use Inspector to access the getBilibiliFollowerCount tool

使用MCP Inspector测试

  1. 安装MCP Inspector (如果尚未安装)
  2. 将Inspector连接到本地MCP服务器
  3. 选择getBilibiliFollowerCount工具
  4. 输入参数:
    • userId: B站用户的数字ID (如:184594996163637592等)
  5. 点击"Run"执行查询

输出格式

成功响应:

{
  "result": {
    "username": "用户名",
    "followerCount": 12345
  }
}

错误响应:

{
  "error": "错误信息"
}

API参考

getBilibiliFollowerCount

获取B站用户的粉丝数量。

参数:

  • userId (必填): B站用户ID,纯数字,通常为7-10位,如"163637592"

返回值:

  • username: 用户名
  • followerCount: 粉丝数量

如何获取B站用户ID

B站用户ID可以通过以下方式获取:

  1. 访问用户空间页面,查看URL

  2. 在B站搜索用户名,点击进入用户空间,查看URL中的数字ID

常见问题

Q: 为什么需要使用用户ID而不是用户名?

A: B站API直接支持通过用户ID查询,这种方式更加可靠和高效。用户名可能重复或变更,而ID是唯一的。

Q: 如何处理API请求失败?

A: 服务会自动重试并记录详细错误日志,您可以在logs目录中查看错误详情。

测试工具

项目包含一个测试脚本,用于直接测试B站API:

node test-api.js

这将测试几个预设的用户ID,并显示详细的响应结果。

许可证

MIT

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Amap Maps高德地图官方 MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
ChatWiseThe second fastest AI chatbot™
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
CursorThe AI Code Editor
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.