Skip to main content
Glama

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
}

引数:

引数

必須

デフォルト

許可される値 / 注記

anime_id

はい

なし

ソース固有のアニメID。myanimelist の場合、これはMALアニメIDです。

root_dir

はい

なし

新しいシリーズのMedusaルートディレクトリパス。

source

いいえ

myanimelist

大文字小文字を区別しない: myanimelist, livechart

anime

いいえ

true

通常は true のままにします。

scene

いいえ

false

シーン番号を有効にするかどうか。

status

いいえ

wanted

Medusaのエピソードステータス文字列。通常は wanted、skipped、ignored のいずれか。

initial_release_group

いいえ

なし

ホワイトリストに登録する最初の/アクティブなリリースグループ。例: SubsPlease。

fallback_release_groups

いいえ

なし

ローテーションするリリースグループの順序付きリスト。決定論的な動作のために、最初のグループを先頭に含めます。

release_group_fallback_days

いいえ

7

エピソードの放送日から次のフォールバックグループに切り替えるまでの日数。

directory_name

いいえ

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"]
}

現在のアニメシーズンのデフォルトを使用した最小限の呼び出し:

{}

引数:

引数

必須

デフォルト

許可される値 / 注記

year

いいえ

現在の年

省略した場合、MCPサーバーの現在の日付から計算されます。

season

いいえ

現在のアニメシーズン

大文字小文字を区別しない: WINTER, SPRING, SUMMER, FALL または Summer のような値。省略した場合、MCPサーバーの現在の月から計算されます。

source

いいえ

myanimelist

大文字小文字を区別しない: myanimelist, livechart

source_sort

いいえ

anime_num_list_users

大文字小文字を区別しない: anime_num_list_users, anime_score

page

いいえ

1

Medusaの結果ページ番号。1 以上である必要があります。

limit

いいえ

10

1ページあたりの結果数。Medusaは 1 から 1000 まで許可しています。デフォルトはMCPクライアントの切り詰めを避けるために意図的に小さくしています。

fields

いいえ

null

保持するレスポンスフィールドのオプションリスト。省略またはnullの場合、完全なMedusaアニメオブジェクトが返されます。

現在のアニメシーズンのデフォルトは、この月のマッピングを使用します:

月

シーズン

1月-3月

WINTER

4月-6月

SPRING

7月-9月

SUMMER

10月-12月

FALL

便利な 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ツールは、ペイロードサイズを削減するために、animeType=TV、minNumListUsers、excludeGenres=Kids,Boys Love、matched=false、firstSeasonOnly=true、fields などのMedusaフィルターを送信します。

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

はい

なし

TVDB番組ID(search_tvdb から)。

root_dir

はい

なし

Medusaルートディレクトリパス。

anime

いいえ

true

status

いいえ

wanted

wanted、skipped、ignored などの文字列を受け入れます。内部的に数値に変換されます。

language

いいえ

なし

インデクサー言語の上書き。

show_dir

いいえ

なし

カスタムシリーズフォルダ名の上書き。

scene

いいえ

false

paused

いいえ

false

{ "tvdb_id": 370761, "root_dir": "/media/videos/Anime" }

set_episode_status

POST /api/v2/internal/updateEpisodeStatus を介して、シリーズのエピソードステータスを設定します。TVDBメタデータが同期されておらず、Medusaが利用可能なはずのエピソードをダウンロードしていない場合に使用します。

引数:

引数

必須

デフォルト

注記

series_slug

はい

なし

シリーズスラッグ(例: tvdb370761)。

episodes

はい

なし

エピソードスラッグのリスト(例: ["s01e01", "s01e02"])。

status

いいえ

wanted

ターゲットステータス: wanted、skipped、ignored。

{ "series_slug": "tvdb370761", "episodes": ["s01e01", "s01e02"], "status": "wanted" }

PUT /api/v2/search/manual を介して、特定のエピソードの手動検索を強制します。有効なプロバイダーを積極的にクエリし、一致するリリースを取得するプロバイダー検索をキューに入れます。エピソードを "wanted" に設定した後に使用します。

引数:

引数

必須

デフォルト

注記

series_slug

はい

なし

シリーズスラッグ(例: tvdb370761)。

episodes

はい

なし

エピソードスラッグのリスト(例: ["s01e01", "s01e02"])。

{ "series_slug": "tvdb370761", "episodes": ["s01e01"] }

update_series_quality

PATCH /api/v2/series/{slug} を介して、既存のシリーズの許可または優先品質を更新します。人間が読める品質名を使用します。省略されたフィールドは変更されません。

引数:

引数

必須

デフォルト

注記

series_slug

はい

なし

シリーズスラッグ(例: tvdb370761)。

allowed_qualities

いいえ

なし

許可リストの品質名。

preferred_qualities

いいえ

なし

優先リストの品質名。

品質名: "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/ サブディレクトリに移動します。type=ORGANIZE_SEASON_FOLDERS を指定して POST /api/v2/series/{slug}/operation を呼び出します。

複数シーズンのアニメがすべてのファイルをフラットディレクトリに持っており、Plexが複数シーズンを1つのフォルダでうまくサポートしていないためにエピソードが欠落している場合に使用します。

引数:

引数

必須

デフォルト

注記

series_slug

はい

なし

シリーズスラッグ(例: tvdb370761)。

{ "series_slug": "tvdb370761" }

postprocess

ディレクトリに対してMedusaの手動ポストプロセスをトリガーします。ダウンロード/ステージングフォルダをスキャンし、一致するエピソードをそれぞれの番組フォルダに移動します。MEDUSA_URL / MEDUSA_API_KEY の資格情報を再利用します。自動ポストプロセスが失敗した後にステージングに残されたファイルをクリアするために使用します(例: ダウンロードハンドラーが失敗した名前の間違ったリリース)。POST /api/v2/postprocess を呼び出します。

