YTDL RMCP
ai.dinglebear由 dinglebear.ai 发布v1.0.2更新于 Oct 24, 2026
Rust MCP server and CLI for yt-dlp search, downloads, metadata, transfers, and Plex playlists.
发布方自己的服务:RMCP
概览
本地运行的 Rust MCP 服务器,让助手搜索 YouTube、用 yt-dlp 下载音视频、写入标签并传输媒体,以及同步 Plex 播放列表。
- 可以做什么
- 搜索 YouTube 并提供可交互的搜索界面,返回结果链接而不下载媒体;只读探测标题、时长、上传者和格式数量。从一个或多个链接下载音频、视频或两者,可设置格式、音质、分辨率和容器。写入音频元数据标签,通过 AcoustID/MusicBrainz 指纹识别本地文件,并可选地把高置信度标签写回文件。把结果传输到本地、SSH 或 rclone 目标,维护可重复安全的下载记录,并从队列重试失败的传输。根据成功下载历史构建或预览 Plex 音频播放列表,并汇总下载统计。
- 适用场景
- 适合个人媒体库工作流:希望助手查找 YouTube 媒体、下载到可信目标、写入标签并保持 Plex 播放列表同步。只读的搜索和探测路径可以先试用;下载和写标签路径面向可信调用方。
- 运行要求
- 通过 stdio 本地运行,通常用 npx 和 Node.js 启动。首次运行会自动下载 yt-dlp 和 ffmpeg。下载需要 YTDLP_TARGET_PATH(可选 YTDLP_VIDEO_TARGET_PATH);本地目标还需 YTDLP_ALLOW_LOCAL_TARGETS。SSH 目标需要基于密钥的 ssh,可选 rsync;rclone 目标需要已配置的 rclone 远程。Plex 同步需要 YTDLP_PLEX_URL 和 YTDLP_PLEX_TOKEN;识别需要 YTDLP_ACOUSTID_CLIENT_KEY 和 fpcalc。
安装
在 SourceWeft 中
- 打开 控制台中的 YTDL RMCP,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
ytdl-rmcp
yt-dlp search, download, metadata, delivery, and Plex workflows over MCP and CLI.
Written in Rust on the rmcp crate. yt-dlp
and ffmpeg are auto-downloaded into a per-user cache on first run, so the host
needs neither pre-installed — the one binary is the whole install.
30-second path: npx -y @dinglebear/rytdl setup -> configure a target path ->
call youtube_search or youtube_probe; use youtube_download only after the
destination and trust boundary are clear.
Status: production personal-media MCP server. Read-only search/probe/stats paths are safe; download, playlist, queue-drain, and tag-writing paths create or move state and are intended for trusted callers.
Not for: a generic web-downloader SaaS, a multi-tenant media ingestion boundary, a replacement for yt-dlp's upstream site handling, or an arbitrary filesystem writer for untrusted MCP callers.
Contents
- Naming
- Capabilities And Boundaries
- Install
- Quickstart
- Client Configuration
- Runtime Surfaces
- MCP Tool Reference
- CLI Reference
- Configuration
- Authentication
- Safety And Trust Model
- Architecture
- Distribution Contract
- Development
- Verification
- Deployment
- Troubleshooting
- Related Servers
- Documentation
- License
Naming
The crate and npm package use the *-rmcp family naming pattern, while the
repository and runtime binary are rytdl so local shells get a short
Rust-native command.
Capabilities And Boundaries
- Searches YouTube through yt-dlp without downloading media.
- Downloads audio, video, or both into a staging tree, tags audio metadata, and transfers the result to local, SSH, or rclone destinations.
- Optionally fingerprints audio through AcoustID/MusicBrainz and syncs completed audio downloads into a Plex playlist.
- Builds Plex playlists from successful transfer history and drains server-made retained-staging transfer manifests.
- Exposes an MCP App search UI for hosts that can render embedded widgets.
- Keeps a JSONL ledger for repeat-safe downloads and stats.
Features
- Audio, video, or both — audio-first by default, with separate targets for audio and video.
- Proper tagging — embeds title / artist / album / date and cover art, and
organizes output as
Artist/Title [id].extso media servers (Plex, etc.) index it cleanly. A non-greedyArtist - Titleparse recovers the artist from free-form video titles. Source.info.json, thumbnail, and description sidecars are preserved next to the media for future retagging/indexing. Common YouTube title noise like(Official Video),[Official Audio], and trailing channel handles is stripped from embedded title metadata by default. - Self-contained paths — the binary downloads/caches yt-dlp + ffmpeg when run directly; the container image bakes in ffmpeg, fpcalc, SSH, and rsync for media-host batch jobs.
- Self-installing —
ytdl-rmcp setupregisters the server into Claude Code, Codex, and/or Gemini CLI via each tool's ownmcp add. - Robust transfers — local paths (
/path) are copied in-process by the binary itself, SSH targets (host:/path) usersync -a --partial --protect-argswith anscpfallback whenrsyncis missing, and rclone targets (remote:pathorrclone:remote:/path) userclone copy. On transfer failure the local staging copy is kept for retry and recorded as a drainable manifest foryoutube_transfer_queue. - Repeat-safe —
use_archiverecords downloaded IDs (per mode) and skips them on later runs; YouTube mix/radio URLs are auto-cleaned to the seed video. - Stats-ready ledger — every completed download call appends a JSONL entry with timestamp, destinations, files, bytes, uploader, and transfer status.
- Plex playlist sync — when Plex credentials are configured, downloaded
audio is added to
yt-dlp Downloadsby default.
MCP Tool Reference
youtube_download parameters
When Plex credentials are configured, successful downloads that produced audio
files search Plex for each downloaded track, create the target playlist if
needed, and add missing tracks while skipping entries already present. The
default playlist is yt-dlp Downloads; set YTDLP_PLEX_PLAYLIST or pass
plex_playlist to override it. Plex errors are reported as
plex_playlist_error and do not make the completed download fail. JSON
responses include a plex_playlist summary with matched, added,
already_present, and missing counts.
Canonical metadata matching through MusicBrainz/AcoustID is documented in
docs/musicbrainz-acoustid.md. youtube_download automatically runs
high-confidence MusicBrainz retagging for downloaded audio when
YTDLP_ACOUSTID_CLIENT_KEY is configured; youtube_identify remains available
for previewing or repairing existing library files, with manual tag writes
enabled by write_tags=true.
youtube_download JSON response
With response_format=json, the call returns a single object describing the
batch:
Each items[].status is one of:
ok— succeeded with files.partial— an error occurred but some files were still produced.failed— errored with no files.skipped— nothing new (already in the archive).
Optional keys are attached only when the relevant stage ran:
metadata_retag— MusicBrainz/AcoustID auto-retag summary (attempted,matched,written,skipped,errors, or anerrorstring); present whenYTDLP_ACOUSTID_CLIENT_KEYis configured.plex_playlist— Plex playlist summary (playlist,matched,added,already_present,missing);plex_playlist_erroris set instead if the Plex update failed (a Plex failure does not fail the download).history_error— set when the download succeeded but the JSONL ledger append failed.
youtube_probe takes urls and response_format.
youtube_plex_playlist
Build or preview Plex audio playlists from successful ytdl-rmcp download history.
Actions:
Candidates are history-derived and audio-only. Failed or retained-staging transfers are intentionally excluded.
apply can return plexamp_url, plex_web_url, and
playback_link_status. plexamp_url is a best-effort generated
listen.plex.tv playback link, not an official Plexamp API guarantee. The
regular Plex playlist API calls use the official Plex Media Server API.
youtube_transfer_queue
List and drain server-created transfer failure manifests.
Actions:
The queue never accepts arbitrary filesystem paths. Retry uses the original target paths recorded at failure time and re-checks local target policy before transfer. Manifests are created by the local server when a transfer fails while the staging directory, manifest ID, file list, and original targets still match.
youtube_identify parameters
youtube_identify runs Chromaprint fpcalc, sends the fingerprint to AcoustID,
and returns MusicBrainz recording candidates. When the best candidate is
high-confidence, it also fetches the MusicBrainz recording/release data and
includes a retag_preview showing the canonical artist, title, release, release
date, release type, track number, and MusicBrainz IDs. By default it is
preview-only. With write_tags=true, it writes the preview to the file with
Lofty, including common title/artist/album/date/track fields plus MusicBrainz
recording, release, release-group, and release-type tags. It requires
YTDLP_ACOUSTID_CLIENT_KEY; set FPCALC_PATH if fpcalc is not on PATH.
youtube_search parameters
youtube_search_ui accepts the same input and returns the same search payload,
plus MCP App metadata for hosts that can render the embedded UI. Hosts without
app rendering still receive the normal search result text and structured data.
MCP App pattern
youtube_search_ui is the widget-backed entry point for this repo:
- The tool descriptor advertises
_meta.ui.resourceUri. - The server exposes
ui://ytdl-rmcp/youtube-search.htmlthroughresources/listandresources/read. - The resource uses
text/html;profile=mcp-appand an explicit CSP metadata block. .mcpb/.dxtpackaging installs the local server; UI resources are still advertised through the MCP tools/resources protocol and are host-rendered.
youtube_stats parameters
JSON stats include total_downloads, total_files, total_bytes,
skipped_entries, by_kind, by_uploader, and recent. Bucket fields include
downloads (compatibility alias for call count), calls, items, files,
bytes, and human-readable size. Malformed ledger lines are skipped and
counted instead of failing the whole stats call. If a download succeeds but the
ledger append fails, the download response still succeeds and includes
history_error in JSON output.
CLI Reference
The CLI owns process setup and diagnostics; media operations are exposed as MCP tools.
The npm launcher exposes the same binary:
Install
Run the guided installer through npm:
Or install the command globally:
The npm package downloads the matching GitHub Release binary during
postinstall; the installed command is the Rust binary served through a tiny
Node launcher. You can also use the one-line installer:
Or download the binary tarball for your platform from Releases, or build it (see below). The guided setup fetches yt-dlp + ffmpeg, prompts for your audio/video target paths, detects which agent CLIs are present, and registers the server into the ones you pick.
Quickstart
After setup, prove the read-only path first:
For raw MCP clients, call a read-only tool with JSON-RPC tools/call:
Then probe a known URL before downloading:
Use youtube_download only after YTDLP_TARGET_PATH or
YTDLP_VIDEO_TARGET_PATH points at a destination you are comfortable letting
trusted MCP callers write into.
Client Configuration
Run without subcommands, npx -y @dinglebear/rytdl serves MCP over stdio. Register it
yourself:
If you already installed a standalone binary with npm i -g @dinglebear/rytdl,
scripts/install.sh, or a release tarball, you can use that binary path in
place of npx -y @dinglebear/rytdl.
For raw MCP JSON configs, include the required target path env var and the YouTube extractor override:
The checked-in .mcp.json is also a complete raw MCP profile: it declares the
same user_config keys used by the plugin/bundle manifests, supplies defaults
for local gateway imports, and maps every setting into the server environment.
For reliable YouTube search/probe behavior it defaults
YTDLP_EXTRACTOR_ARGS to youtube:player_client=android; official music-video
results frequently reject yt-dlp's default YouTube clients during metadata
extraction.
Runtime Surfaces
Distribution Contract
- npm launcher —
npx -y @dinglebear/rytdldownloads and runs the matching GitHub Release binary. Run without subcommands, it serves MCP over stdio;npx -y @dinglebear/rytdl setupruns the guided installer. Stable releases publish the package from GitHub Actions with npm provenance. - Claude Code plugin —
.claude-plugin/plugin.jsonprompts for config viauserConfig;.mcp.jsonlaunchesnpx -y @dinglebear/rytdl, which downloads the matching GitHub Release binary through npm. - Gemini CLI extension —
gemini-extension.json; install withgemini extensions install https://github.com/dinglebear-ai/rytdl. MCP clients should prefer the npm launcher command,npx -y @dinglebear/rytdl. - Container image —
ghcr.io/dinglebear-ai/rytdl:mainis published on every push tomain, or build locally withdocker build -t ytdl-rmcp:local .. It includesffmpeg,fpcalc,openssh-client,rclone, andrsync. Seedocs/container.mdfor MCP and mounted-library examples. - MCP bundle (
.mcpb/.dxt) —mcpb/manifest.jsondefines abinary-type bundle for one-click install in MCPB-capable desktop hosts. Every main release publishesytdl-rmcp.mcpbplus a legacyytdl-rmcp.dxtalias; both contain the same linux + windows binaries. The bundle defaults optional config values to empty strings so Claude Desktop can install it before you fill in the destination settings. Configure at least the target path in the extension settings before downloading. Build one locally from prebuilt binaries withscripts/build-mcpb.sh(needs Node for the@anthropic-ai/mcpbCLI).
Configuration
Only one value is required for downloads: YTDLP_TARGET_PATH.
YTDLP_VIDEO_TARGET_PATH is required only when video files should land
somewhere different from audio. youtube_search, youtube_probe, and
youtube_identify do not need a destination. The install manifests default
YTDLP_EXTRACTOR_ARGS to youtube:player_client=android because that client
survives common YouTube metadata blocks that make official music-video search
results look unavailable.
Target path forms:
/path/to/library— local directory. Copied by the binary's own filesystem copy (no external tool); a destination nested inside the staging source is rejected. RequiresYTDLP_ALLOW_LOCAL_TARGETS=truebecause local paths let MCP callers choose write locations.host:/path/to/library— SSH target. Uses the existing rsync/scp flow and honorsYTDLP_SSH_OPTS.remote:path/to/library— rclone target with a relative remote path. Usesrclone copy;rclonemust be configured onPATHfor the server process.rclone:remote:/path/to/library— explicit rclone target for an absolute remote path; without therclone:prefix,host:/pathremains SSH by design.
Maintainers: this table is maintained by hand.
scripts/check-packaging.shcross-checks the machine-readable config surfaces (the Claude plugin,.mcp.jsonuser_config,gemini-extension.json, andmcpb/manifest.json) and verifies this README mentions every mapped env var name. It does not compare README descriptions or defaults. When you add, rename, or remove aYTDLP_*,FFMPEG_*,FPCALC_PATH, orYTDLP_LOGenv var, update this table manually.
Authentication
This server speaks stdio only — it opens no network listener, binds no port, and has no HTTP auth layer. Access is whatever the local MCP client grants to the process it launches. External credentials live in operator-controlled environment variables, local config, SSH agents, rclone config, or Plex/AcoustID variables.
MCP callers never provide Plex tokens, SSH keys, rclone credentials, hash pins, or downloader binary paths in tool arguments. Tool arguments carry media URLs, search/probe inputs, output mode choices, and destination selectors that are validated against the process configuration.
Safety And Trust Model
Bootstrap trust model
By default, first run resolves tools in this order: explicit env override,
PATH, cache, then HTTPS download from the upstream release source. Set
YTDLP_SHA256 and/or FFMPEG_SHA256 to require an exact executable digest
after resolution or download. These pins verify bytes on disk, but they do not
fetch upstream signatures or automatically discover trusted digests; operators
who need a fully pinned supply chain should provide known-good binaries through
YTDLP_PATH / FFMPEG_PATH plus matching SHA-256 pins, or disable yt-dlp
auto-update.
For stricter bootstrap control, combine YTDLP_PATH / FFMPEG_PATH with
matching YTDLP_SHA256 / FFMPEG_SHA256 pins. Hash pins verify the resolved
executable bytes; they are not upstream signature verification.
Security posture
This server is designed to run with trusted callers and operator-supplied config — it is not a hardened multi-tenant boundary.
- Tool-call URLs reach yt-dlp. Whatever
urlsan MCP caller passes are handed to yt-dlp, a powerful extraction tool. Only point callers at it that you trust. Tool-call URLs are validated ashttp/httpsbefore they reach yt-dlp, and every positional is passed after a--end-of-options separator so a--prefixed value can't be parsed as a flag; the trust assumption above still holds regardless. - SSH is key-only and non-interactive. SSH targets force
BatchMode=yesandStrictHostKeyChecking=accept-new, so a TTY-less server fails fast instead of prompting; there is no password auth. Auth comes from your SSH key/agent and any options you add viaYTDLP_SSH_OPTS. - Target paths are validated. Local and SSH paths must be absolute and may
not contain traversal or control characters. SSH remotes also reject
option-like and whitespace/control-bearing values before anything reaches
ssh/rsync/scp; remote paths are single-quote-escaped for the remote shell. Rclone targets must beremote:pathor explicitrclone:remote:/pathand reject control characters.
Requirements
- rsync is recommended for SSH transfers and falls back to scp when absent. Local transfers need no external tool — the binary copies the tree itself.
- ssh plus passwordless key-based auth when using
host:/pathtargets. - rclone plus a configured rclone remote when using
remote:pathorrclone:remote:/pathtargets. - yt-dlp and ffmpeg are fetched automatically (override with
YTDLP_PATH/FFMPEG_PATH, or just have them onPATH). youtube_identifyadditionally needsfpcalc; the container image includes it vialibchromaprint-tools.
Development
Build and test from source:
On devhost/local shells, ~/.local/bin/cargo is a wrapper that can break
cargo xwin; use the real rustup cargo for local Windows rehearsals:
CI (.github/workflows/) runs fmt + clippy + tests and a Windows cross-build on
every push/PR, and publishes both binaries to a GitHub Release on v* tags.
This single-crate workspace uses Rust edition 2024 with MSRV 1.97.1.
Verification
Use these checks before releasing README, package, or runtime changes:
For a live MCP smoke, register with a temporary config and call
youtube_search or youtube_probe before running youtube_download.
Architecture
Bare invocation serves MCP over stdio; setup runs the installer. A
youtube_download call:
- Resolves yt-dlp + ffmpeg (env override → PATH → cache → download) and verifies SHA-256 pins when configured.
- Cleans mix/radio URLs, then runs yt-dlp per mode into a staging tree
(
staging/audio,staging/video) with metadata/thumbnail/archive flags, source metadata sidecars, and theArtist/Title [id]output template. - (optional) When
YTDLP_ACOUSTID_CLIENT_KEYis set, fingerprints the downloaded audio and writes high-confidence MusicBrainz/AcoustID tags in-place — before transfer, so the target copy carries the canonical tags. - Transfers each kind's subtree to its target: local in-process copy, SSH
rsync/scp, or
rclone copy. - (optional) When Plex credentials are configured and the transfer succeeded, adds the downloaded audio tracks to the target Plex playlist.
- Appends the completed call to the JSONL download ledger.
- Returns a markdown or JSON summary listing files, sizes, and the actual destination(s).
See CLAUDE.md for architecture, conventions, and gotchas.
Deployment
- Local clients should use
npx -y @dinglebear/rytdlor the installedrytdlbinary over stdio. - Shared runtime jobs can use the container image when ffmpeg, fpcalc, SSH, rclone, and rsync should be present without host-level installs.
- Host deployments should set destination, Plex, AcoustID, SSH, and rclone credentials in process env or host config before exposing the MCP server to callers.
- Keep
YTDLP_ALLOW_LOCAL_TARGETS=0unless trusted callers are allowed to write to local filesystem paths selected through tool arguments.
Troubleshooting
- YouTube metadata looks unavailable: set
YTDLP_EXTRACTOR_ARGS=youtube:player_client=androidor use the checked-in client/plugin configs, which already default it. - Downloads succeed but transfers fail: inspect
staging_kept_ator theyoutube_transfer_queuelist, then retry after fixing SSH, rclone, or local target permissions. - Plex playlist updates are missing: confirm
YTDLP_PLEX_URL,YTDLP_PLEX_TOKEN, and that Plex can see the transferred files. - Tool bootstrap is too loose for your environment: pin
YTDLP_PATHandFFMPEG_PATHwith matching SHA-256 variables, or disable yt-dlp auto-update.
Related Servers
- soma - RMCP runtime for provider-backed MCP servers.
- unifi-rmcp - UniFi controller REST API bridge.
- tailscale-rmcp - Tailscale API bridge for devices, users, and tailnet operations.
- unraid - Unraid GraphQL bridge for NAS and server management.
- apprise-rmcp - Apprise notification fan-out bridge for many delivery backends.
- gotify-rmcp - Gotify push notification bridge for sends, messages, apps, and clients.
- arcane-rmcp - Arcane Docker management bridge for containers and related resources.
- yarr - Media-stack bridge for Sonarr, Radarr, Prowlarr, Plex, and related services.
- synapse-rmcp - Local Synapse workflow server for scout and flux actions.
- cortex - Syslog and homelab log aggregation MCP server.
- axon - RAG, crawl, scrape, extract, and semantic search project.
- labby - Homelab control plane and MCP gateway project.
- lumen - Local semantic code search MCP server.
Documentation
This README is the curated operator entry point. The generated or
machine-readable source of truth lives in the package, plugin, and bundle
manifests that scripts/check-packaging.sh cross-checks.
License
Original Dinglebear-authored portions of this project are licensed under AGPL-3.0-only. Separate commercial licensing is available for organizations that need terms outside the AGPL. Third-party material remains under its original license. See LICENSING.md.
Rust MCP naming pattern
This repo follows the Rust MCP server naming convention:
- Repo:
dinglebear-ai/rytdl - Cargo crate:
ytdl-rmcp - CLI alias:
rytdl - npm package:
@dinglebear/rytdl
来源:README.md,提交 12c47c0
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Rmcp 集成
RMCP
dev.rmcp官方发布者
一个远程 MCP 目录服务器,让助手搜索已收录的 MCP 服务器与工具、查看其记录和端点,并比较候选方案。
Unraid RMCP
ai.dinglebear
本地 MCP 服务器兼 CLI,让助手通过 Unraid 的 GraphQL API 处理 NAS、Docker、虚拟机和存储相关任务。
Unraid RMCP
ai.dinglebear
本地运行的 Rust MCP 服务器兼命令行工具,让助手通过 Unraid 的 GraphQL API 查询和管理 NAS,涵盖阵列、Docker、虚拟机和存储。
UniFi RMCP
ai.dinglebear
本地 MCP 服务器兼 CLI,让助手读取 UniFi Network 控制器的客户端、设备、WLAN 和健康状态,并在具备管理员权限时执行变更操作。
Tailscale RMCP
ai.dinglebear
让助手查看和管理 Tailscale 网络:列出设备、路由、密钥、ACL、DNS 和用户,授权设备,并可选地删除设备。