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、哔哩哔哩及相关标识属于其权利人,本项目与哔哩哔哩官方无隶属或背书关系。

Available Tools

6 tools
bilibili_get_authorized_userGet authorized Bilibili userA
Read-onlyIdempotent

Get the nickname, avatar URL, and app-scoped OpenID of the user who authorized the configured official Bilibili Open Platform access token. Requires USER_INFO scope.

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare the operation as readOnly, openWorld, and idempotent. The description adds valuable context beyond annotations by specifying the required USER_INFO scope and the exact fields returned. This exceeds the baseline for annotation-covered safety but lacks details on error behavior or rate limits, so not a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence that front-loads the key output fields. Every word carries meaning and there is no redundancy or fluff.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with one optional parameter and no output schema, the description covers purpose, scope requirement, and returns. It could mention behavior on missing/invalid tokens or explicitly reference the response_format option, but these are minor gaps, so it's one step above the minimum viable.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The single optional parameter, response_format, has a description in the schema that fully covers its meaning (markdown for people, json for programs). Since schema coverage is 100%, the tool description adds nothing beyond the schema, consistent with the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states a specific verb ('Get') and resource ('authorized Bilibili user'), listing the exact data returned (nickname, avatar URL, app-scoped OpenID). This distinguishes it from sibling tools like get_user_stats, which focus on statistics rather than identity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context by specifying the tool retrieves the user who authorized the configured access token and requires USER_INFO scope, implying when to use it. However, it does not explicitly name alternatives or state when not to use it, so it falls short of a 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bilibili_get_user_statsGet authorized Bilibili user statisticsA
Read-onlyIdempotent

Get following, follower, and approved-video counts for the authorized user through the official Open Platform. Requires USER_DATA scope.

ParametersJSON Schema
NameRequiredDescriptionDefault
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, covering the safety profile. The description adds the USER_DATA scope requirement and clarifies that it reads the authorized user's stats, which are valuable behavioral details beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with the first sentence front-loading the verb and output metrics, and the second adding essential auth context. No filler or redundant content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only tool with no output schema, the description lists the returned metrics and auth requirement, which is largely sufficient. It doesn't explicitly mention response_format behavior, but the schema covers that, and annotations handle safety and idempotency.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% for the single response_format parameter, so baseline 3 applies. The tool description doesn't add parameter-specific detail, but the schema already clearly explains the allowed values and defaults.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description uses a specific verb 'Get' and names the exact metrics: following, follower, and approved-video counts. It clearly distinguishes from sibling tools like bilibili_get_video_stats by specifying 'authorized user' and the official Open Platform.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

States the tool operates on the authorized user and requires USER_DATA scope, providing a clear prerequisite and context. It doesn't explicitly name alternatives, but the 'authorized user' qualifier implies when this tool is appropriate versus other Bilibili tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bilibili_get_videoGet an authorized user's Bilibili videoA
Read-onlyIdempotent

Get one video submission owned or co-authored by the authorized user through the official Open Platform. Requires ARC_BASE scope; it cannot read arbitrary videos.

ParametersJSON Schema
NameRequiredDescriptionDefault
resource_idYesBilibili BV id, for example BV1MW421X7gM
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare read-only, idempotent, non-destructive behavior. The description adds valuable context about authorization scope (ARC_BASE) and the constraint that only videos owned or co-authored by the authorized user can be accessed. This goes beyond the annotations without contradicting them.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences, front-loaded with the primary purpose and immediately followed by constraints. Every word adds value, with no redundant information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has no output schema, and the description does not explicitly describe the return value structure beyond the response_format parameter. However, given the simplicity of fetching a single video by ID and rich annotations, the description covers the essential context for correct usage. A minor gap exists in not describing the exact fields returned, but it remains complete enough for a straightforward read operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both resource_id and response_format fully described in the schema. The description does not add extra parameter semantics, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Get one video submission owned or co-authored by the authorized user', which specifies a distinct verb (get), resource (video submission), and ownership scope. It differentiates from sibling tools like bilibili_list_videos (list) and bilibili_get_video_stats (stats) by focusing on a single owned video.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when not to use the tool ('cannot read arbitrary videos') and mentions a scope requirement (ARC_BASE), which guides appropriate usage. It does not explicitly name alternative tools, but the exclusion of arbitrary videos is clear guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bilibili_get_video_statsGet statistics for an authorized user's Bilibili videoA
Read-onlyIdempotent

Get views, likes, coins, favorites, replies, danmaku, and shares for a video owned or co-authored by the authorized user. Requires ARC_DATA scope.