重要: directory 引数は Medusaコア によって解釈されるため、Medusaコンテナ内から見えるパス(例: /data/medusa)である必要があります。別のHermesコンテナから見えるパスではありません。

引数:

引数

必須

デフォルト

注記

directory

いいえ

/data/medusa

スキャンするMedusaコンテナのパス。Medusaコアのビューと一致する必要があります。Hermesマウントではありません。

process_type

いいえ

auto

auto、manual、または failed。

force_replace

いいえ

false

既存のエピソードファイルを上書きします。

process_method

いいえ

copy

copy または move。

{ "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 のベース URL。例: http://medusa:8081

MEDUSA_API_KEY

推奨

X-Api-Key として送信される Medusa API キー

MEDUSA_WEB_ROOT

いいえ

Medusa がパスの下でホストされている場合の Web ルート

MEDUSA_TIMEOUT

いいえ

HTTP タイムアウト(秒)。デフォルトは 30

MCP_TRANSPORT

いいえ

stdio または sse。デフォルトは stdio

MCP_HOST

いいえ

SSE バインドホスト。デフォルトは 0.0.0.0

MCP_PORT

いいえ

SSE バインドポート。デフォルトは 8000

MCP_DNS_REBINDING_PROTECTION

いいえ

MCP SDK の Host/Origin 検証を有効化。デフォルトは false

MCP_ALLOWED_HOSTS

いいえ

DNS リバインディング保護が有効な場合に許可される Host ヘッダー(カンマ区切り)。例: daniel-nas.localdomain:3001,localhost:3001

MCP_ALLOWED_ORIGINS

いいえ

DNS リバインディング保護が有効な場合に許可される Origin ヘッダー(カンマ区切り)

コンテナ/SSE デプロイでは、MCP_HOST=0.0.0.0 のままにするか、明示的に設定してください。DNS リバインディング保護はデフォルトで無効になっています。マップされたポート、リバースプロキシ、LAN ホスト名を使用すると、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 8000

Docker

イメージはデフォルトでポート 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 stdio

CI/CD

このリポジトリは完全自動化されたパイプラインを使用しています(手動リリース手順はありません):

  1. main に対して PR を開きます。ci.yml ワークフローは tests/test_boot.py を実行します。これは実際にサーバー(stdio + SSE)を起動し、FastMCP の構築、期待されるツールの登録、両方のトランスポートのバインドを検証します。これは、リリース前に起動/インポートのクラッシュを検出するゲートです。

  2. 自動マージ。 ブートテストが成功すると、enable-auto-merge ジョブが ACTIONS_PAT リポジトリシークレットを使用して PR を(スカッシュで)マージします(このリポジトリではデフォルトの GITHUB_TOKEN は PR をマージできません)。

  3. 自動リリース + ビルド。 main へのプッシュは merge-release.yml をトリガーします。これはブートテストを再実行し、main からパッチバンプされたリリース(v0.0.N+1)を作成し、同じワークフロー内で Docker イメージをビルドしてプッシュします(ビルドは別のリリーストリガーワークフローではなく merge-release.yml に組み込まれています。GitHub が GITHUB_TOKEN 経由でワークフローによって作成されたリリースの release: published イベントを抑制するためです)。

テストをローカルで実行

uv venv
uv pip install -e ".[test]"
uv run pytest tests/ -v

ブートテストは実際のサーバーを起動するため、Docker は不要です。server.py の起動パスを変更した場合は、プッシュ前にこれを実行してください。サーバーが起動に失敗した場合、CI はマージをブロックします。

必要なシークレット

  • ACTIONS_PAT — Contents: 読み取り+書き込み と Pull requests: 読み取り+書き込み の権限を持つファイングレイン PAT(またはクラシックな repo トークン)。リポジトリシークレットとして保存されます。ci.yml が PR のマージに使用します(ここではデフォルトの GITHUB_TOKEN にはマージ機能がありません)。

  • DOCKER_USERNAME / DOCKER_PASSWORD — イメージのプッシュに docker-release.yml が使用します。

Available Tools

21 tools
add_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_animeA

Dry-run or add multiple anime items. Skips filterDecision=skip; execute must be true for writes.

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

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 and optionally add one anime. Dry-run unless execute is true.

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

    B3.3/5.0

    Scored across 21 tools

    Disambiguation3/5

    The core Medusa operations (aliases, release groups, searches, postprocessing) are clearly separated, but the anime-related tools have overlapping boundaries: seasonal_anime, seasonal_candidates, prepare_seasonal_review, resolve_anime_title, and resolve_and_add_anime all seem to cover similar discovery/dedup/resolution steps. Add flows are also split across add_series, add_anime, resolve_and_add_anime, and bulk_add_anime, so an agent may struggle to pick the right one without careful reading.

    Naming Consistency4/5

    Tool naming is overwhelmingly snake_case with a verb_noun pattern (create_alias, set_episode_status, update_series_quality, bulk_add_anime). Only a few tools deviate into noun-first or adjective-first forms such as anime_info and seasonal_anime, but the convention is still predictable overall.

    Tool Count3/5

    At 21 tools, the surface is on the upper edge of comfort and feels heavy for a cohesive server. The count is justifiable given the two intertwined domains of TV-series management and anime seasonal workflows, but some tools appear to cover niche pipeline stages that a smaller set could absorb.

    Completeness3/5

    The set covers many operational needs: adding series, adjusting statuses, searching, postprocessing, quality, season folders, aliases, scheduler status, and anime fetching. However, it lacks a general way to list or retrieve an existing series' slug/config, and there is no update path for aliases—only create/delete—so agents cannot fully reconcile or inspect existing state before modifying it.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers