yt-dlp-mcp
Verified Safeby kevinwatt
Overview
Integrate video platform capabilities like search, metadata extraction, and content download into AI agents using yt-dlp.
Installation
npx -y @kevinwatt/yt-dlp-mcp@latestEnvironment Variables
- YTDLP_MAX_FILENAME_LENGTH
- YTDLP_DOWNLOADS_DIR
- YTDLP_TEMP_DIR_PREFIX
- YTDLP_SANITIZE_REPLACE_CHAR
- YTDLP_SANITIZE_TRUNCATE_SUFFIX
- YTDLP_SANITIZE_ILLEGAL_CHARS
- YTDLP_SANITIZE_RESERVED_NAMES
- YTDLP_DEFAULT_RESOLUTION
- YTDLP_DEFAULT_AUDIO_FORMAT
- YTDLP_DEFAULT_SUBTITLE_LANG
- YTDLP_CHARACTER_LIMIT
- YTDLP_MAX_TRANSCRIPT_LENGTH
- YTDLP_COOKIES_FILE
- YTDLP_COOKIES_FROM_BROWSER
Security Notes
The server primarily acts as a wrapper around the `yt-dlp` command-line tool, executed via `_spawnPromise`. Critical security measures include robust URL validation (`validateUrl`), input sanitization (`sanitizeFilename` for file paths, `encodeURIComponent` for search queries), and comprehensive Zod schema validation for all tool inputs (as highlighted in the changelog for v0.7.0), which significantly mitigates command injection risks. Sensitive cookie information is handled through environment variables, with validation for file paths and browser names, and a clear priority system (file over browser). Automatic response truncation (`characterLimit`, `maxTranscriptLength`) is implemented to prevent context overflow in LLMs. The `_spawnPromise` includes error handling for spawning failures. While reliance on an external executable (`yt-dlp`) always introduces a dependency risk, the explicit input validation and sanitization efforts make this server reasonably secure for its intended purpose.
Similar Servers
mcp-youtube
Empowers AI language models to retrieve token-optimized, structured YouTube data for video search, detail retrieval, transcript fetching, channel analysis, and trend discovery.
media-downloader
The primary use case is to download videos and audio from various online sources, and it functions as an MCP server and an A2A agent for integration into agentic frameworks.
lyra-tool-discovery
This MCP server is designed to fetch, parse, and organize documentation from websites implementing the llms.txt standard. It transforms raw documentation into structured, agent-ready formats, exposing tools for AI agents, LLMs, and automation workflows to consume documentation programmatically.
fetch-mcp
Serves as an MCP server to fetch URLs and YouTube video transcripts efficiently.