bangumi-mcp
Click on "Deploy 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., "@bangumi-mcp search Bangumi for the anime Frieren and show its details"
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.
bangumi-mcp
中文说明
功能完整、面向 LLM 脱水优化的 Bangumi (bgm.tv) API v0 MCP Server + 轻量 CLI。
免 Token 开箱即用:搜索、条目详情、关联人物/角色/条目、章节列表、每日放送日历、用户公开收藏全量拉取、批量推荐去重核验、目录读取全部免鉴权直跑。
可选个人读写:配好
BANGUMI_ACCESS_TOKEN即可直接维护个人收藏、评分/标签/短评、单集与批量追番进度、角色/人物收藏、目录增删改;不配 Token 时优雅提示,不影响任何公开只读能力。为 LLM 上下文省 Token:自动脱水压缩冗余图片字典、评分直方图与过长简介,保留核心结构化字段与
https://bgm.tv/...直达链接。内置批量去重核验(
check_user_collections):传入一组番名或subject_id(支持整数或id:10380),先独立解析作品身份再对照用户收藏库标出「看过 / 在看 / 想看 / 搁置 / 抛弃 / 未收藏 / 核验失败」,避免第一季误判第二季或把纯数字番名(如86)误当 ID。安全边界清晰:MCP 侧全量同步严格只读(不写本机文件,导出请用
bangumi-cli sync -o);非幂等写请求不自动重放;streamable-http模式默认禁用个人 Token(仅允许本机 loopback 显式加--allow-token-over-http开启)。
快速接入(一行 uvx / 本地配置)
公开只读无需
env;需要个人读写时按需加上BANGUMI_ACCESS_TOKEN(申请地址:https://next.bgm.tv/demo/access-token)。
Claude Code
# 免安装直接运行(推荐)
claude mcp add bangumi -- uvx --from git+https://github.com/whycantiusemyname/bangumi-mcp bangumi-mcp
# 带默认用户名与个人 Token(可选)
claude mcp add bangumi \
-e BANGUMI_DEFAULT_USERNAME=your_username \
-e BANGUMI_ACCESS_TOKEN=your_token \
-- uvx --from git+https://github.com/whycantiusemyname/bangumi-mcp bangumi-mcpCodex CLI (~/.codex/config.toml)
[mcp_servers.bangumi]
command = "uvx"
args = ["--from", "git+https://github.com/whycantiusemyname/bangumi-mcp", "bangumi-mcp"]
[mcp_servers.bangumi.env]
BANGUMI_DEFAULT_USERNAME = "your_username"
# BANGUMI_ACCESS_TOKEN = "your_token" # 可选,写操作时填写Antigravity / Cursor / Claude Desktop(通用 MCP JSON)
{
"mcpServers": {
"bangumi": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/whycantiusemyname/bangumi-mcp",
"bangumi-mcp"
],
"env": {
"BANGUMI_DEFAULT_USERNAME": "your_username"
}
}
}
}本地开发目录接入
{
"mcpServers": {
"bangumi": {
"command": "uv",
"args": ["run", "--directory", "/path/to/bangumi-mcp", "bangumi-mcp"],
"env": {
"BANGUMI_DEFAULT_USERNAME": "your_username"
}
}
}
}Streamable HTTP 模式
# 默认以公开只读模式运行(不暴露环境中的 BANGUMI_ACCESS_TOKEN)
uvx --from git+https://github.com/whycantiusemyname/bangumi-mcp \
bangumi-mcp --transport streamable-http --host 127.0.0.1 --port 8765 --path /mcp
# 若确需在本机 loopback HTTP 上启用个人 Token 读写,显式传入 --allow-token-over-http(禁止非本机地址)
bangumi-mcp --transport streamable-http --host 127.0.0.1 --port 8765 --allow-token-over-http环境变量
变量名 | 必填 | 默认值 | 说明 |
| 否 | 无 | Bangumi Personal Access Token,仅个人读写接口需要(非本机 |
| 否 | 无 | 默认 Bangumi 用户名,调用用户相关 MCP 工具及 |
| 否 |
| 符合 Bangumi API 规范的自定义 |
| 否 |
| API 基础地址 |
| 否 |
| HTTP 请求超时(秒) |
| 否 |
| 仅针对只读请求的 429 / 5xx 最大重试次数(指数退避 + |
| 否 |
|
|
| 否 |
| 用户完整收藏库内存缓存有效期(秒),带并发合并与写后自动失效 |
MCP 工具清单(共 33 个)
公开只读(20 个,免 Token)
分类 | 工具名 | 说明 |
条目检索与浏览 |
| 高级搜索(类型/标签/meta_tags/发售日/评分/排名/排序)与分类浏览 |
条目详情与关联 |
| 条目完整脱水信息、制作人员、登场角色与 CV、关联续作/原作 |
章节与放送日历 |
| 章节分页查询、单集详情、每日放送表(支持 |
角色与现实人物 |
| 角色/声优/导演/制作公司检索、详情与关联条目 |
用户收藏与去重 |
| 用户资料、单页/单条目收藏、全 5 类分页同步与完整性统计、批量去重核验、收藏角色与人物 |
目录读取 |
| 读取公开目录详情及其收录条目 |
个人鉴权读写(13 个,需 BANGUMI_ACCESS_TOKEN)
分类 | 工具名 | 说明 |
当前用户 |
| 获取当前 Token 对应的登录用户信息 |
收藏管理 |
| 新增/修改条目收藏状态、评分(0-10)、标签、短评、私密标记与书籍进度 |
追番进度 |
| 读取/单集更新/批量更新章节观看状态(未收藏/想看/看过/抛弃) |
角色与人物收藏 |
| 收藏角色/现实人物(注:上游 |
目录维护 |
| 创建/编辑目录、增删改目录条目(修改条目需同时传 |
轻量 CLI (bangumi-cli)
# 全量拉取用户 5 大类收藏并导出 JSON(含统计 + 收藏角色/人物)
bangumi-cli sync <username> --favorites -o collections.json
# 仅拉取动画收藏
bangumi-cli sync <username> --types anime -o anime.json
# 批量推荐去重核验(支持番名与 subject_id 混传,也可配 BANGUMI_DEFAULT_USERNAME 省略 -u 或用 --file)
bangumi-cli check -u <username> "葬送的芙莉莲" "孤独摇滚" id:10380 --types anime
# 快速查新番表 / 搜番 / 查条目
bangumi-cli calendar --weekday today
bangumi-cli search "命运石之门" --types anime --sort rank --limit 5
bangumi-cli subject 10380Related MCP server: Bilibili API MCP Server
English
A full-featured, LLM-friendly Bangumi (bgm.tv) API v0 MCP Server + lightweight CLI.
Highlights
Zero-auth public read-only tools (20 tools): Subject search (
POST /v0/search/subjects) & browse, subject details/staff/characters/relations, episodes, weekly broadcast calendar (/calendar), characters & persons search/details, public user profiles/collections/favorites, full 5-category collection sync with completeness tracking, batch recommendation deduplication, and public index reading.Optional personal read/write tools (13 tools): Set
BANGUMI_ACCESS_TOKENto manage your own collections, ratings/tags/comments, single & batch episode watch progress, character/person collecting, and curated indices. Missing token yields a clearAUTH_REQUIREDMCP tool error without affecting read-only tools.Safe by default: MCP
sync_user_collectionsnever writes local files (usebangumi-cli sync -o); mutating requests never auto-retry on ambiguous failures;streamable-httpdisablesBANGUMI_ACCESS_TOKENby default unless explicitly opted in on a loopback address (--allow-token-over-http).Built-in Recommendation Deduplicator (
check_user_collections): Separates subject identity resolution from collection lookup, surfaces cross-media ambiguity, guards against cross-season false positives and numeric titles like"86", and reportsunknownif fallback search fails.
Quick Setup
# Claude Code
claude mcp add bangumi -- uvx --from git+https://github.com/whycantiusemyname/bangumi-mcp bangumi-mcp
# Local development & tests
git clone https://github.com/whycantiusemyname/bangumi-mcp.git
cd bangumi-mcp
uv sync --extra dev
uv run pytestLicense
Available Tools
33 toolsadd_index_subjectB
Add (or overwrite if already present) a subject in a Bangumi Index (POST /v0/indices/{index_id}/subjects). Requires BANGUMI_ACCESS_TOKEN.
Inputs: index_id (required), subject_id (required), sort, comment.
batch_update_episodesA
Batch update watch status for multiple episodes of a subject (PATCH /v0/users/-/collections/{subject_id}/episodes).
Requires BANGUMI_ACCESS_TOKEN. Recalculates subject completion and invalidates collection cache.
Inputs: subject_id (required), episode_ids (required), status.
browse_subjectsCRead-onlyIdempotent
Browse Bangumi subjects by type, year/month, or rank (GET /v0/subjects).
Inputs: cat, sort, year, limit, +5 more.
check_user_collectionsARead-onlyIdempotent
Batch-check candidate titles or subject_ids against a user's Bangumi collections for recommendation deduplication.
Pass integer subject_ids (or 'id:10380'/'#10380') for exact ID lookup, or title strings (e.g. '命运石之门', '86'). Returns collect/doing/wish/on_hold/dropped/uncollected/unknown along with user rating, episode progress, and ambiguity/completeness notes.
Inputs: items (required), refresh, username, subject_types, +1 more.
create_indexC
Create a new Bangumi Index (目录) (POST /v0/indices). Requires BANGUMI_ACCESS_TOKEN.
Inputs: title, description.
get_calendarARead-onlyIdempotent
Get Bangumi weekly airing broadcast calendar (GET /calendar).
Args: weekday: Optional filter: 1-7 (Mon-Sun), "monday".."sunday", "周一".."周日", or "today".
Inputs: weekday.
get_characterCRead-onlyIdempotent
Get character details, optionally with related subjects and voice actors.
Inputs: character_id (required), relation_limit, include_persons, include_subjects.
get_episodeCRead-onlyIdempotent
Get detailed info for a single episode (GET /v0/episodes/{episode_id}).
Inputs: episode_id (required).
get_episode_progressARead-onlyIdempotent
Read the authenticated user's episode watch progress for a subject OR single episode.
Requires BANGUMI_ACCESS_TOKEN. Pass exactly one of subject_id or episode_id.
Inputs: limit, offset, ep_type, episode_id, +1 more.
get_episodesCRead-onlyIdempotent
List episodes for a subject (GET /v0/episodes).
Inputs: subject_id (required), limit, offset, ep_type.
get_indexBRead-onlyIdempotent
Get a Bangumi curated Index (目录) and optionally its subjects.
Inputs: index_id (required), limit, offset, subject_type, +1 more.
get_meARead-onlyIdempotent
Get the currently authenticated Bangumi user profile (GET /v0/me). Requires BANGUMI_ACCESS_TOKEN.
Inputs: no named parameters.
get_personBRead-onlyIdempotent
Get person/studio details, optionally with related subjects and voiced characters.
Inputs: person_id (required), relation_limit, include_subjects, include_characters.
get_subjectBRead-onlyIdempotent
Get compact, structured details for a Bangumi subject (GET /v0/subjects/{subject_id}).
Inputs: subject_id (required).
get_subject_charactersCRead-onlyIdempotent
Get characters and their voice actors for a subject (GET /v0/subjects/{subject_id}/characters).
Inputs: subject_id (required), limit.
get_subject_personsBRead-onlyIdempotent
Get staff/creators/studios associated with a subject (GET /v0/subjects/{subject_id}/persons).
Inputs: subject_id (required), limit.
get_subject_relationsBRead-onlyIdempotent
Get related subjects (sequels, prequels, manga/novel adaptations, spin-offs) (GET /v0/subjects/{subject_id}/subjects).
Inputs: subject_id (required), limit.
get_userBRead-onlyIdempotent
Get public profile for a Bangumi user (GET /v0/users/{username}).
Inputs: username.
get_user_collectionsCRead-onlyIdempotent
Query a single page of a user's collections (GET /v0/users/{username}/collections).
Inputs: limit, offset, username, subject_type, +1 more.
get_user_favoritesCRead-onlyIdempotent
Get a user's favorited characters and/or persons.
Inputs: kind, limit, offset, username.
get_user_subject_collectionBRead-onlyIdempotent
Get a user's collection record for a single subject (GET /v0/users/{username}/collections/{subject_id}).
Inputs: subject_id (required), username.
remove_index_subjectADestructive
Remove a subject from a Bangumi Index (DELETE /v0/indices/{index_id}/subjects/{subject_id}). Requires BANGUMI_ACCESS_TOKEN.
Inputs: index_id (required), subject_id (required).
search_charactersCRead-onlyIdempotent
Search Bangumi characters (POST /v0/search/characters).
Inputs: keyword (required), nsfw, limit, offset.
search_personsCRead-onlyIdempotent
Search real-world persons/studios (voice actors, directors, mangaka, etc.) (POST /v0/search/persons).
Inputs: keyword (required), limit, career, offset.
search_subjectsARead-onlyIdempotent
Search Bangumi subjects (POST /v0/search/subjects).
Args: keyword: Search query (Japanese, Chinese, or English title/keyword). subject_types: Optional filter list, e.g. ["anime"], ["book", "game"], or ints [1,2,3,4,6]. sort: Sort order: "match" (default), "heat", "rank", or "score". tags: User tags filter (AND logic), e.g. ["科幻", "原创"]. meta_tags: Public wiki meta tags (AND logic; prefix "-" to exclude, e.g. ["-科幻"]). air_date: Date range constraints (YYYY-MM-DD), e.g. [">=2024-01-01", "<2025-01-01"]. rating: Score constraints, e.g. [">=8.0", "<9.5"]. rating_count: Vote count constraints, e.g. [">=500"]. rank: Rank constraints, e.g. [">=1", "<=200"]. nsfw: Optional NSFW filter (ignored by Bangumi when unauthenticated). limit: Results per page (1-50, default 15). offset: Pagination offset (default 0).
Inputs: keyword (required), nsfw, rank, sort, +8 more.
set_character_collectionA
Collect (favorite) a character for the authenticated user (POST /v0/characters/{character_id}/collect).
Requires BANGUMI_ACCESS_TOKEN. Note: uncollecting (collect=False) is currently disabled in upstream bangumi/server and returns UNSUPPORTED_UPSTREAM.
Inputs: character_id (required), collect.
set_index_collectionB
Collect (bookmark) or uncollect a Bangumi Index for the authenticated user. Requires BANGUMI_ACCESS_TOKEN.
Inputs: index_id (required), collect.
set_person_collectionA
Collect (favorite) a person/studio for the authenticated user (POST /v0/persons/{person_id}/collect).
Requires BANGUMI_ACCESS_TOKEN. Note: uncollecting (collect=False) is currently disabled in upstream bangumi/server and returns UNSUPPORTED_UPSTREAM.
Inputs: person_id (required), collect.
sync_user_collectionsBRead-onlyIdempotent
Fetch all paginated collections across all 5 subject types (book/anime/music/game/real) with status statistics.
Read-only in MCP (no local filesystem writes; use bangumi-cli sync -o FILE for local JSON export).
Inputs: refresh, username, include_items, subject_types, +2 more.
update_episode_statusA
Update watch status for a single episode (PUT /v0/users/-/collections/-/episodes/{episode_id}).
Requires BANGUMI_ACCESS_TOKEN. Invalidates cached collection progress.
Inputs: episode_id (required), status.
update_indexA
Edit a Bangumi Index's title and/or description (PUT /v0/indices/{index_id}). Requires BANGUMI_ACCESS_TOKEN.
Inputs: index_id (required), title, description.
update_index_subjectA
Overwrite a subject's sort order and comment inside an Index (PUT /v0/indices/{index_id}/subjects/{subject_id}).
Requires BANGUMI_ACCESS_TOKEN. Upstream writes BOTH sort and comment on every PUT (and inserts the subject into the index if not already present), so always pass both desired values.
Inputs: index_id (required), subject_id (required), sort, comment.
upsert_collectionB
Add or update the authenticated user's collection for a subject (POST/PATCH /v0/users/-/collections/{subject_id}).
Requires BANGUMI_ACCESS_TOKEN. Does not auto-retry on network timeout.
Inputs: subject_id (required), rate, tags, comment, +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 33 tools
Several tools share 'collection' terminology (set_index_collection, upsert_collection, get_user_collections, sync_user_collections, check_user_collections, set_character_collection, set_person_collection), and add_index_subject overlaps with update_index_subject since both can insert/overwrite a subject in an index. Descriptions clarify the distinctions, but an agent must read carefully to avoid misselection.
All tool names follow a consistent snake_case verb_noun pattern (e.g., search_subjects, get_subject, update_episode_status, create_index, remove_index_subject). The few slight variations like get_me or batch_update_episodes still fit the same convention.
33 tools is heavy for a single MCP server, though the Bangumi API is broad and each domain (subjects, characters, persons, users, collections, indices, episodes) requires multiple operations. There is some redundancy, such as add_index_subject vs update_index_subject, which pushes the count toward the high side.
The surface covers most core workflows: search/browse subjects, get details, manage users and collections, update episode progress, and create/edit indices. However, there is no delete_index tool and no explicit way to uncollect a subject, leaving notable gaps in the index and collection lifecycles.
Maintenance
Related MCP Connectors
Access and interact with anime and manga data seamlessly. Retrieve detailed information about your…
Bilibili (B站) data without login: video stats, comments, danmaku, creators, trending, hot searches.
The media memory layer for AI agents and their humans. Your AI client can search your collection, add and log what you've finished, update ratings and lists, and find patterns across everything you've read, watched, played, and listened to.
660+ data tools for agents: TikTok, Douyin, Instagram, YouTube, X, weather, GitHub. Pay per call.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides MCP access to the BangumiTV API, allowing users to retrieve and interact with anime, manga, music, and game information through natural language queries.1727-
- FlicenseNot gradedqualityDmaintenanceEnables 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 users to search for anime information via the Bangumi API and discover corresponding real-world pilgrimage locations through the Anitabi API. It provides tools for retrieving anime metadata and detailed geographic coordinates for 'seichi junrei' locations.3AGPL 3.0
- AlicenseBqualityCmaintenanceEnables searching and retrieving information about anime, manga, and related content via the Bangumi API.5519MIT