Bilibili Comments MCP
Provides tools for retrieving video comments and dynamic (post) comments from Bilibili, with support for pagination, sorting, nested replies, and multiple output formats (Markdown/JSON).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Bilibili Comments MCPget the top 10 comments for video BV1xx411c7mD"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Bilibili-Comments-MCP
一个基于 Model Context Protocol (MCP) 的 B 站视频评论获取工具.
快速开始
配置客户端(如Claude Desktop客户端)
在 MCP 客户端的配置文件中添加:
{
"mcpServers": {
"bilibili-comments": {
"command": "npx",
"args": ["-y", "bilibili-comments-mcp"],
"env": {
"BILIBILI_SESSDATA": "your_bilibili_sessdata_here"
}
}
}
}Related MCP server: Bilibili MCP Server
环境变量
配置方式
BILIBILI_SESSDATA:Bilibili Cookie 中的 SESSDATA 值。获取方式:登录 Bilibili 网站,打开浏览器开发者工具 (F12),在 Network (网络) 选项卡中刷新页面,找到任意一个
bilibili.com的请求,在 Request Headers 中找到 Cookie,提取SESSDATA=xxx部分的值。
工具功能
get_video_comments
获取 B 站视频评论,支持分页、排序和楼中楼回复。
参数:
bvid/aid- 视频ID(二选一)page- 页码,默认1pageSize- 每页数量(1-20),默认20sort- 排序:0按时间,1按热度includeReplies- 是否包含楼中楼回复,默认trueoutputFormat- 输出格式:markdown 或 json,默认markdowncookie- B站Cookie(可选)
示例(Markdown格式):
{
"bvid": "BV1xx411c7mD",
"page": 1,
"pageSize": 20,
"sort": 1,
"includeReplies": true,
"outputFormat": "markdown"
}示例(JSON格式):
{
"bvid": "BV1xx411c7mD",
"page": 1,
"pageSize": 20,
"sort": 0,
"includeReplies": false,
"outputFormat": "json"
}get_dynamic_comments
获取 B 站动态评论,支持分页和楼中楼回复。
参数:
dynamic_id- 动态ID(必需)page- 页码,默认1pageSize- 每页数量(1-20),默认20includeReplies- 是否包含楼中楼回复,默认trueoutputFormat- 输出格式:markdown 或 json,默认markdowncookie- B站Cookie(可选)
示例:
{
"dynamic_id": "123456789",
"page": 1,
"pageSize": 10,
"includeReplies": true,
"outputFormat": "markdown"
}Cookie 获取
登录 B 站网页版
打开开发者工具 (F12)
切换到 Network 标签
刷新页面,找到任意请求
复制 Request Headers 中的 Cookie 值
动态ID获取方法
在B站手机App中打开想要获取评论的动态
点击分享按钮
选择"复制链接"
链接格式通常为:
https://t.bilibili.com/动态ID提取链接中的数字部分作为dynamic_id参数
常见问题解决
动态评论获取失败
错误代码-404: 动态不存在或已被删除,请检查dynamic_id是否正确
错误代码-101: Cookie已过期,请重新获取并更新SESSDATA
错误代码-403: 访问权限不足,某些动态可能需要登录才能查看评论
Available Tools
2 toolsget_dynamic_commentsARead-only
获取 B 站动态的评论内容,支持分页和楼中楼回复。注意:需要有效的 B 站 Cookie 才能正常工作。
| Name | Required | Description | Default |
|---|---|---|---|
| dynamic_id | Yes | B 站动态 ID | |
| page | No | 页码,默认为 1 | |
| pageSize | No | 每页数量,范围 1-20,默认 20 | |
| includeReplies | No | 是否包含楼中楼回复 | |
| outputFormat | No | 输出格式: markdown 或 json | markdown |
| cookie | No | B 站 Cookie(可选)。如果已设置环境变量,则无需提供。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true, indicating this is a safe read operation. The description adds valuable behavioral context beyond annotations: it discloses the authentication requirement (Bilibili Cookie needed for functionality) and mentions pagination and threaded reply capabilities. While it doesn't describe rate limits or detailed error behavior, it provides meaningful operational context that complements the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and well-structured in just two sentences. The first sentence states the core functionality, while the second provides critical operational context (authentication requirement). Every word earns its place with zero redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with complete schema documentation and annotations, the description provides adequate context. It covers the core purpose, key capabilities (pagination, threaded replies), and critical operational requirement (Cookie authentication). While no output schema exists, the description doesn't need to explain return values. The main gap is lack of explicit differentiation from the sibling video comments tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the input schema already documents all 6 parameters thoroughly. The description doesn't add significant parameter semantics beyond what's in the schema - it mentions pagination and threaded replies which correspond to 'page', 'pageSize', and 'includeReplies' parameters already well-described in the schema. The baseline of 3 is appropriate when schema coverage is complete.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '获取 B 站动态的评论内容' (get Bilibili dynamic comments). It specifies the resource (Bilibili dynamic comments) and key capabilities (pagination and threaded replies). However, it doesn't explicitly differentiate from its sibling 'get_video_comments' - both retrieve comments but for different content types (dynamic vs video).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides some usage context with the authentication requirement note ('需要有效的 B 站 Cookie 才能正常工作'), but doesn't explicitly state when to use this tool versus its sibling 'get_video_comments' or other alternatives. It implies usage for Bilibili dynamic comments specifically, but lacks clear comparative guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_video_commentsARead-only
获取 B 站视频的评论内容,支持分页、排序和楼中楼回复。注意:需要有效的 B 站 Cookie 才能正常工作。
| Name | Required | Description | Default |
|---|---|---|---|
| bvid | No | B 站视频 BV 号(与 aid 二选一,必须提供其中之一) | |
| aid | No | B 站视频 AV 号(与 bvid 二选一,必须提供其中之一) | |
| page | No | 页码,默认为 1 | |
| pageSize | No | 每页数量,范围 1-20,默认 20 | |
| sort | No | 排序方式: 0 按时间,1 按热度 | |
| includeReplies | No | 是否包含楼中楼回复 | |
| outputFormat | No | 输出格式: markdown 或 json | markdown |
| cookie | No | B 站 Cookie(可选)。如果已设置环境变量,则无需提供。 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds valuable behavioral context beyond annotations. While annotations indicate read-only and closed-world operations, the description specifies authentication requirements ('需要有效的 B 站 Cookie 才能正常工作'), which is crucial for the agent to understand prerequisites. It also mentions support for pagination, sorting, and nested replies, providing operational context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise (two sentences) and front-loaded with the core purpose. Every sentence earns its place: the first states what the tool does and key features, the second provides critical authentication information. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with comprehensive parameter documentation (100% schema coverage) and clear annotations, the description provides good contextual completeness. It covers authentication requirements and key behavioral features. The main gap is the lack of output schema, but the description mentions output format options, partially compensating.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage, the input schema already documents all 8 parameters thoroughly. The description does not add any additional parameter semantics beyond what's in the schema. The baseline score of 3 is appropriate since the schema carries the full burden of parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: '获取 B 站视频的评论内容' (get Bilibili video comments). It specifies the resource (Bilibili video comments) and distinguishes from its sibling tool 'get_dynamic_comments' by focusing on video comments rather than dynamic comments.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context for when to use this tool: for retrieving Bilibili video comments with pagination, sorting, and nested replies. It mentions the requirement for valid Bilibili cookies. However, it does not explicitly state when NOT to use it or compare it to the sibling tool 'get_dynamic_comments'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
2 tool updates
v1.0.0- First observed
get_dynamic_comments - First observed
get_video_comments
TDQS
The two tools have clearly distinct purposes: one targets dynamic comments and the other targets video comments, with no overlap in functionality. The descriptions reinforce this by specifying different contexts (dynamic vs. video) while sharing similar features like pagination and nested replies.
Both tools follow a consistent verb_noun pattern (get_dynamic_comments and get_video_comments), using the same verb 'get' and similar noun structures. This makes the naming predictable and easy to understand across the tool set.
With only 2 tools, the server feels thin for a comments-focused domain, lacking operations like creating, updating, deleting, or searching comments. This minimal set may limit agent workflows, as it only supports retrieval without full CRUD coverage.
The tool set is severely incomplete for a comments domain, missing essential operations such as posting comments, replying to comments, or deleting comments. While retrieval is covered for dynamics and videos, there are significant gaps that will hinder agents from performing common comment-related tasks.
Maintenance
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
Track Bilibili creators and get the latest updates on videos, dynamics, and articles. Fetch user p…
Bilibili public video, article, dynamic, creator, comments, reactions, and transcript tools.
搜索笔记、浏览首页推荐、查看笔记内容与评论,并发表你的评论。直接在工作流中与小红书内容互动,高效跟进话题。
WeChat Channels videos, comments, users, transcripts, and Official Account article details.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables fetching and analyzing YouTube video comments and replies through the YouTube Data API. Supports sorting by relevance or time and returns structured JSON data for comment analysis, summarization, and translation tasks.1-
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Bilibili (B站) platform through API and web scraping. Supports video search, article search, video info retrieval, comment fetching, danmaku extraction, and article content access.4-
- FlicenseNot gradedqualityCmaintenanceEnables interaction with Bilibili (哔哩哔哩) through its API, supporting video search and recommendations, user search, dynamic feeds, video collections, and danmaku retrieval through natural language.5-
- AlicenseAqualityDmaintenanceEnables the retrieval of subtitles, danmaku (bullet comments), and video comments from Bilibili using standard or short video URLs. It supports multiple transport methods and requires Bilibili authentication via SESSDATA.32MIT
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/222wcnm/Bilibili-Comments-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server