npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

bilibili-api-mcp

v1.0.0

Published

Bilibili API MCP Server

Downloads

32

Readme

Bilibili API MCP Server / 哔哩哔哩 API MCP 服务器

A Model Context Protocol (MCP) server that provides access to Bilibili APIs for AI agents. 这是一个为 AI Agent 提供哔哩哔哩 API 访问能力的 Model Context Protocol (MCP) 服务器。

Features / 功能

This server provides the following tools to MCP-compatible clients: 本服务器为支持 MCP 的客户端提供以下工具:

  • User Info: Get user details, stats, relations. 用户信息: 获取用户详情、统计、关系。
  • Video: Get video info, tags, stream URLs (playurl), related videos. 视频: 获取视频信息、标签、播放地址、相关视频。
  • Bangumi/PGC: Get episode info, stream URLs, user's follow list. 番剧/影视: 获取剧集信息、播放地址、追番列表。
  • Danmaku: Retrieve real-time danmaku (protobuf encoded) and metadata. 弹幕: 获取实时弹幕(Protobuf 编码)及元数据。
  • Search: Search videos, users, and get hot search terms. 搜索: 搜索视频、用户,获取热搜词。
  • Ranking: Get video rankings and popular videos. 排行榜: 获取视频排行榜及热门视频。
  • Dynamics: Get user dynamics and new feeds. 动态: 获取用户动态及最新动态。
  • Comments: Get video/article comments. 评论: 获取视频/专栏评论。
  • Live: Get live room information. 直播: 获取直播间信息。

Installation / 安装

  1. Clone the repository / 克隆仓库

    git clone https://github.com/your-repo/bilibili-api-mcp.git
    cd bilibili-api-mcp
  2. Install dependencies / 安装依赖

    npm install
  3. Build the project / 构建项目

    npm run build

Configuration / 配置

You need to provide your Bilibili Authentication Cookies via environment variables. 您需要通过环境变量提供哔哩哔哩的身份验证 Cookie。

Environment Variables / 环境变量

  • BILIBILI_COOKIE: (Required) Your full Bilibili cookie string (e.g., SESSDATA=...; bili_jct=...;). (必填) 您的完整 Bilibili Cookie 字符串。
  • PORT: (Optional) Server port if running in HTTP mode (Standard MCP uses stdio). (可选) HTTP 模式下的端口(标准 MCP 使用 stdio)。

How to get cookies / 如何获取 Cookie:

  1. Log in to bilibili.com.
  2. Open Developer Tools (F12) -> Application -> Cookies.
  3. Copy the cookie string.
  4. 登录 bilibili.com
  5. 打开开发者工具 (F12) -> Application -> Cookies。
  6. 复制 Cookie 字符串。

Usage / 使用方法

Run the server using Node.js. This server implementation uses stdio transport, suitable for integration with Claude Desktop or other MCP clients. 使用 Node.js 运行服务器。本服务器实现使用 stdio 传输协议,适合集成到 Claude Desktop 或其他 MCP 客户端。

# Set cookie and run / 设置 Cookie 并运行
# Windows (PowerShell)
$env:BILIBILI_COOKIE='your_cookie_here'; node build/index.js

# Linux/macOS
export BILIBILI_COOKIE='your_cookie_here'
node build/index.js

Configure in Claude Desktop / 在 Claude Desktop 中配置

Add this to your claude_desktop_config.json: 将以下内容添加到您的 claude_desktop_config.json

{
  "mcpServers": {
    "bilibili": {
      "command": "node",
      "args": ["/path/to/bilibili-api-mcp/build/index.js"],
      "env": {
        "BILIBILI_COOKIE": "your_cookie_string_here"
      }
    }
  }
}

License

ISC