OSS · OPEN SOURCE · 2026

jdownloader-mcp

MCP server driving JDownloader 2 across its full download lifecycle via myjdapi

Python · MCP · myjdapi

GitHub | Release v0.6.0

jdownloader-mcp v0.6.0 62-tool MCP surface and yt-dlp auto-fallback architecture showcase

Overview / Engineering Problem

Managing complex download queues in JDownloader 2—handling link grabber staging, link containers, premium hoster accounts, and captcha-blocked packages—typically requires interactive desktop UI clicks or manual inspection of the MyJDownloader web dashboard.

jdownloader-mcp exposes JDownloader 2's full download lifecycle to AI agents and automated workflows via the Model Context Protocol (MCP). Built in Python on top of myjdapi, it transforms headless or remote download management into structured, conversational, and scriptable tool calls.

Open-Source MCP Tooling: Published at swe-sanad/jdownloader-mcp as part of a practical collection of Python MCP servers for real-world desktop and service automation.

Architecture & Technical Decisions

The server bridges MCP tool semantics with JDownloader 2's remote API model:

  • Python MCP Server: Presents clean, typed MCP tools so AI clients can inspect queue states, submit links, control active downloads, and resolve workflow bottlenecks autonomously.
  • myjdapi Transport Integration: Communicates with JDownloader 2 instances through the myjdapi Python library, supporting authenticated remote device sessions without fragile UI scraping.
  • Full Lifecycle Coverage: Goes beyond simple URL submission to cover link grabbing, link containers, premium hoster status/handling, package organization, and captcha folder management.
  • Separation of Staging & Execution: Preserves JDownloader's LinkGrabber-to-Downloads lifecycle so agents can inspect and filter packages before starting transfers.
Protocol Advantage: By wrapping myjdapi inside MCP tools, any compliant agent client gains immediate, structured control over remote JDownloader 2 instances without custom API glue code.

SDLC & Quality Practices

Building an automation bridge over an external download engine requires defensive state handling:

  1. Lifecycle-Aware Tool Design: Tools map directly to JDownloader 2's real operational phases (link collection, container parsing, captcha handling, active transfer control).
  2. Clean Python Packaging: Keeps dependencies minimal around Python, MCP, and myjdapi for straightforward deployment in local or headless environments.
  3. Open-Source Transparency: Full source code and tool definitions are maintained publicly on GitHub for verification and extension.

Stack & Deliverables

Layer Technology / Library Purpose
Language Runtime Python Core server implementation and session management
Agent Protocol MCP (Model Context Protocol) Standardized tool discovery and invocation for AI agents
JDownloader Client myjdapi Authenticated interface to JDownloader 2 devices and queues
Source Repository GitHub (swe-sanad/jdownloader-mcp) Public repository for full download lifecycle automation

Latest Release: v0.6.0 — yt-dlp fallback: JDownloader first, yt-dlp when a link breaks (62 tools) (v0.6.0)

v0.6.0 — yt-dlp fallback: JDownloader first, yt-dlp when a link breaks (62 tools)

Overview

jdownloader-mcp is an MCP server (built on the mcp 1.x FastMCP API) that lets an AI agent drive a local JDownloader 2 instance through its entire download lifecycle — from resolving links and containers in the Linkgrabber staging area, promoting packages to the Downloads queue, managing priorities and extraction paths, handling human-in-the-loop captchas and interactive dialogs, to monitoring queue health and cleaning up.

It targets the download workloads shell tools cannot handle natively: premium hosters, one-click hosters, .dlc/.rsdf/.ccf link containers, and captcha-gated folders. Starting in v0.6.0, the server pairs myjdapi with a built-in yt-dlp fallback engine and a smart_download router so fast-moving video and social platforms (where JDownloader plugins frequently lag behind anti-bot walls) complete cleanly without manual intervention.


v0.6.0 Highlights

