Skip to main content
Glama
nameefef
by nameefef

bilibili-mcp

一个合规优先的 Bilibili MCP Server,通过哔哩哔哩官方开放平台访问已授权账号的数据。

本项目不调用逆向整理的非公开接口,不绕过登录、签名或风控,也不提供任意用户/视频的批量抓取能力。

能力

MCP 工具

作用

官方 Scope

bilibili_parse_url

本地解析 BV/av/ep/ss、空间、直播间和短链

bilibili_get_authorized_user

获取已授权用户昵称、头像和 OpenID

USER_INFO

bilibili_get_video

获取已授权用户拥有或联合投稿的单个稿件

ARC_BASE

bilibili_list_videos

分页查询已授权用户的稿件列表

ARC_BASE

bilibili_get_user_stats

获取关注、粉丝和审核通过稿件数

USER_DATA

bilibili_get_video_stats

获取播放、点赞、投币、收藏、评论等数据

ARC_DATA

所有工具均为只读工具;网络请求使用官方签名 2.0(HMAC-SHA256)。

Related MCP server: BiliStalkerMCP

前置条件

  1. 哔哩哔哩开放平台完成开发者入驻并创建应用。

  2. 为应用申请所需 Scope。

  3. 官方 OAuth 2.0 文档取得已授权用户的 access_token

  4. Node.js 20 或更高版本。

官方开放平台可能要求企业资质,实际准入规则以官方页面为准。

安装与构建

git clone https://github.com/nameefef/bilibili-mcp.git
cd bilibili-mcp
pnpm install
pnpm run build

准备环境变量:

export BILIBILI_CLIENT_ID="your_client_id"
export BILIBILI_APP_SECRET="your_app_secret"
export BILIBILI_ACCESS_TOKEN="authorized_user_access_token"

没有凭证时服务仍可启动,但只能使用本地的 bilibili_parse_url 工具。

MCP 客户端配置

把绝对路径替换为你本机的仓库位置:

{
  "mcpServers": {
    "bilibili": {
      "command": "node",
      "args": ["/absolute/path/to/bilibili-mcp/dist/index.js"],
      "env": {
        "BILIBILI_CLIENT_ID": "your_client_id",
        "BILIBILI_APP_SECRET": "your_app_secret",
        "BILIBILI_ACCESS_TOKEN": "authorized_user_access_token"
      }
    }
  }
}

不要把真实密钥写入会提交到 Git 的配置文件;更推荐由系统密钥管理器或进程环境注入。

开发

pnpm run dev
pnpm run check

使用 MCP Inspector:

pnpm dlx @modelcontextprotocol/inspector node dist/index.js

限制与安全

  • 仅使用官方开放平台文档公开的接口。

  • 只能读取明确授权给当前应用的账号及稿件数据。

  • 访问令牌和应用密钥只从环境变量读取,不会出现在 MCP 工具参数或返回值中。

  • API 返回的头像、封面等资源应按官方规则缓存和使用。

  • 遇到 127007127011 等错误时,请检查应用 Scope 和用户授权状态。

  • 平台接口、准入条件和配额可能变化,请以官方文档为准。

共创者

  • nameefef——项目发起人与维护者

  • OpenAI Codex——架构、实现、测试与文档协作

Codex 是 AI 编程助手,不拥有可计入 GitHub Contributors 图表的个人账号;共同创作关系在项目文档和提交说明中明确记录。

许可证

MIT。Bilibili、哔哩哔哩及相关标识属于其权利人,本项目与哔哩哔哩官方无隶属或背书关系。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    F
    maintenance
    An MCP server that enables users to search Bilibili videos, access trending rankings, and retrieve detailed information about videos, content creators, and anime schedules. It allows AI applications to interact directly with Bilibili content via simple API interfaces.
    76
    188
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    BiliStalkerMCP is a Bilibili MCP server designed to analyze a specific Bilibili user by providing tools to retrieve user profiles, videos, dynamics, articles, and followings.
    8
    MIT

View all related MCP servers

Related MCP Connectors

  • MCP server for ByteDance Seedance AI video generation

  • MCP server for ByteDance Seedream AI image generation

  • MCP server for Hailuo (MiniMax) AI video generation

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/nameefef/bilibili-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server