A Model Context Protocol (MCP) server that provides tools for downloading YouTube videos and audio using yt-dlp.
- Download YouTube videos in MP4 format
- Download YouTube audio in MP3 format
- Integration with MCP for AI assistant integration
- Python 3.13 or higher
- yt-dlp installed on your system
- Clone this repository
- Install dependencies:
pip install -e .Or using uv:
uv pip install -e .Start the MCP server:
python main.pyThe server will start in stdio mode with debug enabled.
YT_DLP_PATH: Path to the yt-dlp executable (default:/usr/local/bin/yt-dlp)DEFAULT_DOWNLOAD_DIR: Directory where videos will be downloaded (default:~/Downloads/youtube_downloads)
Add this configuration to your MCP setup:
{
"mcpServers": {
"mcp_youtube_dlp": {
"command": "uvx",
"args": [
"mcp[cli]",
"run",
"<install path>/mcp_youtube_dlp/main.py"
],
"env": {
"YT_DLP_PATH": "/usr/local/bin/yt-dlp",
"DEFAULT_DOWNLOAD_DIR": "~/Downloads/youtube_downloads"
}
}
}
}Replace <install path> with the actual path where you installed this package.
Downloads a YouTube video in MP4 format.
Parameters:
url: The YouTube video URL
Returns:
- A success or error message
Downloads a YouTube video's audio in MP3 format.
Parameters:
url: The YouTube video URL
Returns:
- A success or error message
This server implements the Model Context Protocol, allowing AI assistants to access tools for downloading YouTube content. The server can be connected to any MCP-compatible client.
This project is licensed under the GNU General Public License, version 2 (GPL-2.0) - see the GNU website for details.