JDownloader excels at premium hosters and link containers, but its plugins often lag behind fast-moving video/social sites. v0.6.0 adds yt-dlp as a second download backend alongside JDownloader, with a router tool that tries JDownloader first and automatically falls back to yt-dlp when a link breaks — plus cookie-based authentication for private and login-gated content.

  • ytdlp_download(url, dest=None, audio_only=False, cookies_from_browser=None, cookies_file=None) — Downloads directly via yt-dlp, bypassing JDownloader entirely. Ideal when JD reports a blocked host or an outdated plugin (TikTok, YouTube, and thousands of other supported sites). Set audio_only=True to extract MP3 audio.
  • smart_download(url, dest=None, audio_only=False, backend=None, cookies_from_browser=None, cookies_file=None, jd_wait_s=45) — JDownloader-first router with automatic fallback:
    • Known video/social sites (tiktok., youtube., youtu.be, twitter., x.com, instagram., facebook., fb.watch, vimeo., twitch., dailymotion., reddit., redd.it, soundcloud., bilibili., streamable., ok.ru, rumble., kick.com, snapchat., pinterest.) route straight to yt-dlp.
    • All other URLs are tried on JDownloader first; if a link fails within jd_wait_s seconds (offline / error / plugin-outdated / stalled), the failed JD entry is removed and the URL falls back to yt-dlp ("routed_to": "jd->ytdlp" with jd_outcome and jd_reason).
    • Force a single engine with no fallback via backend="ytdlp" or backend="jd".
  • Cookie-based authentication — Supports cookies_from_browser (chrome, firefox, edge, brave, chromium, opera, vivaldi) and Netscape-format cookies_file for private/login-gated content.
  • Runtime & scale — Brings the server to 62 MCP tools across 13 categories, backed by 151 unit tests. yt-dlp is now a core runtime dependency; ffmpeg on PATH is a soft requirement for MP3 extraction and merging separate video+audio streams.

Verified

  • End-to-end on public content: a YouTube URL routed through smart_download → dispatched to yt-dlp → downloaded and converted to MP3.
  • Live JDownloader 2 surface verification across lifecycle, query, account, config, cleanup/diagnostics, variants/organize, extensions, dialogs, and credential read tools.

Upgrading

uv sync

New requirements: yt-dlp (installed automatically via uv sync) and ffmpeg on PATH if you need audio extraction (audio_only=True) or merged video+audio output. JDownloader-only usage does not require ffmpeg.


Key Capabilities

  • Dual-Engine Smart Routing (62 Tools) — Every tool returns structured JSON ({"ok": true, "result": ...} or {"ok": false, "error": "..."}) and never raises unhandled exceptions to the MCP client:
    • Lifecycle (16): add_links, add_container (DLC / RSDF / CCF), list_linkgrabber, list_downloads, status, wait_for, move_to_downloads, control_downloads, force_start, set_priority, set_enabled, get_directories, set_download_dir, set_extraction, remove, reset
    • Ergonomic / Composite (3): download, check_availability, find
    • Accounts / Premium Hosters (6): list_accounts, list_premium_hosters, add_account, remove_accounts, set_account_enabled, refresh_accounts
    • System / Control (5): get_storage_info, restart_jd, get_speed_limit, set_speed_limit, reconnect
    • Captcha — Human-in-the-Loop (3): list_captchas, get_captcha, answer_captcha
    • Config — Generic Settings (3): get_config, list_config, set_config (~2,200 JD settings keys)
    • Cleanup, Update & Diagnostics (8): clear_linkgrabber (auto-backup by default), restore_linkgrabber, clean_downloads, diagnose_queue, recommend, monitor, wait_for_change (token-free server-side polling), update_jd
    • Variants & Organize (5): get_variants, set_variant, rename, move_to_new_package, get_download_urls
    • Extensions (2): list_extensions, set_extension_enabled
    • Dialogs (3): list_dialogs, get_dialog, answer_dialog
    • Basic-Auth & Account Credentials (5): list_basic_auth, add_basic_auth, remove_basic_auth, set_account_credentials, get_premium_hoster_url
    • Escape Hatch (1): raw_action
    • yt-dlp Backend (2): ytdlp_download, smart_download
  • Flexible Connection Modes (MYJD_CONNECT_MODE) — Defaults to relay via My.JDownloader (NAT traversal with end-to-end encryption and automatic LAN upgrade), or direct via JDownloader's local RemoteAPI (127.0.0.1:3128) with no cloud account required.
  • Recoverable Queue Hygiene & Token-Free Monitoring — clear_linkgrabber(backup=True) persists URLs before wiping so restore_linkgrabber can recover them; diagnose_queue + recommend surface actionable fixes; wait_for_change blocks server-side until state signatures change.

