YT-NINJA
Supports audio-only playback using ffplay and media processing capabilities for YouTube video content.
Powers AI-driven video analysis features including automated summarization, chapter generation, keyword extraction, topic detection, and highlight generation for YouTube content.
Enables playback of YouTube videos through VLC media player as an alternative to browser-based playback.
Provides comprehensive YouTube video analysis, playback control, data retrieval (video info, playlists, channels, search), transcript management with translation, and AI-powered content processing including summaries, chapters, keywords, topics, and highlights.
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., "@YT-NINJA summarize the key points from this video about AI advancements"
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.
YT-NINJA š„·
A comprehensive YouTube MCP (Model Context Protocol) server that provides AI-powered video analysis, playback control, transcript management, and advanced content processing capabilities.
Features
š¬ Video Playback
Play videos in browser or VLC player
Audio-only playback with ffplay
Video segment playback with timestamp control
Active playback session management
š Data Retrieval
Get detailed video information (title, views, likes, duration, etc.)
Fetch playlist details with all videos
Retrieve channel information and statistics
Search YouTube videos and music
Download video thumbnails in multiple qualities
š Transcript Management
Get official video transcripts
AI-powered transcript generation (when official unavailable)
Translate transcripts to any language
Format transcripts with or without timestamps
š¤ AI-Powered Analysis
Generate video summaries with key points
Auto-generate chapter markers
Extract relevant keywords with relevance scores
Detect topics and categories
Create AI-powered video highlights
Related MCP server: youtube-mcp
Installation
Prerequisites
Node.js >= 18.0.0
npm >= 9.0.0
Google Gemini API key (required for AI features)
Optional: VLC Media Player (for VLC playback)
Optional: FFmpeg (for audio playback and processing)
Setup
Clone the repository:
git clone <repository-url>
cd yt-ninjaInstall dependencies:
npm installConfigure environment variables:
cp .env.example .envEdit .env and add your configuration:
# Required
GEMINI_API_KEY=your-google-gemini-api-key
# Optional
DOWNLOAD_DIR=./downloads
TEMP_DIR=./temp
MAX_CONCURRENT_DOWNLOADS=3
LOG_LEVEL=infoBuild the project:
npm run buildConfiguration
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Google Generative AI API key for AI features |
| No |
| Directory for downloaded files |
| No |
| Temporary files directory |
| No |
| Maximum concurrent downloads |
| No |
| Logging level (error, warn, info, debug) |
Getting a Gemini API Key
Visit Google AI Studio
Sign in with your Google account
Click "Create API Key"
Copy the key and add it to your
.envfile
MCP Configuration
Add to your MCP settings file (mcp.json):
{
"mcpServers": {
"yt-ninja": {
"command": "node",
"args": ["/path/to/yt-ninja/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key-here"
},
"disabled": false
}
}
}Available Tools
Playback Tools
play_youtube_video
Play a YouTube video in browser or VLC player.
Parameters:
url(string, required): YouTube video URLplayer(string, optional): Player type -browserorvlc(default:browser)
Example:
{
"url": "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
"player": "browser"
}Data Retrieval Tools
get_video_info
Get comprehensive information about a YouTube video.
Parameters:
url(string, required): YouTube video URL
Returns: Video title, description, channel, views, likes, duration, tags, thumbnail, etc.
get_playlist_info
Get information about a YouTube playlist.
Parameters:
url(string, required): YouTube playlist URL
Returns: Playlist title, description, video count, total duration, list of videos
get_channel_info
Get information about a YouTube channel.
Parameters:
channelId(string, required): Channel ID or URL
Returns: Channel name, description, subscriber count, total views, video count
search_youtube
Search for videos on YouTube.
Parameters:
query(string, required): Search querymaxResults(number, optional): Maximum results (1-50, default: 10)
Returns: Array of search results with video details
search_music
Search specifically for music on YouTube.
Parameters:
query(string, required): Music search querymaxResults(number, optional): Maximum results (1-50, default: 10)
Returns: Array of music search results
download_thumbnail
Download a video thumbnail image.
Parameters:
url(string, required): YouTube video URLoutputPath(string, optional): Output file pathquality(string, optional): Quality -maxres,high,medium,default(default:maxres)
Transcript Tools
get_transcript
Get the transcript/subtitles of a video.
Parameters:
url(string, required): YouTube video URLlanguage(string, optional): Language code (e.g., 'en', 'es', 'fr')
Returns: Transcript text, language, timestamps, source type
translate_transcript
Translate a video transcript to another language.
Parameters:
url(string, required): YouTube video URLtargetLanguage(string, required): Target language code
Returns: Translated transcript with original timestamps
AI Analysis Tools
summarize_video
Generate an AI-powered summary of a video.
Parameters:
url(string, required): YouTube video URLmaxWords(number, optional): Maximum words in summary (default: 200)
Returns: Summary text, key points, word count
generate_chapters
Auto-generate chapter markers for a video.
Parameters:
url(string, required): YouTube video URL
Returns: Array of chapters with timestamps, titles, and descriptions
get_keywords
Extract relevant keywords from a video.
Parameters:
url(string, required): YouTube video URLcount(number, optional): Number of keywords (default: 15)
Returns: Array of keywords with relevance scores and frequency
detect_topics
Detect topics and categories in a video.
Parameters:
url(string, required): YouTube video URL
Returns: Array of topics with confidence scores and categories
generate_video_highlights
Generate AI-powered video highlights.
Parameters:
url(string, required): YouTube video URLcount(number, optional): Number of highlights (5-10, default: 7)
Returns: Array of highlight moments with timestamps, descriptions, reasons, and scores
Usage Examples
Using with\
AI
Once configured as an MCP server, you can use YT-NINJA through natural language:
"Get information about this video: https://www.youtube.com/watch?v=dQw4w9WgXcQ"
"Summarize this YouTube video in 150 words"
"Generate chapters for this tutorial video"
"Extract the top 20 keywords from this video"
"Get the transcript and translate it to Spanish"Programmatic Usage
import { dataManager, aiAnalyzer, transcriptManager } from 'yt-ninja';
// Get video info
const videoInfo = await dataManager.getVideoInfo('https://youtube.com/watch?v=...');
// Generate summary
const summary = await aiAnalyzer.summarizeVideo('https://youtube.com/watch?v=...', 200);
// Get transcript
const transcript = await transcriptManager.getTranscript('https://youtube.com/watch?v=...');Development
Scripts
npm run dev- Run in development mode with hot reloadnpm run build- Build for productionnpm start- Start the production servernpm run lint- Lint codenpm run format- Format code with Prettiernpm run type-check- Check TypeScript types
Project Structure
yt-ninja/
āāā src/
ā āāā index.ts # Entry point
ā āāā server.ts # MCP server setup
ā āāā integrations/ # External service integrations
ā ā āāā youtube.ts # YouTube API client
ā ā āāā genai.ts # Google GenAI client
ā ā āāā ffmpeg.ts # FFmpeg integration
ā ā āāā process.ts # Process management
ā āāā managers/ # Feature managers
ā ā āāā DataManager.ts # Data retrieval
ā ā āāā PlaybackManager.ts # Playback control
ā ā āāā TranscriptManager.ts # Transcript operations
ā ā āāā AIAnalyzer.ts # AI analysis
ā ā āāā MediaProcessor.ts # Media processing
ā ā āāā AdvancedFeaturesManager.ts # Advanced features
ā āāā types/ # TypeScript type definitions
ā āāā utils/ # Utility functions
āāā dist/ # Compiled output
āāā downloads/ # Downloaded files
āāā .env # Environment configuration
āāā package.jsonError Handling
YT-NINJA provides detailed error messages with suggestions:
{
"success": false,
"error": {
"code": "INVALID_URL",
"message": "Invalid YouTube video URL",
"details": { "url": "..." },
"suggestions": [
"Provide a valid YouTube video URL",
"Example: https://www.youtube.com/watch?v=VIDEO_ID"
]
}
}Available Tools
14 toolsdetect_topicsC
Detect topics in video
Inputs: url (required).
download_thumbnailC
Download video thumbnail image
Inputs: url (required), outputPath, quality.
generate_chaptersC
Generate chapter markers for video
Inputs: url (required).
generate_video_highlightsC
Generate AI-powered video highlights
Inputs: url (required), count.
get_channel_infoC
Get YouTube channel information
Inputs: channelId (required).
get_keywordsC
Extract keywords from video
Inputs: url (required), count.
get_playlist_infoC
Get YouTube playlist information
Inputs: url (required).
get_transcriptC
Get video transcript
Inputs: url (required), language.
get_video_infoC
Get YouTube video information
Inputs: url (required).
play_youtube_videoB
Play YouTube video in browser or VLC
Inputs: url (required), player.
search_musicC
Search YouTube for music
Inputs: query (required), maxResults.
search_youtubeC
Search YouTube
Inputs: query (required), maxResults.
summarize_videoC
Generate AI summary of video
Inputs: url (required), maxWords.
translate_transcriptC
Translate video transcript
Inputs: url (required), targetLanguage (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose targeting specific YouTube-related actions or resources, such as detecting topics, downloading thumbnails, generating chapters/highlights, getting various types of information, searching, summarizing, and translating. There is no significant overlap or ambiguity between tools, making it easy for an agent to select the appropriate one.
All tool names follow a consistent verb_noun pattern using snake_case, such as 'detect_topics', 'download_thumbnail', 'get_channel_info', and 'search_youtube'. This uniformity enhances readability and predictability across the entire tool set.
With 14 tools, the server is well-scoped for YouTube content analysis and interaction, covering a comprehensive range of operations from information retrieval to AI-powered processing. Each tool serves a unique and justified function within this domain.
The tool set provides complete coverage for YouTube video and channel analysis, including CRUD-like operations (e.g., get info, search), AI enhancements (e.g., summarize, generate highlights), and utility functions (e.g., play video, translate transcript). There are no obvious gaps that would hinder agent workflows in this domain.
Maintenance
Related MCP Connectors
Transcripts of YouTube videos, channels, playlists and searches; AI transcription when no captions.
Transcripts, translations, summaries, subtitles, and search for public YouTube videos.
Search YouTube videos, read transcripts and get public video information in your AI assistant.
Summarize YouTube videos, playlists and channels, ask about a video, and get key moments.
Related MCP Servers
- AlicenseBqualityDmaintenanceTransforms YouTube into a queryable knowledge source with search, video details, transcript analysis, and AI-powered tools for summaries, learning paths, and knowledge graphs. Features quota-aware API access with caching and optional OpenAI/Anthropic integration for advanced content analysis.1041 npm1MIT
- AlicenseAqualityDmaintenanceEnables AI tools to access YouTube content, including transcript extraction, video/channel info, and search.434 npmMIT
- AlicenseAqualityDmaintenanceEnables fetching, searching, and summarizing YouTube video transcripts with multi-language support.4MIT
- AlicenseNot gradedqualityDmaintenanceAnalyzes public YouTube videos with Google Gemini, enabling summarization, timestamped insights, metadata extraction, audio analysis, and long-video sessions with follow-up questions.59 npm5MIT