YouTube Search & Download MCP Server
Enables searching for videos and playlists, retrieving detailed metadata including duration and chapters, and downloading video or audio content in multiple formats and qualities.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@YouTube Search & Download MCP Server Search for 'Python tutorial' and download the first video as an mp4"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π What is YouTube Search MCP?
This is a production-quality Model Context Protocol (MCP) server that allows you to search, get information about, and download YouTube videos and audio without needing a YouTube API key. It's designed to work seamlessly with MCP clients like Claude Desktop and Cursor.
The server is built with / for robust backend operations and FastMCP for a high-performance server framework.
Related MCP server: MCP YouTube-DLP
β¨ Key Features
No API Key Required: Search and download freely using
yt-dlp.Easy Installation: Simple setup with
uvorpip. Works seamlessly with MCP clients.Video & Audio Downloads: Download content in various formats (
mp4,mkv,mp3,wav, etc.) and qualities.Playlist Support: Search for playlists, get playlist details, and retrieve all videos from any playlist.
Rich Metadata: Get detailed video information, including duration, view count, and chapters.
Client Compatibility: Works great with Claude, Cursor, and other MCP-compliant clients.
Robust & Type-Safe: Built on a SOLID architecture with full type safety using Pydantic.
π Getting Started (For Users)
Prerequisites
Python 3.10 or higher
uv (recommended) or
pipFFmpeg (must be installed and available in your system's PATH)
Windows:
choco install ffmpeg(with Chocolatey) or download from gyan.dev/ffmpegmacOS:
brew install ffmpegLinux:
sudo apt install ffmpeg(Ubuntu/Debian) orsudo dnf install ffmpeg(Fedora)
Installation
Install the package using uv (recommended) or pip:
# Using uv (recommended)
uv pip install youtube-search-mcp
# Or using pip
pip install youtube-search-mcpRunning the Server
After installation, you can run the server directly:
youtube-search-mcpπ» Client Configuration
Configure your MCP client to connect to the server.
For Claude Desktop or Cursor:
Add this to your MCP client configuration (usually claude_desktop_config.json):
{
"mcpServers": {
"youtube-search": {
"command": "youtube-search-mcp"
}
}
}Or if using uvx (no installation required):
{
"mcpServers": {
"youtube-search": {
"command": "uvx",
"args": ["youtube-search-mcp"]
}
}
}π§ Configuration
You can customize the server's behavior by setting environment variables. These can be added to your MCP client configuration (e.g., claude_desktop_config.json) or set via a .env file in the project root.
Variable | Description | Default |
| Directory where videos/audio will be saved |
|
| Default video quality ( |
|
| Number of search results to return by default |
|
| Logging level ( |
|
π οΈ For Developers & Contributors
Interested in contributing? Hereβs how to set up your development environment.
Prerequisites
Git
Python 3.10+
uv (recommended) or
pipFFmpeg (must be installed and available in your system's PATH for development)
Windows:
choco install ffmpeg(with Chocolatey) or download from gyan.dev/ffmpegmacOS:
brew install ffmpegLinux:
sudo apt install ffmpeg(Ubuntu/Debian) orsudo dnf install ffmpeg(Fedora)
Setup
Clone the Repository
git clone https://github.com/easyhak/youtube-search-mcp.git cd youtube-search-mcpInstall Dependencies Using
uv(recommended):uv syncUsing
pip:python -m venv .venv # Activate the virtual environment # Windows: .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate pip install -e ".[dev]"Run the Server Using
uv:uv run python -m youtube_search_mcp.mainOr with activated virtual environment:
python -m youtube_search_mcp.main
Code Quality & Testing
Format Code:
uv run black .Lint Code:
uv run ruff check .Type Check:
uv run mypy .Run Tests:
uv run pytest
π€ Contributing
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
Please refer to the Contributing Guidelines for more details.
π License
Distributed under the MIT License. See LICENSE for more information.
Available Tools
8 toolsdownload_audioA
Download audio only from a YouTube video.
Args: video_id: YouTube video ID (11 characters) quality: Audio quality preset - "best", "high" (320kbps), "medium" (192kbps), "low" (128kbps) output_dir: Download directory path (uses config default if not specified) format: Output format - "mp3", "m4a", "opus", "wav" (default: "mp3")
Returns: JSON with download status, file path, file size, and metadata
Example: download_audio("dQw4w9WgXcQ", quality="high", format="mp3")
Inputs: video_id (required), quality, output_dir, format. Returns: result
download_videoA
Download a YouTube video with configurable quality.
Args: video_id: YouTube video ID (11 characters) quality: Quality preset - "best", "high" (1080p), "medium" (720p), "low" (480p) output_dir: Download directory path (uses config default if not specified) format: Output format - "mp4", "webm", "mkv" (default: "mp4")
Returns: JSON with download status, file path, file size, and metadata
Example: download_video("dQw4w9WgXcQ", quality="high", format="mp4")
Inputs: video_id (required), quality, output_dir, format. Returns: result
get_playlist_infoA
Get detailed information about a specific YouTube playlist.
Args: playlist_id: YouTube playlist ID (e.g., "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf") output_format: Output format - "json" or "markdown" (default: "json")
Returns: Detailed playlist information including title, creator, video count, and description
Example: get_playlist_info("PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf", output_format="markdown")
Inputs: playlist_id (required), output_format. Returns: result
get_playlist_videosB
Get list of videos from a YouTube playlist.
Args: playlist_id: YouTube playlist ID (e.g., "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf") max_results: Maximum number of videos to return (None for all videos, default: None) output_format: Output format - "json" or "markdown" (default: "json")
Returns: List of videos in the playlist with metadata
Example: get_playlist_videos("PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf", max_results=20)
Inputs: playlist_id (required), max_results, output_format. Returns: result
get_video_infoA
Get detailed information about a specific YouTube video.
Args: video_id: YouTube video ID (11 characters, e.g., "dQw4w9WgXcQ") output_format: Output format - "json" or "markdown" (default: "json")
Returns: Detailed video information including description, tags, and statistics
Example: get_video_info("dQw4w9WgXcQ", output_format="markdown")
Inputs: video_id (required), output_format. Returns: result
search_playlistsA
Search YouTube for playlists matching a query.
Args: query: Search query string (e.g., "python tutorial playlist") max_results: Maximum number of results to return (1-50, default: 10) output_format: Output format - "json" or "markdown" (default: "json")
Returns: Formatted search results with playlist metadata
Example: search_playlists("machine learning course", max_results=5, output_format="json")
Inputs: query (required), max_results, output_format. Returns: result
search_videosB
Search YouTube for videos matching a query.
Inputs: query (required), max_results, output_format. Returns: result
validate_providerB
Validate that the YouTube search provider is working correctly.
Returns: JSON with validation status and provider information
Example: validate_provider()
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no overlap: download_audio and download_video handle different media types, get_video_info and get_playlist_info retrieve metadata for different entities, search_videos and search_playlists search different content types, get_playlist_videos lists videos within playlists, and validate_provider is a utility tool. The boundaries are well-defined and unambiguous.
All tools follow a consistent verb_noun naming pattern using snake_case, with clear and descriptive names (e.g., download_audio, get_video_info, search_playlists). There are no deviations in style or convention, making the set predictable and easy to understand.
With 8 tools, the count is well-scoped for a YouTube search and download server. It covers core functionalities like downloading (audio/video), retrieving metadata (video/playlist), searching (videos/playlists), and utility (validation), without being excessive or insufficient for the domain.
The tool set provides strong coverage for search, metadata retrieval, and downloading of videos and playlists, with no major gaps for basic operations. However, it lacks tools for updating or managing downloads (e.g., cancel_download, list_downloads) and advanced features like channel operations, which are minor omissions that agents can work around.
Maintenance
Related MCP Connectors
YouTube transcripts, search, channel browsing, and playlists for AI agents via MCP.
SubDownload exposes YouTube as an MCP-native data source. Connect via OAuth and your AI agent can summarize videos, fetch full transcripts (even for videos with no captions, via AI ASR), search across channels, and save everything into a private knowledge base. Works with Claude, ChatGPT, Cursor, and 40+ MCP clients. Free credits on signup, no card required.
Download YouTube videos and clips as MP4 or MP3/AAC, and look up video metadata.
Real-time YouTube transcripts, comments, channels & video search MCP. Local npx or hosted OAuth.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables YouTube content browsing, video searching, and metadata retrieval via the YouTube Data API v3. It also facilitates fetching video transcripts for summarization and analysis within MCP-compatible AI clients.730 npm1MIT
- FlicenseNot gradedqualityDmaintenanceProvides tools for downloading YouTube videos and audio using yt-dlp, enabling integration with AI assistants via MCP.5-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to fetch transcripts, metadata, and download videos/audio from YouTube without API keys.33MIT
- AlicenseNot gradedqualityDmaintenanceAllows Claude or any MCP-compatible AI agent to download YouTube videos directly to your computer's Downloads folder.2MIT