Stack

  • Runtime: Python >=3.12
  • MCP Framework: mcp>=1.2,<2 (FastMCP stdio server)
  • JDownloader Integration: myjdapi>=1.1.10, requests>=2.34.2
  • Video / Social Fallback Engine: yt-dlp>=2026.7.4 (plus optional ffmpeg on PATH for audio extraction & stream merging)
  • Build & Test: hatchling, pytest>=9.1.1, pytest-asyncio>=1.4.0
  • License: MIT

Agent lifecycle

JDownloader keeps two separate lists. Understanding this is the key to using the tools correctly:

  1. Linkgrabber — a staging area. add_links / add_container drop URLs here; JD resolves them (checks online/offline, size, host) in the background. Inspect with list_linkgrabber.
  2. Downloads queue — the actual download engine. Nothing downloads until an item is here. Promote resolved linkgrabber items with move_to_downloads, or add with autostart=True / use the download tool to skip straight there. Inspect and poll with list_downloads / status / wait_for.

uuid values returned by any list_* tool are the IDs (package_ids / link_ids) that every other tool expects — there is no other way to get an ID.

Config surface: JD exposes its full ~2,200-key settings tree via get_config / list_config / set_config. Start with list_config(filter=...) to find the interface/key you need, then get_config/set_config on that exact pair. List cleanup: clear_linkgrabber wipes the whole staging list — by default it backs up every link URL first (backup=True), recoverable via restore_linkgrabber(backup_file) — and clean_downloads (what = finished | offline | failed | disabled | all) removes a category of entries from the download queue (files stay on disk). Both are separate from the per-item remove tool. Stuck queue? Call diagnose_queue first — it buckets unfinished links by status/host and surfaces pending captcha/dialog counts in one call. Then call recommend() for a prioritized fix list (offline links, anti-bot/plugin hosts, waiting captchas, stopped-with-pending, low disk, bad accounts). Watching a queue over time? monitor gives the same status/host buckets plus per-download progress/speed/eta for active items — poll it on an interval instead of re-calling diagnose_queue/list_downloads separately. Token-free waiting: instead of calling monitor() on a timer, call wait_for_change (optionally with since = the last snapshot's signature) — it blocks server-side and only returns when the queue actually changes or the timeout elapses, so you don't burn tokens on unchanged snapshots.

  add_links / add_container
          │
          ▼
  ┌────────────────┐   staging area — links resolve here
  │  LINKGRABBER   │     · list_linkgrabber   (watch it resolve)
  └────────────────┘     · remove             (discard a link)
          │
          │ move_to_downloads
          ▼
  ┌────────────────┐   the download engine
  │   DOWNLOADS    │     · control_downloads / force_start / set_priority
  └────────────────┘     · list_downloads / status / wait_for   (poll)
       │        │
       │        └──────── wait_for → failed / stalled ───────┐
       │                                                     ▼
       │                                              ┌────────────┐
       │                                              │   FAILED   │
       │                                              └────────────┘
       │                                              reset  → DOWNLOADS (retry)
       │                                              remove → discarded
       │
       └──────── wait_for → finished ───────┐
                                            ▼
                                     ┌────────────┐
                                     │  FINISHED  │
                                     └────────────┘
                                     remove / get_directories → done

The repo README shows this same lifecycle as a rendered Mermaid diagram — GitHub renders Mermaid in READMEs but not in release notes, so it's drawn as text here.

Polling pattern: list_downloads / status are the workhorses — call them as often as you like. wait_for is a bounded convenience (hard-capped at 120s server-side); for anything longer, loop: call wait_for, and if it returns still_running, call it again. A stalled result means the item is idle with no progress (captcha / reconnect needed / all links offline) — don't re-poll blindly, investigate first (e.g. list_captchas).

"Just download this" (fire and forget)

1. download(urls=[...])              # add + auto-queue + start in one call
2. wait_for(package_id)              # poll until finished/failed/stalled
3. get_directories(package_ids)      # confirm where the files landed

For a fast preflight check without committing to a download, use check_availability(urls) first — it reports online/offline + size and leaves nothing queued.

"Careful lifecycle" (inspect before committing)

1. add_links(urls, package="my-set")
2. list_linkgrabber()                # confirm links resolved online, get uuid
3. move_to_downloads(package_ids=[uuid])
4. force_start(package_ids=[uuid])   # or control_downloads("start")
5. wait_for(package_id=uuid)
6. remove(stage="downloads", package_ids=[uuid])   # cleanup once finished

Backend routing (smart_download)

smart_download(url) is JDownloader-first with an auto-fallback to yt-dlp. Known video/social hosts (tiktok, youtube/youtu.be, x.com/twitter, instagram, facebook/fb.watch, reddit/redd.it, vimeo, twitch, dailymotion, soundcloud, bilibili, streamable, ok.ru, rumble, kick.com, snapchat, pinterest) route straight to ytdlp_download. Everything else (premium hosters, .dlc/.crypt/.rsdf/.ccf containers) is tried on JDownloader's download first; if that link breaks within jd_wait_s seconds (default 45 — offline / error / plugin-outdated / stalled), the failed JD entry is removed and the URL falls back to ytdlp_download. The result carries "routed_to": "jd" when JD handled it, or "routed_to": "jd->ytdlp" plus jd_outcome/jd_reason when a fallback happened. Override with backend='ytdlp'|'jd' to force one engine (strict, no fallback), or call ytdlp_download/download directly to skip the router.


Downloading video / social (yt-dlp)

Use smart_download(url) when you don't want to think about which backend a URL needs — known video/social hosts route straight to yt-dlp per the host list above, and everything else is tried on JDownloader first with an auto-fallback to yt-dlp if the link breaks. Use ytdlp_download(url) directly when you already know it's a yt-dlp site, or want to force yt-dlp regardless of the router's behavior.

# Public video — router picks yt-dlp automatically
smart_download(url="https://www.youtube.com/watch?v=...", audio_only=True)

# Same thing, explicit backend, skipping the router
ytdlp_download(url="https://www.youtube.com/watch?v=...", audio_only=True)

Authenticating for private / login-gated content

Private posts (your own TikTok videos, members-only content) need cookies from a logged-in browser session — pick one:

  • cookies_from_browser='chrome'|'firefox'|'edge'|'brave'|'chromium'|'opera'|'vivaldi' — reads that browser's cookie store directly. On Windows the browser must be closed first — it locks the cookie DB while running.
  • cookies_file='path/to/cookies.txt' — a Netscape-format cookies file exported via a "Get cookies.txt"-style browser extension. Works while the browser stays open.
# Private TikTok video, cookies exported to a file (browser can stay open)
ytdlp_download(
    url="https://www.tiktok.com/@someuser/video/...",
    cookies_file="C:/Users/you/Downloads/cookies.txt",
)

# Same, using the live Chrome cookie store instead (Chrome must be closed first)
smart_download(
    url="https://www.tiktok.com/@someuser/video/...",
    cookies_from_browser="chrome",
)

ffmpeg must be on PATH for audio_only=True (audio extraction) and for merging separate video+audio streams on formats that need it — yt-dlp will otherwise fail or fall back to a lower-quality single-stream format.


Full tool reference (62)

Every tool returns {"ok": true, "result": ...} on success or {"ok": false, "error": "..."} on failure — no tool raises.

Lifecycle (16)

Tool Parameters Description
add_links urls: list[str], package: str | None, destination_folder: str | None, priority: str = "DEFAULT", extract_password: str | None, download_password: str | None, autostart: bool = False Add URLs to the linkgrabber. autostart=True moves them straight to the download queue once resolved. priority: HIGHEST..LOWEST.
add_container container_type: str, content: str Add a link container (container_type: DLC | RSDF | CCF) by its content.
list_linkgrabber — List linkgrabber packages+links (online/offline status) and whether JD is still collecting. Use the uuid fields to act on items.
list_downloads — List download-queue packages with progress_pct, speed, ETA, status, and save path (saveTo). The workhorse for polling.
status — Overall dashboard: state, running/paused, aggregate speed (bytes/s), premium, speed-limit state, bytes downloaded, and update_available.
wait_for package_id: str, timeout_s: int = 60 Bounded poll of one download package (cap 120s). Returns finished / failed / stalled / still_running / not_found — finished/failed/stalled are terminal, re-call only on still_running.
move_to_downloads package_ids: list[str] | None, link_ids: list[str] | None Promote resolved linkgrabber items to the download queue.
control_downloads action: str Global queue control. action: start | stop | pause | resume.
force_start package_ids: list[str] | None, link_ids: list[str] | None Force the given items to download now, bypassing queue/connection limits.
set_priority priority: str, stage: str = "linkgrabber", package_ids: list[str] | None, link_ids: list[str] | None Set priority (HIGHEST..LOWEST) on items in the given stage (linkgrabber | downloads).
set_enabled enabled: bool, stage: str = "downloads", package_ids: list[str] | None, link_ids: list[str] | None Enable/disable items in the given stage (linkgrabber | downloads).
get_directories package_ids: list[str] | None Per-package save paths + the default download folder + extraction settings (extension enabled, custom extract path).
set_download_dir directory: str, package_ids: list[str] Set the download directory for the given download-queue packages.
set_extraction enabled: bool | None, custom_path: str | None Toggle the extraction extension and/or set a custom extract path.
remove stage: str = "downloads", package_ids: list[str] | None, link_ids: list[str] | None, from_disk: bool = False Remove items from a list. from_disk=True (downloads only) also deletes the files from disk.
reset package_ids: list[str] | None, link_ids: list[str] | None Reset download-queue items so they re-download from scratch.

Ergonomic / composite (3)

Tool Parameters Description
download urls: list[str], dest: str | None, package: str | None, priority: str = "DEFAULT" One-shot download: add URLs, auto-move to the queue, start, and return the resulting download package.
check_availability urls: list[str] Check whether URLs are online (and their size) WITHOUT queueing them. Resolves in the linkgrabber, reports per-link availability, then cleans up.
find query: str Find packages by name substring across both lists -> uuid + stage.

Accounts / premium hosters (6)

Tool Parameters Description
list_accounts — List premium/hoster accounts: hostname, username, valid, traffic left, expiry (-1 = unlimited/none), enabled, uuid.
list_premium_hosters filter: str | None, limit: int = 100 List hosters JDownloader supports (optionally filtered by substring).
add_account hoster: str, username: str, password: str Add a premium/hoster account. The password travels through the My.JDownloader relay (end-to-end encrypted) to your JDownloader instance and is never stored by this server.
remove_accounts account_ids: list[str] Remove hoster accounts by uuid. Irreversible.
set_account_enabled enabled: bool, account_ids: list[str] Enable or disable hoster accounts by uuid. Disabling can stop in-flight premium downloads that rely on the account.
refresh_accounts account_ids: list[str] | None Refresh hoster account status/traffic (all accounts if none given).

System / control (5)

Tool Parameters Description
get_storage_info — Free/total disk per drive (with free_gb and used_pct) — check before a large download.
restart_jd — Restart the JDownloader application (recovery).
get_speed_limit — Current download speed-limit state: enabled + limit in bytes/s.
set_speed_limit enabled: bool, bytes_per_sec: int | None Enable/disable the download speed limit and optionally set it (bytes/s).
reconnect — Trigger a router reconnect to get a new IP (resets some hoster limits).

Captcha — human-in-the-loop (3)

Tool Parameters Description
list_captchas — List captchas JDownloader is currently waiting on.
get_captcha captcha_id: str Fetch a pending captcha (image data) for a human to solve.
answer_captcha captcha_id: str, solution: str Submit a human-provided solution for a pending captcha.

Config — generic settings (3)

Tool Parameters Description
get_config interface: str, key: str Read one JDownloader config value. interface is a settings interface name (e.g. org.jdownloader.settings.GeneralSettings); find keys with list_config.
list_config filter: str | None, limit: int = 200 List JD config entries (interface/key/value), optionally filtered by substring. JD exposes ~2200 keys — always pass a filter.
set_config interface: str, key: str, value: str | int | bool Write one JDownloader config value; returns the re-read value.

Cleanup, update & diagnostics (8)

Tool Parameters Description
clear_linkgrabber backup: bool = True Clear the ENTIRE linkgrabber list. With backup=True (default) it first saves every link URL to a backup file, recoverable via restore_linkgrabber.
restore_linkgrabber backup_file: str Re-add links from a backup file written by clear_linkgrabber.
clean_downloads what: str = "finished" Remove a category of links from the download list (files stay on disk): what = finished | offline | failed | disabled | all.
diagnose_queue — One-shot health summary: totals, unfinished links bucketed by status and host, and pending captcha/dialog counts.
recommend — Turn the current queue state into prioritized, actionable fixes (offline links, anti-bot/plugin hosts, waiting captchas, stopped-with-pending, low disk, bad accounts).
monitor — Live monitoring snapshot for polling: overall state + speed, download counts bucketed by category, active-download progress/speed/eta, and blocked hosts.
wait_for_change since: str | None = None, timeout_s: int = 600, poll_s: int = 15 Block server-side until the queue status changes, then return the new monitor snapshot — or {changed: false, timed_out: true} after timeout_s. Pass since = the last signature you saw.
update_jd — Apply an available JDownloader update and restart it. Downloads pause during the restart.

Variants & organize (5)

Tool Parameters Description
get_variants link_id: str List the variants (audio/video/quality) of a multi-variant link.
set_variant link_id: str, variant_id: str Select a variant (from get_variants) for a multi-variant link.
rename new_name: str, package_id: str | None, link_id: str | None Rename a linkgrabber package (package_id) or link (link_id).
move_to_new_package new_name: str, package_ids: list[str] | None, link_ids: list[str] | None, dest: str | None, stage: str = "linkgrabber" Move the given items into a new package named new_name in the given stage.
get_download_urls package_ids: list[str] | None, link_ids: list[str] | None Get the resolved original download URLs for the given linkgrabber items.

Extensions (2)

Tool Parameters Description
list_extensions — List JDownloader extensions (id, name, installed, enabled).
set_extension_enabled extension_id: str, enabled: bool Enable or disable a JDownloader extension by id (from list_extensions).

Dialogs (3)

Tool Parameters Description
list_dialogs — List interactive dialogs JDownloader is currently waiting on.
get_dialog dialog_id: str Fetch a pending dialog's details/options.
answer_dialog dialog_id: str, data: dict Answer a pending dialog with a data payload (shape per the dialog type).

Basic-auth & account credentials (5)

Tool Parameters Description
list_basic_auth — List stored FTP/HTTP basic-auth entries.
add_basic_auth auth_type: str, hostmask: str, username: str, password: str Add an FTP/HTTP basic-auth entry (auth_type: FTP | HTTP). Password travels the My.JDownloader relay (end-to-end encrypted) and is never stored by this server.
remove_basic_auth auth_ids: list[str] Remove FTP/HTTP basic-auth entries by id.
set_account_credentials account_id: str, username: str, password: str Update a hoster account's username/password. Password travels the My.JDownloader relay (end-to-end encrypted) and is never stored by this server.
get_premium_hoster_url hoster: str Get the signup/premium URL for a hoster.

Escape hatch (1)

Tool Parameters Description
raw_action path: str, params: list | None, http_action: str = "POST" Call any JD API endpoint not wrapped above. path like /downloadsV2/setPriority; params is the positional argument list that endpoint expects.

yt-dlp backend (2)

Tool Parameters Description
ytdlp_download url: str, dest: str | None, audio_only: bool = False, cookies_from_browser: str | None, cookies_file: str | None Download a URL directly via yt-dlp (thousands of video/social sites); bypasses JDownloader. For private/login-gated content pass cookies_from_browser (browser must be CLOSED on Windows) or cookies_file (works while the browser is open).
smart_download url: str, dest: str | None, audio_only: bool = False, backend: str | None, cookies_from_browser: str | None, cookies_file: str | None, jd_wait_s: int = 45 Video/social sites -> yt-dlp; everything else tried on JDownloader first, auto-falls-back to yt-dlp if the link breaks within jd_wait_s. Override with backend='ytdlp'|'jd' to force one engine.

16 + 3 + 6 + 5 + 3 + 3 + 8 + 5 + 2 + 3 + 5 + 1 + 2 = 62 tools.