alanhc/yt-mcp-server
3.2
If you are the rightful owner of yt-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Model Context Protocol (MCP) server is a specialized server designed to handle context-based interactions with machine learning models, facilitating efficient communication and data exchange.
yt-mcp-server
YouTube and Podcast transcription and summarization server with AI-powered analysis.
Features
- 🎥 YouTube video transcription and summarization
- Smart transcription: Automatically uses subtitles when available, falls back to Whisper audio transcription when not
- 🎙️ Apple Podcast transcription and summarization
- 🤖 AI-powered content analysis using Claude
- 💾 Smart caching system
- 📊 Channel-level analysis
API Endpoints
YouTube Endpoints
1. Get YouTube Video Subtitles
POST /yt
Content-Type: application/json
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"lang": "zh-TW" // optional, defaults to zh-TW
}
Note: This endpoint now automatically falls back to Whisper transcription if subtitles are not available.
2. Summarize Single YouTube Video (NEW!)
POST /youtube/summary
Content-Type: application/json
{
"url": "https://www.youtube.com/watch?v=VIDEO_ID",
"custom_prompt": "optional custom prompt for AI" // optional
}
Response:
{
"video_url": "https://www.youtube.com/watch?v=VIDEO_ID",
"video_id": "VIDEO_ID",
"title": "Video Title",
"summary": "AI-generated summary with timestamps and key points",
"chunks": [],
"generated_at": "2025-11-29T12:00:00",
"raw": "Full transcript with timestamps",
"view_url": "https://be.0xfanslab.com/youtube/channel/summary?id=CACHE_KEY"
}
3. Summarize YouTube Channel
POST /youtube/channel/summary
Content-Type: application/json
{
"url": "https://www.youtube.com/@CHANNEL_NAME",
"max_videos": 5, // optional, defaults to 5, max 10
"custom_prompt": "optional custom prompt" // optional
}
Podcast Endpoints
1. Get Apple Podcast Episode Subtitles
POST /apple_podcast
Content-Type: application/json
{
"url": "https://podcasts.apple.com/...",
"lang": "zh-TW" // optional
}
2. Get Latest Podcast Episode
POST /apple_podcast/latest
Content-Type: application/json
{
"url": "https://podcasts.apple.com/SHOW_URL",
"lang": "zh-TW" // optional
}
3. Summarize Podcast Channel
POST /apple_podcast/summary
Content-Type: application/json
{
"url": "https://podcasts.apple.com/SHOW_URL",
"max_episodes": 1, // optional, defaults to 1, max 5
"custom_prompt": "optional custom prompt" // optional
}
Cache Management
Get Cache Statistics
GET /cache/stats
Clear All Cache
DELETE /cache/clear
Get Cached Summary
GET /api/summary/{cache_key}
Get Cached Podcast Summary
GET /api/podcast/summary/{cache_key}
Setup
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
ANTHROPIC_API_KEY=your_api_key_here
- Start the server:
./start_server.sh
The server will run on http://0.0.0.0:8000
Docker Support
Build and run with Docker:
./docker-start.sh
Stop the Docker container:
./docker-stop.sh
Requirements
- Python 3.12+
- CUDA-capable GPU (for faster_whisper transcription)
- Anthropic API key (for AI summarization)
License
MIT