ParametersJSON Schema
NameRequiredDescriptionDefault
resource_idYesBilibili BV id, for example BV1MW421X7gM
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and destructiveHint, so the safety profile is covered. The description adds valuable context beyond annotations: it explicitly requires ARC_DATA scope, which is an authorization prerequisite, and it clarifies the resource scope (owned/co-authored videos). This goes beyond what annotations provide, though it does not describe error behaviors or response format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the action and key metrics. It avoids redundancy with the annotations and schema, containing only the essential additional context (auth scope and ownership constraint).

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a read-only statistics tool with robust schema (100% parameter coverage) and annotations declaring safety and idempotency, the description completes the picture by listing the returned metrics, the ownership requirement, and the auth scope. The absence of an output schema is mitigated by the description's explicit enumeration of what the stats include.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters (resource_id and response_format) fully described in the schema, including pattern, enum, and defaults. The tool description adds only contextual scope (owned/co-authored) and the auth requirement, not parameter-specific semantics. Baseline 3 is appropriate since the schema carries the parameter documentation burden.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb ('Get') and resource ('statistics for a video'), enumerates the exact metrics (views, likes, coins, favorites, replies, danmaku, shares), and distinguishes it from sibling tools like bilibili_get_video and bilibili_get_user_stats by specifying it's for videos owned or co-authored by the authorized user.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context: it is for retrieving statistics for the authorized user's own or co-authored videos, and it mentions the required ARC_DATA scope. It does not explicitly name alternative tools or state when not to use it, but the scope restriction and the sibling tool list imply appropriate usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bilibili_list_videosList the authorized user's Bilibili videosA
Read-onlyIdempotent

List paginated video submissions belonging to the authorized user through the official Open Platform. Requires ARC_BASE scope. Page size is limited to 1-50.

ParametersJSON Schema
NameRequiredDescriptionDefault
pageNo1-based page number
statusNoall
page_sizeNoItems per page
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnly, openWorld, and idempotent safety. The description adds valuable context beyond annotations: the required ARC_BASE scope, the official Open Platform context, and the page size limit of 1-50. This gives the agent useful behavioral expectations, though it doesn't cover response format or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise, consisting of two sentences that front-load the primary purpose and then add key constraints (scope, page size). Every word earns its place, with no redundant filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a paginated list tool, the description is fairly complete: it states the resource, scope, pagination limit, and platform. It doesn't explain return structure, but the response_format parameter covers that, and no output schema exists. Minor gaps like sorting or rate limits are not critical for typical usage, so a 4 is appropriate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is high (75%), with descriptions for page, page_size, and response_format. The description only reinforces the page size limit but does not explain parameters like status or response_format. Since schema does most of the work, a baseline of 3 is appropriate; description adds minimal extra semantic value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool lists paginated video submissions for the authorized user, using a specific verb 'List' and a distinct resource (videos). This distinguishes it from sibling tools like get_video or get_video_stats, which focus on single items or statistics.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for listing a user's videos but does not explicitly mention when to use this over alternatives or provide exclusions. It gives context (authorized user, pagination, scope) but lacks direct comparison with sibling tools, so usage guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

bilibili_parse_urlParse Bilibili URL or identifierA
Read-onlyIdempotent

Parse a public Bilibili BV/av/ep/ss identifier or HTTPS URL locally and return its resource type, id, and canonical URL. Does not contact Bilibili or resolve b23.tv redirects.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputYesBilibili identifier or HTTPS URL
response_formatNoResponse format: markdown for people or json for programsmarkdown

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the safety profile is covered. The description adds valuable behavioral context beyond annotations: the operation is local, does not contact Bilibili, and does not resolve b23.tv redirects. This meaningfully supplements the annotation data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action, and contains no fluff. Every clause adds information: the input type, the output, the local processing, and the non-resolving behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple parsing tool with no output schema, the description is complete in explaining inputs, outputs, and limitations. It could mention error handling for invalid identifiers, but the core use case and boundary conditions are clearly covered, making it adequate for an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, with both parameters (input and response_format) described in the schema. The tool description adds context about identifier types and output contents but does not provide additional per-parameter semantics beyond what the schema already states. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Parse' with the resource 'Bilibili BV/av/ep/ss identifier or HTTPS URL' and clearly states the outputs (resource type, id, canonical URL). It distinguishes itself from sibling tools by emphasizing local parsing without contacting Bilibili, which is unique among the listed tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool: for parsing identifiers or URLs locally, and explicitly mentions a non-goal ('does not contact Bilibili or resolve b23.tv redirects'). It does not name alternative sibling tools directly, but the context makes the boundary clear enough for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.3/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: URL parsing, authorized user info, single video retrieval, video listing, user stats, and video stats. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tool names follow the same bilibili_verb_noun pattern using snake_case. This makes the tool set predictable and easy to navigate.

Tool Count5/5

With 6 tools, the server is well-scoped for a Bilibili-focused MCP covering URL parsing and authorized user data retrieval. Each tool earns its place with no redundancy.

Completeness4/5

The toolset covers the core lifecycle of reading authorized user data and video stats. Minor gaps exist such as no batch video stats or search functionality, but these are not critical given the server's purpose.

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    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.
    69
    189
    MIT
  • A
    license
    Not graded
    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

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