mcp-medusa
mcp-medusa
MCP 服务器,暴露 Medusa 动漫自动化工具。
工具
add_anime
使用 POST /api/v2/anime/add 将动漫添加到 Medusa。
常见参数:
{
"anime_id": 62076,
"source": "myanimelist",
"root_dir": "/media/videos/Anime",
"anime": true,
"scene": false,
"status": "wanted",
"initial_release_group": "SubsPlease",
"fallback_release_groups": ["SubsPlease", "Erai-raws"],
"release_group_fallback_days": 7
}参数:
参数 | 必需 | 默认值 | 允许的值 / 备注 |
| 是 | 无 | 特定来源的动漫 ID。对于 |
| 是 | 无 | 新剧集的 Medusa 根目录路径。 |
| 否 |
| 不区分大小写: |
| 否 |
| 通常保持 |
| 否 |
| 是否启用场景编号。 |
| 否 |
| Medusa 剧集状态字符串,通常为 |
| 否 | 无 | 要加入白名单的第一个/当前发布组,例如 |
| 否 | 无 | 要轮换的发布组有序列表。将初始组放在首位以确保确定性行为。 |
| 否 |
| 剧集播出日期后多少天切换到下一个备用组。 |
| 否 | Medusa 生成 | 可选的剧集文件夹名称覆盖。 |
seasonal_anime
使用 GET /api/v2/anime/seasonal 查询 Medusa 季节性动漫。
{
"year": 2026,
"season": "SPRING",
"source": "myanimelist",
"source_sort": "anime_num_list_users",
"page": 1,
"limit": 10,
"fields": ["animeId", "displayTitle", "year", "animeType", "genres", "score", "imageUrl"]
}使用当前动漫季默认值的最小调用:
{}参数:
参数 | 必需 | 默认值 | 允许的值 / 备注 |
| 否 | 当前年份 | 如果省略,则根据 MCP 服务器的当前日期计算。 |
| 否 | 当前动漫季 | 不区分大小写: |
| 否 |
| 不区分大小写: |
| 否 |
| 不区分大小写: |
| 否 |
| Medusa 结果页码。必须大于或等于 |
| 否 |
| 每页结果数。Medusa 允许 |
| 否 |
| 可选的要保留的响应字段列表。如果省略/为 null,则返回完整的 Medusa 动漫对象。 |
当前动漫季默认值使用以下月份映射:
月份 | 季节 |
一月-三月 |
|
四月-六月 |
|
七月-九月 |
|
十月-十二月 |
|
有用的 fields 值包括:
["animeId", "source", "displayTitle", "titleRomanji", "titleEnglish", "year", "season", "animeType", "status", "episodes", "episodeInfo", "genres", "studios", "score", "numListUsers", "imageUrl", "anidbId", "tvdbId", "malId", "url", "directoryName"]resolve_anime_title
使用 GET /api/v2/anime/search(带 source、includeDetails=true 和 limit)将标题解析为丰富的 Medusa/MyAnimeList 候选。
{
"title": "Frieren",
"source": "myanimelist",
"limit": 10,
"min_score": 88,
"score_gap": 8
}返回 decision(值为 match、ambiguous 或 no_match)以及带评分的候选。
anime_info
按标题或 MAL ID 返回紧凑的动漫详情和 Medusa 存在状态,不添加任何内容。
{
"title": "Frieren",
"source": "myanimelist"
}或:
{
"mal_id": 52991,
"source": "myanimelist"
}seasonal_candidates
在应用剩余的 OpenClaw 特定启发式规则之前,使用 Medusa 的服务器端季节性过滤器获取季节性候选。
{
"year": 2026,
"season": "SUMMER",
"source": "myanimelist",
"limit": 25,
"min_num_list_users": 3000,
"fields": ["animeId", "displayTitle", "animeType", "genres", "numListUsers", "synopsis"]
}MCP 工具发送 Medusa 过滤器,如 animeType=TV、minNumListUsers、excludeGenres=Kids,Boys Love、matched=false、firstSeasonOnly=true 和 fields,以减小负载大小。
prepare_seasonal_review
将季节性候选项目压缩为带有保守审查说明的 AI 审查包。
{
"items": [{"animeId": 62076, "displayTitle": "Example Title"}],
"max_items": 25
}resolve_and_add_anime
通过 Medusa 的批量添加端点解析并试运行或执行单个添加。写入需要 execute: true。
{
"title": "Frieren",
"root_dir": "/media/videos/Anime",
"execute": false
}scheduler_status
返回 Medusa 调度器线程健康状况和队列状态。当动漫添加似乎卡住或未验证时使用。
{}search_tvdb
按剧集名称在 TVDB 中搜索 TVDB ID。当动漫添加因 AniDB 到 TVDB 的映射问题而失败时,用作后备方案。
{ "query": "Dorohedoro", "language": "en" }add_series
通过 POST /api/v2/series 直接按 TVDB ID 添加剧集。完全绕过动漫解析。当 add_anime 失败时,在 search_tvdb 之后使用。
参数:
参数 | 必需 | 默认值 | 备注 |
| 是 | 无 | TVDB 剧集 ID(来自 |
| 是 | 无 | Medusa 根目录路径。 |
| 否 |
| |
| 否 |
| 接受类似 |
| 否 | 无 | 索引器语言覆盖。 |
| 否 | 无 | 自定义剧集文件夹名称覆盖。 |
| 否 |
| |
| 否 |
|
{ "tvdb_id": 370761, "root_dir": "/media/videos/Anime" }set_episode_status
通过 POST /api/v2/internal/updateEpisodeStatus 设置剧集的剧集状态。当 TVDB 元数据不同步且 Medusa 未下载本应可用的剧集时使用。
参数:
参数 | 必需 | 默认值 | 备注 |
| 是 | 无 | 剧集 slug(例如 |
| 是 | 无 | 剧集 slug 列表(例如 |
| 否 |
| 目标状态: |
{ "series_slug": "tvdb370761", "episodes": ["s01e01", "s01e02"], "status": "wanted" }force_search
通过 PUT /api/v2/search/manual 强制手动搜索特定剧集。排队一个提供者搜索,主动查询已启用的提供者并抓取匹配的发布。在将剧集设置为 "wanted" 后使用。
参数:
参数 | 必需 | 默认值 | 备注 |
| 是 | 无 | 剧集 slug(例如 |
| 是 | 无 | 剧集 slug 列表(例如 |
{ "series_slug": "tvdb370761", "episodes": ["s01e01"] }update_series_quality
通过 PATCH /api/v2/series/{slug} 更新现有剧集的允许或首选质量。使用人类可读的质量名称。省略的字段保持不变。
参数:
参数 | 必需 | 默认值 | 备注 |
| 是 | 无 | 剧集 slug(例如 |
| 否 | 无 | 允许列表的质量名称。 |
| 否 | 无 | 首选列表的质量名称。 |
质量名称:"SDTV"、"SD DVD"、"720p HDTV"、"RawHD"、"1080p HDTV"、"720p WEB-DL"、"1080p WEB-DL"、"720p BluRay"、"1080p BluRay"、"4K UHD TV"、"8K UHD TV"、"4K UHD WEB-DL"、"8K UHD WEB-DL"、"4K UHD BluRay"、"8K UHD BluRay"。
{ "series_slug": "tvdb370761", "allowed_qualities": ["1080p BluRay", "720p HDTV"] }organize_season_folders
启用季文件夹并将剧集文件移动到 Season XX/ 子目录中,而不重命名文件。调用 POST /api/v2/series/{slug}/operation,使用 type=ORGANIZE_SEASON_FOLDERS。
当多季动漫的所有文件都在一个扁平目录中,且 Plex 因对单文件夹多季支持不佳而缺少剧集时使用。
参数:
参数 | 必需 | 默认值 | 备注 |
| 是 | 无 | 剧集 slug(例如 |
{ "series_slug": "tvdb370761" }postprocess
在目录上触发 Medusa 手动后处理。扫描下载/暂存文件夹并将匹配的剧集移动到其剧集文件夹中。复用 MEDUSA_URL / MEDUSA_API_KEY 凭据。在自动后处理失败后(例如下载处理程序因发布命名错误而放弃),使用此工具清理滞留在暂存区的文件。调用 POST /api/v2/postprocess。
重要: directory 参数由 Medusa 核心 解释,因此它必须是 Medusa 容器内部看到的路径(例如 /data/medusa),而不是从单独的 Hermes 容器中可见的路径。
参数:
参数 | 必需 | 默认值 | 备注 |
| 否 |
| 要扫描的 Medusa 容器路径。必须与 Medusa 核心的视图一致,而不是 Hermes 挂载点。 |
| 否 |
|
|
| 否 |
| 覆盖现有的剧集文件。 |
| 否 |
|
|
{ "proc_dir": "/data/medusa", "proc_type": "auto" }bulk_add_anime
通过 POST /api/v2/anime/bulk-add 试运行或执行多个动漫添加。写入需要 execute: true。
{
"items": [{"animeId": 62076, "displayTitle": "Example Title", "aiDecision": "add"}],
"decision_field": "aiDecision",
"allowed_decisions": ["add"],
"execute": false
}Related MCP server: MyAnimeList MCP Server
配置
环境变量:
变量 | 是否必需 | 描述 |
| 是 | Medusa 的基础 URL,例如 |
| 建议 | 以 |
| 否 | 如果 Medusa 托管在某个路径下,则为 Web 根目录 |
| 否 | HTTP 超时时间(秒),默认 |
| 否 |
|
| 否 | SSE 绑定主机,默认 |
| 否 | SSE 绑定端口,默认 |
| 否 | 启用 MCP SDK Host/Origin 校验,默认 |
| 否 | 启用 DNS 重绑定保护时,允许的 |
| 否 | 启用 DNS 重绑定保护时,允许的 |
对于容器/SSE 部署,请保持 MCP_HOST=0.0.0.0 或显式设置它。DNS 重绑定保护默认处于禁用状态,因为映射端口、反向代理和局域网主机名通常会导致 421 Misdirected Request 错误。如果启用它,请在 MCP_ALLOWED_HOSTS 中包含外部可见的主机和端口。
本地运行
pip install -e .
MEDUSA_URL=http://localhost:8081 MEDUSA_API_KEY=... mcp-medusa对于 SSE:
MEDUSA_URL=http://localhost:8081 MEDUSA_API_KEY=... mcp-medusa --transport sse --port 8000Docker
镜像默认在端口 8000 上使用 SSE。
docker build -t mcp-medusa .
docker run --rm -p 8000:8000 \
-e MEDUSA_URL=http://medusa:8081 \
-e MEDUSA_API_KEY=... \
mcp-medusa如需改用 stdio:
docker run --rm -i \
-e MEDUSA_URL=http://medusa:8081 \
-e MEDUSA_API_KEY=... \
mcp-medusa --transport stdioCI/CD
该仓库使用全自动流水线(无需手动发布步骤):
针对
main分支打开 PR。ci.yml工作流会运行tests/test_boot.py,该测试会实际启动服务器(stdio + SSE),并断言FastMCP构造、预期工具注册以及两种传输方式的绑定。这是在上线前捕获启动/导入崩溃的关卡。自动合并。 一旦启动测试通过,
enable-auto-merge作业会使用ACTIONS_PAT仓库密钥合并 PR(squash 合并)(默认的GITHUB_TOKEN无法在此仓库中合并 PR)。自动发布 + 构建。 推送到
main会触发merge-release.yml,它会重新运行启动测试,从main创建补丁版本递增的发布(v0.0.N+1),并在同一工作流中构建 + 推送 Docker 镜像(构建被并入merge-release.yml,而不是单独的发布触发工作流,因为当发布由工作流通过GITHUB_TOKEN创建时,GitHub 会抑制release: published事件)。
在本地运行测试
uv venv
uv pip install -e ".[test]"
uv run pytest tests/ -v启动测试会启动真实服务器,因此不需要 Docker。如果你修改了 server.py 启动路径中的任何内容,请在推送前运行此测试——如果服务器无法启动,CI 将阻止合并。
必需的密钥
ACTIONS_PAT— 具有 Contents: read+write 和 Pull requests: read+write 权限的细粒度 PAT(或经典repo令牌),以仓库密钥形式存储。由ci.yml用于合并 PR。(默认的GITHUB_TOKEN在此处不具备合并能力。)DOCKER_USERNAME/DOCKER_PASSWORD— 由docker-release.yml用于推送镜像。
Available Tools
21 toolsadd_animeA
Add an anime series to Medusa via /api/v2/anime/add.
Note: Some anime may fail with "no name on TVDBv2" due to AniDB→TVDB ID mapping issues. As a workaround, use search_tvdb to find the correct TVDB ID, then add_series to add it directly.
Inputs: anime_id (required), root_dir (required), anime, scene, +7 more.
add_seriesA
Add a series to Medusa directly by TVDB ID via POST /api/v2/series.
Use this as a fallback when add_anime fails due to AniDB-to-TVDB mapping issues. First find the correct TVDB ID with search_tvdb, then add it here. This bypasses anime resolution entirely and adds via the standard series endpoint.
quality values: "N/A", "Unknown", "SDTV", "SD DVD", "720p HDTV", "RawHD", "1080p HDTV", "720p WEB-DL", "1080p WEB-DL", "720p BluRay", "1080p BluRay", "4K UHD TV", "8K UHD TV", "4K UHD WEB-DL", "8K UHD WEB-DL", "4K UHD BluRay", "8K UHD BluRay". When omitted, Medusa's global quality defaults are used.
Inputs: tvdb_id (required), root_dir (required), anime, scene, +6 more.
anime_infoA
Return compact anime details and Medusa presence by title or MAL ID. Does not add anime.
Inputs: limit, title, mal_id, source, +3 more. Returns: object
bulk_add_animeB
Dry-run or add multiple anime items; skips filterDecision=skip.
Read each results[].outcome as in resolve_and_add_anime. With execute=true, only items that pass the dry-run as ready_to_add are submitted. already_exists and already_queued are skips; needs_review and mapping_failed need follow-up.
Inputs: items (required), source, execute, root_dir, +9 more. Returns: object
create_aliasA
Create a local scene exception (alias) for a series.
This enables Medusa to recognize an alternative release title when searching, allowing it to match releases that use a different naming scheme. Only local (user-managed) scene exceptions can be created via this tool.
Inputs: name (required), series_slug (required), season. Returns: object
delete_aliasB
Delete a scene exception (alias) by ID.
Inputs: alias_id (required). Returns: result
diagnose_release_groupsA
Diagnose release group issues for a series by comparing config vs available releases.
Checks provider cache first; if empty, triggers a manual search and retries. Returns a structured diagnosis with recommendation.
Inputs: series_slug (required), season, episode, max_retries, +1 more. Returns: object
force_searchA
Force a manual search for specific episodes via PUT /api/v2/search/manual.
Queues a manual search that actively queries providers and snatches matching releases. Use after setting episode status to "wanted" when you want to immediately search for and download episodes.
Inputs: episodes (required), series_slug (required).
get_aliasesA
List scene exceptions (aliases) for a series.
Scene exceptions are alternative episode/release titles that Medusa recognizes when searching. This tool reads them; use create_alias to add new ones.
Inputs: series_slug (required), season. Returns: result
organize_season_foldersA
Move episodes into Season XX/ subdirectories without renaming files.
Enables season folders on the series and moves all downloaded episode files into Season XX/ subdirectories, preserving original filenames. Also moves associated files (subtitles, etc.).
Use this when:
A multi-season anime has all files in a flat directory
Plex is missing episodes due to poor multi-season-in-one-folder support
A second season was added years later to a show originally added flat
Calls POST /api/v2/series/{slug}/operation with type=ORGANIZE_SEASON_FOLDERS.
Inputs: series_slug (required). Returns: object
postprocessA
Trigger Medusa manual post-processing on a directory.
Scans directory (a download/staging folder) and moves matched
episodes into their show folders. Reuses Medusa credentials from
MEDUSA_URL / MEDUSA_API_KEY. Use this to clear files stranded in
staging after a failed auto-post-process (e.g. a mis-named release
that the download handler bailed on).
IMPORTANT: directory is interpreted by MEDUSA CORE, so it must be
the path as seen inside the Medusa container (e.g. /data/medusa),
NOT the path visible from the Hermes container.
Inputs: directory, process_type, force_replace, process_method. Returns: object
prepare_seasonal_reviewC
Compact seasonal candidates into an AI review packet.
Inputs: items (required), max_items. Returns: object
resolve_and_add_animeB
Resolve one anime and report its add outcome. Dry-run unless execute is true.
Act on outcome, not title similarity: already_exists means skip (see match.slug); ready_to_add means execute only if authorized; needs_review means show candidates without adding; mapping_failed means use a confirmed TVDB ID with add_series. queued and already_queued are not proof of installation or episode downloads.
Inputs: limit, title, mal_id, source, +10 more. Returns: object
resolve_anime_titleB
Resolve an anime title to MAL candidates with match/ambiguous/no_match decision.
Inputs: title (required), limit, fields, source, +2 more. Returns: object
scheduler_statusA
Return Medusa scheduler and queue status.
Shows whether each scheduler thread is alive, enabled, and currently active. Useful for diagnosing stuck queues.
Inputs: no named parameters. Returns: object
search_tvdbA
Search TVDB for a show by name and return matching TVDB IDs.
Use this when an anime add fails due to AniDB-to-TVDB mapping issues. Find the correct TVDB ID here, then add the show with add_series.
Inputs: query (required), language. Returns: result
seasonal_animeB
Query a paginated seasonal anime page from Medusa, optionally returning only selected fields.
Season, source, and source_sort are case-insensitive.
Inputs: page, year, limit, fields, +3 more.
seasonal_candidatesC
Fetch server-filtered seasonal anime candidates and apply residual preference heuristics.
Inputs: year, limit, fields, season, +5 more. Returns: object
set_episode_statusA
Set episode statuses for a series via PATCH /api/v2/episodes/{series_slug}.
Use when TVDB metadata is out of sync with actual episode status and Medusa is not downloading episodes that should be available. Set affected episodes to "wanted" to force Medusa to search for them.
Uses the same PATCH endpoint as the Medusa Web UI, so it can change UNAIRED episodes to WANTED unlike the internal bulk-update endpoint.
Inputs: episodes (required), series_slug (required), status. Returns: object
update_release_groupsA
Update release group configuration for a series.
Sends PATCH /api/v2/series/{slug} with the specified config.release.* fields. Only the provided fields are changed; omitted fields are left as-is.
Inputs: series_slug (required), blacklist, whitelist, fallback_days, +1 more. Returns: object
update_series_qualityA
Update allowed and/or preferred qualities for an existing series.
Sends PATCH /api/v2/series/{slug} with config.qualities.* fields. Only the provided fields are changed; omitted fields are left as-is.
quality values: "N/A", "Unknown", "SDTV", "SD DVD", "720p HDTV", "RawHD", "1080p HDTV", "720p WEB-DL", "1080p WEB-DL", "720p BluRay", "1080p BluRay", "4K UHD TV", "8K UHD TV", "4K UHD WEB-DL", "8K UHD WEB-DL", "4K UHD BluRay", "8K UHD BluRay".
Inputs: series_slug (required), allowed_qualities, preferred_qualities.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 21 tools
Most tools have distinct purposes, and the descriptions clearly differentiate workflows such as resolve_and_add_anime versus bulk_add_anime and add_anime versus add_series. However, seasonal_anime, seasonal_candidates, and prepare_seasonal_review overlap enough that an agent may hesitate about which seasonal query path to use.
All names use snake_case, but verbs and noun-style names are mixed: get_aliases/create_alias/delete_alias, add_anime/add_series, resolve_anime_title, and noun-only names like scheduler_status and seasonal_candidates. The convention is still readable, but it is not a consistent verb_noun pattern throughout.
At 21 tools, the surface is in the borderline-heavy range for this domain. Several tools are justified by distinct workflows, but the cluster of seasonal lookup tools and multiple add/resolve paths feels somewhat overgrown.
The surface covers adding series/anime, resolving titles, aliases CRUD, release groups, quality updates, episode status, search, post-processing, and scheduling. However, obvious gaps remain: there is no delete/remove series tool and no general list-series or series detail enumeration, which are common lifecycle operations.
Maintenance
Related MCP Connectors
Unofficial AniList MCP — wraps AniList GraphQL API (free, no auth)
Anime Garden MCP for anime torrent discovery.
Unofficial Jikan MCP — wraps the Jikan v4 API (anime/manga data, free, no auth)
TVMaze MCP — TV show metadata, episodes, schedules (no auth)
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-
- AlicenseBqualityDmaintenanceMCP Server for interacting with the MyAnimeList API, allowing LLM clients to access and interact with anime, manga and more.154MIT
- AlicenseNot gradedqualityAmaintenanceEnables searching Overseerr media, retrieving TMDB-backed details, and submitting movie or TV requests through MCP tools.5MIT
- AlicenseBqualityDmaintenanceEnables control and management of a self-hosted media stack (Radarr, Sonarr, Prowlarr, SABnzbd, qBittorrent) through natural language via MCP.15GPL 3.0