Back to Home
kevinwatt icon

yt-dlp-mcp

Verified Safe

by kevinwatt

Overview

Integrate video platform capabilities like search, metadata extraction, and content download into AI agents using yt-dlp.

Installation

Run Command
npx -y @kevinwatt/yt-dlp-mcp@latest

Environment 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

Stats

Interest Score53
Security Score8
Cost ClassMedium
Avg Tokens5000
Stars204
Forks45
Last Update2026-01-04

Tags

video downloadmetadata extractiontranscriptsAI agentsMCP