Bangumi TV MCP Service
Servidor MCP de Bangumi
English
Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona acceso programático a la API de Bangumi TV, permitiendo que asistentes de IA como Claude interactúen con datos completos sobre anime, manga, música, juegos y medios del mundo real.
Características
55 herramientas MCP: Cobertura completa de los endpoints de la API de Bangumi
3 prompts de flujo de trabajo: Flujos de trabajo de varios pasos preconfigurados para tareas comunes
1 recurso: Especificación OpenAPI completa para la documentación de la API
Arquitectura modular: Base de código limpia y mantenible siguiendo las mejores prácticas de MCP
Tipado seguro: Sugerencias de tipo de Python completas y definiciones de enumeraciones
Soporte asíncrono: Llamadas a la API sin bloqueo utilizando httpx
Inicio rápido
Requisitos previos
Python 3.10 o superior
Gestor de paquetes uv (recomendado) o pip
Instalación
# Clone the repository
git clone https://github.com/Ukenn2112/BangumiMCP.git
cd BangumiMCP
# Create and activate virtual environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -e .Configuración para Claude Desktop
Añadir a tu claude_desktop_config.json:
{
"mcpServers": {
"bangumi-tv": {
"command": "uv",
"args": [
"--directory",
"/path/to/BangumiMCP",
"run",
"main.py"
],
"env": {
"BANGUMI_TOKEN": "your_token_here"
}
}
}
}Nota: BANGUMI_TOKEN es opcional pero necesario para:
Operaciones autenticadas (colecciones, datos personales)
Acceso a contenido R18
Operaciones de escritura (crear, actualizar, eliminar)
Obtén tu token en: https://next.bgm.tv/demo/access-token
Arquitectura del proyecto
BangumiMCP sigue una arquitectura modular diseñada para la mantenibilidad y la escalabilidad:
BangumiMCP/
├── main.py # Server initialization (44 lines)
├── src/
│ ├── config.py # Configuration constants
│ ├── enums.py # API enum definitions (8 types)
│ ├── utils/
│ │ ├── api_client.py # HTTP client & error handling
│ │ └── formatters.py # Data formatting utilities
│ ├── resources/
│ │ └── openapi_resource.py # OpenAPI specification resource
│ ├── tools/ # 55 MCP tools organized by domain
│ │ ├── subject_tools.py # Subjects & episodes (10 tools)
│ │ ├── character_tools.py # Characters (7 tools)
│ │ ├── person_tools.py # Persons & companies (7 tools)
│ │ ├── user_tools.py # User information (3 tools)
│ │ ├── collection_tools.py # Collections (11 tools)
│ │ ├── revision_tools.py # Edit history (8 tools)
│ │ └── index_tools.py # Indices/directories (9 tools)
│ └── prompts/
│ └── workflow_prompts.py # Composite prompts (3)
├── bangumi-tv-api.json # OpenAPI 3.0.3 specification
└── pyproject.toml # Project metadataHerramientas disponibles
Temas y episodios (10 herramientas)
get_daily_broadcast- Horario de emisión semanalsearch_subjects- Búsqueda de texto completo con filtrosbrowse_subjects- Navegación basada en categoríasget_subject_details- Información detallada del temaget_subject_image- URL de la imagen del temaget_subject_persons- Creadores/personal relacionadoget_subject_characters- Personajes relacionadosget_subject_relations- Temas relacionadosget_episodes- Lista de episodiosget_episode_details- Información del episodio
Personajes (7 herramientas)
search_characters- Búsqueda de personajesget_character_details- Información del personajeget_character_image- URL de la imagen del personajeget_character_subjects- Temas que presentan al personajeget_character_persons- Actores de voz y creadorescollect_character- Añadir a favoritos ⚠️ Requiere autenticaciónuncollect_character- Eliminar de favoritos ⚠️ Requiere autenticación
Personas (7 herramientas)
search_persons- Buscar creadores/actoresget_person_details- Información de la personaget_person_image- URL de la imagen de la personaget_person_subjects- Trabajos de la personaget_person_characters- Personajes asociadoscollect_person- Añadir a favoritos ⚠️ Requiere autenticaciónuncollect_person- Eliminar de favoritos ⚠️ Requiere autenticación
Usuarios (3 herramientas)
get_user_info- Perfil de usuario públicoget_user_avatar- URL del avatar del usuarioget_current_user- Información del usuario autenticado ⚠️ Requiere autenticación
Colecciones (11 herramientas)
get_user_collections- Colecciones de temas del usuarioget_user_subject_collection- Estado de la colección del temaupdate_subject_collection- Actualizar estado del tema ⚠️ Requiere autenticaciónget_user_episode_collection- Lista de seguimiento de episodios ⚠️ Requiere autenticaciónupdate_episode_collection- Actualización por lotes de episodios ⚠️ Requiere autenticaciónget_single_episode_collection- Estado de un solo episodio ⚠️ Requiere autenticaciónupdate_single_episode_collection- Actualizar un solo episodio ⚠️ Requiere autenticaciónget_user_character_collections- Colecciones de personajesget_user_character_collection- Estado de la colección de personajesget_user_person_collections- Colecciones de personasget_user_person_collection- Estado de la colección de personas
Revisiones (8 herramientas)
get_person_revisions- Historial de edición de personasget_person_revision- Detalle de edición de una sola personaget_character_revisions- Historial de edición de personajesget_character_revision- Detalle de edición de un solo personajeget_subject_revisions- Historial de edición de temasget_subject_revision- Detalle de edición de un solo temaget_episode_revisions- Historial de edición de episodiosget_episode_revision- Detalle de edición de un solo episodio
Índices (9 herramientas)
create_index- Crear nuevo índice ⚠️ Requiere autenticaciónget_index- Detalles del índiceupdate_index- Actualizar información del índice ⚠️ Requiere autenticaciónget_index_subjects- Temas en el índiceadd_subject_to_index- Añadir tema ⚠️ Requiere autenticaciónupdate_index_subject- Actualizar información del tema ⚠️ Requiere autenticaciónremove_subject_from_index- Eliminar tema ⚠️ Requiere autenticacióncollect_index- Añadir índice a la colección ⚠️ Requiere autenticaciónuncollect_index- Eliminar índice de la colección ⚠️ Requiere autenticación
Prompts de flujo de trabajo
Flujos de trabajo de varios pasos preconfigurados para tareas comunes:
search_and_summarize_anime - Buscar anime por palabra clave y obtener un resumen de IA
get_subject_full_info - Obtener información completa del tema (detalles, personas, personajes, relaciones)
find_voice_actor - Buscar personaje e identificar actores de voz
Desarrollo
Añadir nuevas herramientas
Identificar la categoría apropiada (tema, personaje, persona, etc.)
Añadir la función de la herramienta al archivo correspondiente en
src/tools/Registrar la herramienta en la función
register()del móduloActualizar este README con el nuevo recuento de herramientas
Pruebas
# Test imports
python -c "from src.config import BANGUMI_TOKEN; print('OK')"
python -c "from src.tools import subject_tools; print('OK')"
# Run the server
uv run main.pyEstructura del código
Jerarquía de dependencias (sin importaciones circulares):
Nivel 0:
config.py,enums.py(sin dependencias)Nivel 1:
utils/(depende de config y enums)Nivel 2:
resources/,tools/,prompts/(dependen de utils)Nivel 3:
main.py(orquesta todo)
Guías de importación:
Usar importaciones relativas dentro del paquete
src/(ej.from ..config import)Importar desde módulos específicos, no a nivel de paquete
Seguir la jerarquía de dependencias para evitar importaciones circulares
Variables de entorno
Variable | Requerido | Descripción |
| No | Token de acceso de Bangumi para operaciones autenticadas y contenido R18 |
Licencia
Este proyecto se basa en la documentación de la API de Bangumi y sigue sus términos de servicio.
Proyectos relacionados
BangumiMCP-ts - Versión en TypeScript de BangumiMCP
Contribución
¡Las contribuciones son bienvenidas! Por favor, siéntete libre de enviar problemas o solicitudes de extracción.
Related MCP server: MyAnimeList MCP Server
中文
一个基于 Model Context Protocol (MCP) 的服务器,为 Bangumi TV API 提供程序化访问接口,使 Claude 等 AI 助手能够与海量的动画、漫画、音乐、游戏和真人影视数据进行交互。
功能特性
55 个 MCP 工具:完整覆盖 Bangumi API 端点
3 个工作流提示:预构建的多步骤工作流,用于常见任务
1 个资源:完整的 OpenAPI 规范文档
模块化架构:清晰、可维护的代码库,遵循 MCP 最佳实践
类型安全:完整的 Python 类型提示和枚举定义
异步支持:使用 httpx 的非阻塞 API 调用
快速开始
前置要求
Python 3.10 或更高版本
uv 包管理器(推荐)或 pip
安装
# 克隆仓库
git clone https://github.com/Ukenn2112/BangumiMCP.git
cd BangumiMCP
# 创建并激活虚拟环境
uv venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# 安装依赖
uv pip install -e .Claude Desktop 配置
在 claude_desktop_config.json 中添加:
{
"mcpServers": {
"bangumi-tv": {
"command": "uv",
"args": [
"--directory",
"/path/to/BangumiMCP",
"run",
"main.py"
],
"env": {
"BANGUMI_TOKEN": "your_token_here"
}
}
}
}注意:BANGUMI_TOKEN 是可选的,但以下操作需要:
认证操作(收藏、个人数据)
访问 R18 内容
写操作(创建、更新、删除)
获取令牌:https://next.bgm.tv/demo/access-token
项目架构
BangumiMCP 采用模块化架构,便于维护和扩展:
BangumiMCP/
├── main.py # 服务器初始化(44 行)
├── src/
│ ├── config.py # 配置常量
│ ├── enums.py # API 枚举定义(8 种类型)
│ ├── utils/
│ │ ├── api_client.py # HTTP 客户端和错误处理
│ │ └── formatters.py # 数据格式化工具
│ ├── resources/
│ │ └── openapi_resource.py # OpenAPI 规范资源
│ ├── tools/ # 55 个 MCP 工具,按领域组织
│ │ ├── subject_tools.py # 条目和章节(10 个工具)
│ │ ├── character_tools.py # 角色(7 个工具)
│ │ ├── person_tools.py # 人物和公司(7 个工具)
│ │ ├── user_tools.py # 用户信息(3 个工具)
│ │ ├── collection_tools.py # 收藏(11 个工具)
│ │ ├── revision_tools.py # 编辑历史(8 个工具)
│ │ └── index_tools.py # 目录(9 个工具)
│ └── prompts/
│ └── workflow_prompts.py # 组合提示(3 个)
├── bangumi-tv-api.json # OpenAPI 3.0.3 规范
└── pyproject.toml # 项目元数据可用工具
条目和章节(10 个工具)
get_daily_broadcast- 每周放送时间表search_subjects- 全文搜索,支持过滤browse_subjects- 按分类浏览get_subject_details- 详细条目信息get_subject_image- 条目图片 URLget_subject_persons- 相关创作者/制作人员get_subject_characters- 相关角色get_subject_relations- 相关条目get_episodes- 章节列表get_episode_details- 章节信息
角色(7 个工具)
search_characters- 角色搜索get_character_details- 角色信息get_character_image- 角色图片 URLget_character_subjects- 角色出现的条目get_character_persons- 声优和创作者collect_character- 添加到收藏 ⚠️ 需要认证uncollect_character- 从收藏中移除 ⚠️ 需要认证
人物(7 个工具)
search_persons- 搜索创作者/演员get_person_details- 人物信息get_person_image- 人物图片 URLget_person_subjects- 人物参与的作品get_person_characters- 关联的角色collect_person- 添加到收藏 ⚠️ 需要认证uncollect_person- 从收藏中移除 ⚠️ 需要认证
用户(3 个工具)
get_user_info- 公开用户资料get_user_avatar- 用户头像 URLget_current_user- 当前认证用户信息 ⚠️ 需要认证
收藏(11 个工具)
get_user_collections- 用户的条目收藏get_user_subject_collection- 条目收藏状态update_subject_collection- 更新条目状态 ⚠️ 需要认证get_user_episode_collection- 章节观看列表 ⚠️ 需要认证update_episode_collection- 批量更新章节 ⚠️ 需要认证get_single_episode_collection- 单个章节状态 ⚠️ 需要认证update_single_episode_collection- 更新单个章节 ⚠️ 需要认证get_user_character_collections- 角色收藏get_user_character_collection- 角色收藏状态get_user_person_collections- 人物收藏get_user_person_collection- 人物收藏状态
修订历史(8 个工具)
get_person_revisions- 人物编辑历史get_person_revision- 单个人物编辑详情get_character_revisions- 角色编辑历史get_character_revision- 单个角色编辑详情get_subject_revisions- 条目编辑历史get_subject_revision- 单个条目编辑详情get_episode_revisions- 章节编辑历史get_episode_revision- 单个章节编辑详情
目录(9 个工具)
create_index- 创建新目录 ⚠️ 需要认证get_index- 目录详情update_index- 更新目录信息 ⚠️ 需要认证get_index_subjects- 目录中的条目add_subject_to_index- 添加条目 ⚠️ 需要认证update_index_subject- 更新条目信息 ⚠️ 需要认证remove_subject_from_index- 移除条目 ⚠️ 需要认证collect_index- 收藏目录 ⚠️ 需要认证uncollect_index- 取消收藏目录 ⚠️ 需要认证
工作流提示
预构建的多步骤工作流,用于常见任务:
search_and_summarize_anime - 按关键字搜索动画并获取 AI 摘要
get_subject_full_info - 获取全面的条目信息(详情、人物、角色、关联)
find_voice_actor - 搜索角色并识别声优
开发
添加新工具
确定合适的类别(条目、角色、人物等)
将工具函数添加到
src/tools/中相应的文件在模块的
register()函数中注册工具更新此 README 中的工具数量
测试
# 测试导入
python -c "from src.config import BANGUMI_TOKEN; print('OK')"
python -c "from src.tools import subject_tools; print('OK')"
# 运行服务器
uv run main.py代码结构
依赖层次结构(无循环导入):
Level 0:
config.py,enums.py(无依赖)Level 1:
utils/(依赖 config 和 enums)Level 2:
resources/,tools/,prompts/(依赖 utils)Level 3:
main.py(协调所有模块)
导入指南:
在
src/包内使用相对导入(例如from ..config import)从特定模块导入,而不是包级别
遵循依赖层次结构以避免循环导入
环境变量
变量 | 必填 | 说明 |
| 否 | Bangumi 访问令牌,用于认证操作和访问 R18 内容 |
许可证
此项目基于 Bangumi API 文档构建,并遵循其服务条款。
相关项目
BangumiMCP-ts - BangumiMCP 的 TypeScript 版本
贡献
欢迎贡献!请随时提交问题或拉取请求。
致谢
此项目基于 Bangumi API 文档构建。
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 Servers
- AlicenseNot gradedqualityFmaintenanceAn 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.45189MIT
- AlicenseBqualityDmaintenanceMCP Server for interacting with the MyAnimeList API, allowing LLM clients to access and interact with anime, manga and more.152MIT
- AlicenseBqualityBmaintenanceEnables searching and retrieving information about anime, manga, and related content via the Bangumi API.5515MIT
- AlicenseNot gradedqualityAmaintenanceAn MCP server for anime and manga discovery, enabling search, detail retrieval, franchise watch order, seasonal schedule, character lookups, rankings, and studio filmography via natural language.651Apache 2.0
Related MCP Connectors
AniList MCP — wraps AniList GraphQL API (free, no auth)
AnimeQuotes MCP — wraps animechan.io (free, no auth)
Access and interact with anime and manga data seamlessly. Retrieve detailed information about your…
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/Ukenn2112/BangumiMCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server