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-info-mcp

v1.0.0

Published

MCP server to fetch Bilibili video information via stdio transport

Readme

bilibili-info-mcp

npm version GitHub

MCP server for fetching Bilibili video metadata and subtitles. Runs locally via stdio transport.

Features

  • Fetch video metadata: title, author, view count, description, duration, publish date
  • Fetch subtitles (requires login cookie): prioritizes Chinese, falls back to English
  • WBI signature support for reliable subtitle retrieval
  • Stdio transport for local MCP client integration

Usage

No installation required. Use directly with npx:

npx bilibili-info-mcp

MCP Client Configuration

Cursor / Claude Desktop

{
  "mcpServers": {
    "bilibili-info": {
      "command": "npx",
      "args": ["bilibili-info-mcp"],
      "env": {
        "SESSDATA": "your_bilibili_sessdata_cookie"
      }
    }
  }
}

Environment Variables

| Variable | Required | Description | |---|---|---| | SESSDATA | Only for subtitles | Bilibili login cookie. Find it in browser DevTools > Application > Cookies > bilibili.com after logging in. |

Tool: get-bilibili-video-info

Fetches Bilibili video metadata and optionally subtitles.

Input

| Parameter | Type | Required | Default | Description | |---|---|---|---|---| | url | string | Yes | - | Bilibili video URL, e.g. https://www.bilibili.com/video/BVxxxxx | | includeSubtitles | boolean | No | false | Whether to fetch subtitles. Requires SESSDATA env var. |

Supported URL formats:

  • https://www.bilibili.com/video/BVxxxxx
  • https://m.bilibili.com/video/BVxxxxx?k=v
  • https://bilibili.com/video/BVxxxxx/

Output

{
  "title": "Video title",
  "author": "Author name",
  "viewCount": "12345",
  "description": "Video description",
  "lengthSeconds": "360",
  "publishDate": "2025-01-15T12:00:00+08:00",
  "subtitle": {
    "languageCode": "zh-Hans",
    "content": "Subtitle text content joined by spaces"
  }
}

| Field | Type | Description | |---|---|---| | title | string | Video title | | author | string | Uploader name | | viewCount | string | Total view count | | description | string | Video description (prefers desc_v2, falls back to desc) | | lengthSeconds | string | Video duration in seconds | | publishDate | string | Publish time in ISO 8601 format with +08:00 timezone | | subtitle | object (optional) | Subtitle track, only present when includeSubtitles is true and subtitles are available |

Subtitle Priority

When includeSubtitles is true, returns a single subtitle track with the following priority:

  1. Chinese (matching 中文, zh-CN, zh-Hans, zh)
  2. English (matching English, 英语, en, en-US)

Development

git clone https://github.com/sunwu51/bilibili-info-mcp.git
cd bilibili-info-mcp
npm install
npm run build

Project Structure

src/
  index.ts              # MCP server entry point (stdio transport)
  bilibili-fetcher.ts   # Bilibili API calls (video info + subtitles)
  wbi.ts                # WBI signature algorithm implementation

How It Works

  1. Video info -- Calls https://api.bilibili.com/x/web-interface/view?bvid=BVID to get metadata.
  2. WBI keys -- Fetches img_key and sub_key from https://api.bilibili.com/x/web-interface/nav (cached for 1 hour).
  3. Subtitles -- Calls https://api.bilibili.com/x/player/wbi/v2 with WBI signature (w_rid + wts) and SESSDATA cookie to get subtitle URLs, then fetches the subtitle JSON content.

License

ISC