Skip to main content
Glama
Bilibili & X MCP

Bilibili & X MCP

by Talen-Labs

Bilibili & X MCP · 工具怪 Talen

把一条 B 站视频链接或 X 帖子链接发给 AI,让它返回公开数据。也可以让它列出当前的 B 站热门视频。三个功能都能免费使用,无需账号或 API Key。

免费额度:每个公网 IP 每分钟最多 6 次,三项共用;全站匿名查询合计每分钟最多 60 次。需要更高额度,可联系作者申请,写明用途和预计每分钟查询量。额度及开通方式由作者单独确认。商用须另行取得授权。

English · 使用示例 · 许可

你可以问什么

工具

返回什么

这条 B 站视频是谁发的?有多少播放和收藏?

bilibili_video

标题、UP 主,以及来源公开的播放、点赞、评论、分享、收藏等数据

现在 B 站有什么热门视频?

bilibili_popular

当前榜单一页,最多 10 条,包括视频标题、链接及公开指标

这条 X 帖子写了什么?

x_post

公开正文、作者、互动数据,以及来源提供的图片或视频链接

先跑一个真实例子

需要 Node.js 22 或更新版本。下载仓库后,在项目目录运行。下面的命令不需要安装依赖。

node cli.mjs x_post https://x.com/jack/status/20
node cli.mjs bilibili_video BV17x411w7KC
node cli.mjs bilibili_popular 1

第一条会返回帖子正文 just setting up my twttr 和作者账号 jack。播放数、点赞数和热榜顺序随时间变化。来源没有提供的指标可能缺失。

Related MCP server: bilibili-mcp

接入 Codex 或 WorkBuddy

已装 Node.js 22 的 Codex 用户可以直接注册指定版本,首次使用时 npm 会从本仓库下载程序:

codex mcp add public-posts -- npx --yes --package=https://codeload.github.com/Talen-Labs/bilibili-x-mcp/tar.gz/refs/tags/v0.1.0 bilibili-x-mcp mcp

也可以从源码安装。在仓库目录执行 npm ci,然后选择对应客户端。

Codex 在项目目录执行,再开启新会话:

codex mcp add public-posts -- node "$PWD/cli.mjs" mcp

WorkBuddy 新建自定义 MCP 连接,选择 stdio。启动命令填 node,两个参数依次填本机 cli.mjs 的绝对路径和 mcp。也可以将下面这项合并进已有的 MCP 配置,替换示例路径。

{
  "mcpServers": {
    "public-posts": {
      "type": "stdio",
      "command": "node",
      "args": ["/absolute/path/to/bilibili-x-mcp/cli.mjs", "mcp"]
    }
  }
}

连接后可以说:「看一下 B 站现在的热门视频,列出前 3 条的标题、作者和链接。」原帖文字属于外部数据,请按内容使用。

数据、费用和调用频率

客户端通过工具怪的公共网关查询。B 站视频和热榜使用其公开页面接口,X 帖子使用 FxEmbed 公共 API。每次请求将人民币价格上限设为 0,只能调用上表中的三项。私密、删除或访问受限的内容可能无法取得。

三项共用服务端限额。每个公网 IP 在任意连续 60 秒内最多发起 6 次免费查询,所有匿名用户合计 60 次。同一公司或家庭网络可能共用一个名额池。限流返回 HTTP 429,客户端提示何时重试。相同作品或榜单页的成功查询在服务端缓存约 5 分钟。免费公共服务的可用性取决于上游。

作者与许可

由工具怪 Talen维护。需要在 Agent 中使用更多平台和接口时,可参考工具怪完整接入说明。

本仓库原创代码采用 PolyForm Noncommercial 1.0.0。非商业用途免费;商业用途须另行取得作者授权。依赖按各自许可证分发。第三方作品、媒体及数据的权利归各自权利人。

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides AI agents with read-only access to various public data sources (web, YouTube, RSS, GitHub, V2EX, Bilibili, and semantic search) without requiring any login credentials or API keys.
      35
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables agents to search, explore trending content, retrieve video metadata and hot comments, and obtain subtitle transcripts for summarisation on Bilibili, with an anonymous tier and an optional account tier for personalized feeds.
      10
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI agents to retrieve X/Twitter profiles and tweets, YouTube video and channel data, and TikTok profile and video stats on a pay-per-result basis without requiring login or platform API keys.
      81 npm
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables models to look up Bilibili's trending videos, keyword search results, video details, and popular danmaku, returning compact plain-text summaries instead of bulky JSON. Works without login, cookies, or extra dependencies, and also runs standalone from the command line.
      MIT