UB

ukenn2112/bangumimcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

27 stars 15 forks 质量 61 趋势 0

bgm.tv MCP 服务器

概览

一个模型上下文协议(MCP)服务器,提供对Bangumi TV API的程序访问,使像Claude这样的AI助手能够与完整的动漫、漫画、音乐、游戏及现实世界媒体数据交互。 - :全面覆盖 Bangumi API 端点 - :预构建的多步骤工作流程用于常见任务 - :完整的 OpenAPI API 文档规范 - :干净且易于维护的代码库遵循 MCP 最佳实践 - :完整的 Python 类型提示和枚举定义 - :使用 httpx 实现非阻塞的 API 调用 - Python 3.10及更高版本 - UV包管理器(推荐)或PIP : BANGUMI_TOKEN 为可选但必用于:- 认证操作(集合、个人数据)- R18 内容访问 - 写入操作(创建、更新、删除) 获取你的代币请至:https://next.bgm.

概述(AI 翻译)

英文 |中文


英语

一个模型上下文协议(MCP)服务器,提供对Bangumi TV API的程序访问,使像Claude这样的AI助手能够与完整的动漫、漫画、音乐、游戏及现实世界媒体数据交互。

特色

  • 55 个 MCP 工具:Bangumi API 端点的完整覆盖
  • 3 工作流程提示:为常见任务预设的多步骤工作流程
  • 1 资源:完整的OpenAPI规范用于API文档
  • 模块化架构:遵循MCP最佳实践的简洁、易于维护的代码库
  • 类型安全:完整的Python类型提示和枚举定义
  • 异步支持:使用 httpx 进行非阻塞的 API 调用

快速开始

先决条件

  • Python 3.10 或更高版本
  • UV包管理器(推荐)或PIP

安装

Claude Desktop 配置

在你的claude_desktop_config.json中添加:

注意:BANGUMI_TOKEN为可选,但必须满足:

  • 认证操作(集合、个人数据)
  • R18 内容访问
  • 写入操作(创建、更新、删除)

购买令牌请访问:https://next.bgm.tv/demo/access-token

项目建筑

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Bangumi MCP Server

English | 中文


English

A Model Context Protocol (MCP) server that provides programmatic access to the Bangumi TV API, enabling AI assistants like Claude to interact with comprehensive anime, manga, music, game, and real-world media data.

Features

  • 55 MCP Tools: Complete coverage of Bangumi API endpoints
  • 3 Workflow Prompts: Pre-built multi-step workflows for common tasks
  • 1 Resource: Full OpenAPI specification for API documentation
  • Modular Architecture: Clean, maintainable codebase following MCP best practices
  • Type-Safe: Full Python type hints and enum definitions
  • Async Support: Non-blocking API calls using httpx

Quick Start

Prerequisites

  • Python 3.10 or higher
  • uv package manager (recommended) or pip

Installation

# 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 .

Configuration for Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "bangumi-tv": {
      "command": "uv",
      "args": [
        "--directory",
        "/path/to/BangumiMCP",
        "run",
        "main.py"
      ],
      "env": {
        "BANGUMI_TOKEN": "your_token_here"
      }
    }
  }
}

Note: BANGUMI_TOKEN is optional but required for:

  • Authenticated operations (collections, personal data)
  • R18 content access
  • Write operations (create, update, delete)

Get your token at: https://next.bgm.tv/demo/access-token

Project Architecture

BangumiMCP follows a modular architecture designed for maintainability and scalability:

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)
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "bangumi-tv": { "command": "uv", "args": [ "--directory", "/path/to/BangumiMCP", "run", "main.py" ], "env": { "BANGUMI_TOKEN": "your_token_here" } } } }