BiliNote
v0.16.10Generate AI study notes & transcripts from Bilibili, YouTube, Douyin, Kuaishou, or local videos.
MCP server for BiliNote Pro — generate AI study notes from videos using the BiliNote public API. Works with online URLs (Bilibili, YouTube, Douyin, Kuaishou) and local video files on your machine. Exposes ten MCP tools to any MCP-compatible agent (Claude Code, Codex, Cursor, etc.): Call list_styles with no arguments ({}) to discover note styles before generating a note. It reads GET /v1/styles using your configured API key and does not consume generation credits. Self-hosted backends must include the /v1/styles API update from issue #275.
Summary extracted from the README.
@bilinote/mcp-server
MCP server for BiliNote Pro — generate AI study notes from videos using the BiliNote public API. Works with online URLs (Bilibili, YouTube, Douyin, Kuaishou) and local video files on your machine.
What it does
Exposes ten MCP tools to any MCP-compatible agent (Claude Code, Codex, Cursor, etc.):
| Tool | Description |
|---|---|
generate_note |
Generate a note from an online URL (videoUrl) or a local video file (filePath); optionally file it into a collection via collectionId. Blocks until the note is ready, returns markdown. Takes minutes and costs credits. |
list_models |
List available AI models and their credit cost per generation. |
list_styles |
List note styles: built-in keys (builtin[].style, for style) and your own custom templates (custom[].styleId, for styleId). |
get_task |
Check (or resume) a generation task by taskId. |
get_note |
Fetch a completed note by noteId. |
list_notes |
List notes in the account library (paginated). |
get_account |
Remaining credits (balance), total earned/consumed, VIP status & plan, and this key's rate limit / spend cap. |
list_collections |
List the account's note collections (id, name, note count). |
get_collection |
A collection's contents — its info plus the notes inside it. |
create_collection |
Create a collection; returns its collectionId to pass to generate_note. |
New in 0.16.7: list_styles
Call list_styles with no arguments ({}) to discover note styles before generating a note.
It reads GET /v1/styles using your configured API key and does not consume generation credits.
Self-hosted backends must include the /v1/styles API update from issue #275.
Example response (styles and IDs depend on your account):
{
"builtin": [
{ "style": "detailed", "name": "详细笔记", "description": "详细整理视频内容", "vipOnly": false, "available": true, "isDefault": true }
],
"custom": [
{ "styleId": 42, "name": "我的学习模板", "description": "按知识点整理" }
]
}
- Pass
builtin[].styleasgenerate_note.style; checkavailableandvipOnlybefore selecting it. - Pass
custom[].styleIdasgenerate_note.styleId. If both are provided,styleIdtakes precedence. - Only your own custom templates are listed. Copy a public template to your account in the web app first. Template prompts are not returned.
After choosing a template and a model from list_models, call generate_note with:
{ "videoUrl": "https://www.bilibili.com/video/YOUR_VIDEO", "model": "MODEL_FROM_LIST_MODELS", "styleId": 42 }
Unlike listing styles, generate_note consumes credits.
Upgrade a global installation with npm install -g @bilinote/mcp-server@0.16.7.
For MCP clients using npx, use npx -y @bilinote/mcp-server@0.16.7 and restart the MCP connection to refresh the tool list.
Prerequisites
- A BiliNote Pro account with credits.
- An API key — create one in Settings → API / 开发者 in the BiliNote web app.
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
BILINOTE_API_KEY |
Yes | — | Your bn_live_… API key |
BILINOTE_API_BASE |
No | https://www.bilinote.com.cn/api |
Base URL of the BiliNote API |
Note: The default
BILINOTE_API_BASEtargets the hosted BiliNote Pro API. For local development against your own backend, setBILINOTE_API_BASE=http://localhost:8080/api. For a self-hosted instance, set it to your domain +/api.
Agent configuration
Claude Code
One-liner install:
claude mcp add bilinote -e BILINOTE_API_KEY=bn_live_YOUR_KEY_HERE -- npx -y @bilinote/mcp-server
Or add to .mcp.json in your project root:
{
"mcpServers": {
"bilinote": {
"command": "npx",
"args": ["-y", "@bilinote/mcp-server"],
"env": {
"BILINOTE_API_KEY": "bn_live_YOUR_KEY_HERE"
}
}
}
}
Codex
Add to your Codex configuration under mcpServers:
{
"mcpServers": {
"bilinote": {
"command": "npx",
"args": ["-y", "@bilinote/mcp-server"],
"env": {
"BILINOTE_API_KEY": "bn_live_YOUR_KEY_HERE"
}
}
}
}
Cursor
In Cursor's MCP settings (.cursor/mcp.json or the Cursor settings UI), add:
{
"mcpServers": {
"bilinote": {
"command": "npx",
"args": ["-y", "@bilinote/mcp-server"],
"env": {
"BILINOTE_API_KEY": "bn_live_YOUR_KEY_HERE"
}
}
}
}
Usage notes
generate_notecosts credits from your BiliNote account — each generation deducts from your wallet according to the model's cost.- Generation typically takes 1–5 minutes depending on video length and model. The tool polls internally and returns the note markdown when complete.
- If generation exceeds
maxWaitSeconds(default 600 s / 10 min), the tool returns ataskIdstring. Useget_taskwith that ID to resume. - If generation fails,
generate_notereturns an error with the failure reason.
Output format (timestamps)
format controls optional parts of the note. Allowed values:
| Value | Effect |
|---|---|
link |
Timestamps with jump-to-video links (时间轴 / 原片跳转) |
toc |
Table of contents |
summary |
Summary section |
screenshot |
Inline screenshots (same as screenshot: true) |
When format is omitted the server defaults to ["link"], the same as the web app. Pass [] to turn timestamps off. style only accepts built-in style keys (e.g. minimal, detailed, academic); free-form instructions in style are ignored, so ask for timestamps via format.
// generate_note arguments
{ "videoUrl": "https://www.bilibili.com/video/BVxxxx", "model": "gpt-4o-mini", "format": ["link", "toc"] }
Local video files
Pass filePath (an absolute path to a video file on the machine running the MCP server) instead of videoUrl:
// generate_note arguments
{ "filePath": "/Users/me/clips/lecture.mp4", "model": "gpt-4o" }
The server uploads the file to BiliNote in 5 MB chunks with resumable upload, then runs generation as platform=LOCAL. If the upload is interrupted (network drop, process exit), the next call resumes from where it left off — it tracks progress in ~/.bilinote/uploads.json (keyed by path + size + mtime) and only re-sends the missing chunks. Provide either videoUrl or filePath, not both.
Local development
From the monorepo root, using Node.js 22 and npm:
<augment_code_snippet mode="EXCERPT">
cd Bilinote_MCP/mcp-server
npm ci --ignore-scripts --no-audit --no-fund
npm run build
node --test test/*.test.mjs
npm pack --dry-run --ignore-scripts
</augment_code_snippet>
The package can also be copied out and built on its own; no sibling project is required. TypeScript compiles src/ into dist/, and the bilinote-mcp executable remains dist/index.js. Publishing still uses the existing prepublishOnly build hook; the command above only checks the package contents and does not publish.
For local runtime testing, provide BILINOTE_API_KEY through a protected environment and run npm start. This project does not automatically load .env files. MCP clients should use an absolute path to the new Bilinote_MCP/mcp-server/dist/index.js; published npx -y @bilinote/mcp-server configurations are unchanged. Never commit real keys or pass them as command-line arguments.
完整生成配置
generate_note 与主项目的创建笔记选项保持一致,以下参数均可选;未传时沿用后端默认值。
| 参数 | 说明 |
|---|---|
title |
自定义标题,最多 255 字 |
style / styleId |
内置风格值(包括 lecture)/ 自己的自定义模板 ID;styleId 优先。两者都可通过 list_styles(GET /v1/styles)查看,也可在网页「模板风格库」复制模板 ID;公开模板需先复制到自己名下 |
extras |
自定义补充提示词 |
quality |
下载质量,默认 medium |
screenshot / videoInterval |
是否插入原片截图 / 截图间隔秒数(正整数,默认 10);format 含 screenshot 同样启用截图 |
videoUnderstanding |
视频画面理解,默认关闭;受后端会员、模型能力和积分规则限制 |
wantSpeakers |
区分发言人,默认关闭 |
format |
toc、link、screenshot、summary;省略默认 ["link"],[] 表示不要这些附加内容 |
link |
兼容任务接口的链接开关;时间轴请通过 format 中的 link 配置 |
collectionId |
生成后加入的合集 ID |
durationSeconds |
已知视频时长(非负秒数),用于积分预估;未知时省略 |
byokCredentialId |
账户中已有的 BYOK 凭据 ID,不是密钥明文;仍需填写模型名称 model |
sourceTaskId |
重新生成自己的历史任务,后端复用原始地址和平台;此时可以不传 videoUrl / filePath |
model 仍使用 list_models 返回的模型名称,对应主项目的 modelId。platform 支持
BILIBILI、YOUTUBE、DOUYIN、KUAISHOU、XIAOYUZHOU 和 LOCAL;省略时后端根据地址推断,
使用 filePath 时强制为 LOCAL。自定义模板与 BYOK 凭据需预先在主项目中配置。
{
"videoUrl": "https://www.bilibili.com/video/BVxxxx",
"model": "gpt-4o",
"title": "课程笔记",
"style": "detailed",
"extras": "重点解释术语,保留例题与推导过程",
"format": ["link", "toc", "summary", "screenshot"],
"videoInterval": 15,
"videoUnderstanding": true,
"wantSpeakers": true
}
这些扩展参数需要同时部署本次更新的后端和 MCP 服务;旧版后端可能忽略新增字段。