cryptohero92/Youtube_Summarizer_MCP
If you are the rightful owner of Youtube_Summarizer_MCP 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 YouTube Summarizer MCP Server is a tool that enables language models to summarize YouTube videos by fetching transcripts and generating concise summaries using AI technologies.
YouTube Summarizer MCP Server
A Model Context Protocol (MCP) server that enables Claude and other language models to summarize YouTube videos by fetching transcripts and generating concise summaries using OpenAI GPT-4o or Google Gemini.
Features
- YouTube Video Summarization: Automatically fetches video transcripts and generates intelligent summaries
- Multiple AI Backends: Supports both OpenAI GPT-4o and Google Gemini for summarization
- MCP Integration: Works seamlessly with Claude Desktop and other MCP-compatible clients
- Robust Error Handling: Comprehensive error management for network issues and API failures
- Easy Configuration: Simple environment variable setup
📹 Introduction Video
New to this project? Watch the introduction video for a complete walkthrough:
📺 Click the thumbnail above to watch the introduction video!
Note: If you don't see a thumbnail above, you may need to add a thumbnail image to the repository. For now, you can download and watch the video directly.
What you'll learn in this video:
- ✅ How to set up the YouTube Summarizer MCP Server
- ⚙️ Step-by-step installation and configuration process
- 🎬 Live demonstration of the summarizer in action with Claude Desktop
- 💡 Tips and best practices for optimal usage
Prerequisites
- Python 3.12 or higher
- uv package manager
- API keys for:
- Supadata API (for YouTube transcript fetching)
- OpenAI API or Google Gemini API (for text summarization)
Installation
-
Clone or create the project directory:
mkdir youtube_summarizer cd youtube_summarizer -
Initialize the project with uv:
uv init -
Install dependencies:
uv add google-generativeai mcp[cli] openai requests yt-dlp python-dotenv
Configuration
-
Create a
.envfile in the project root:SUPADATA_API_KEY=your_supadata_api_key_here GEMINI_API_KEY=your_gemini_api_key_here OPENAI_API_KEY=your_openai_api_key_here -
API Key Setup:
- Supadata API: Sign up at Supadata.ai to get YouTube transcript access
- OpenAI API: Get your API key from OpenAI Platform
- Gemini API: Get your API key from Google AI Studio
Note: You only need either OpenAI OR Gemini API key, not both. The server will use OpenAI if available, otherwise fallback to Gemini.
Claude Desktop Integration
To use this MCP server with Claude Desktop, add the following configuration to your claude_desktop_config.json:
{
"mcpServers": {
"youtube-summarizer": {
"command": "uv",
"args": [
"--directory",
"/path/to/youtube_summarizer",
"run",
"mcp_server.py"
],
"env": {
"SUPADATA_API_KEY": "your_supadata_api_key_here",
"GEMINI_API_KEY": "your_gemini_api_key_here"
}
}
}
}
Important:
- Replace the directory path with your actual project location
- Replace the API key values with your actual keys
- The
envsection in the config will override any.envfile values
Usage
With Claude Desktop
Once configured, you can ask Claude to summarize YouTube videos:
Please summarize this YouTube video: https://www.youtube.com/watch?v=CiArUs_2jm4
Claude will automatically use the MCP server to fetch the transcript and generate a summary.
Testing the Server Directly
You can test the MCP server using the MCP inspector:
# Install MCP inspector (if not already installed)
npm install -g @anthropic/mcp-inspector
# Run the inspector
mcp-inspector
# In another terminal, run your server
uv --directory /path/to/youtube_summarizer run mcp_server.py
Project Structure
youtube_summarizer/
├── .env # Environment variables (create this)
├── .gitignore # Git ignore file
├── .python-version # Python version specification
├── main.py # Entry point (placeholder)
├── mcp_server.py # Main MCP server implementation
├── pyproject.toml # Project dependencies and metadata
├── uv.lock # Dependency lock file
├── youtube_summarizer_introduction.mp4 # Introduction video walkthrough
└── README.md # This file
API Reference
Available Tools
summarize_youtube_video
Summarizes a YouTube video by fetching its transcript and generating a concise summary.
Parameters:
youtube_url(string): The full URL of the YouTube video to summarize
Returns:
- A formatted string containing the video title and summary
Example:
result = await summarize_youtube_video("https://www.youtube.com/watch?v=dQw4w9WgXcQ")
How It Works
- Video Title Extraction: Uses
yt-dlpto extract the video title - Transcript Fetching: Calls the Supadata API to get the video transcript
- AI Summarization: Uses either OpenAI GPT-4o or Google Gemini to generate a summary
- Response Formatting: Combines the title and summary into a readable format
Troubleshooting
Common Issues
-
"No transcript content found":
- The video might not have captions/transcripts available
- Check if the video is publicly accessible
-
"Supadata API key is not set":
- Verify your
.envfile containsSUPADATA_API_KEY - Check Claude Desktop config environment variables
- Verify your
-
"No API key found for OpenAI or Gemini":
- Set at least one of
OPENAI_API_KEYorGEMINI_API_KEY - Verify the keys are correctly formatted
- Set at least one of
-
MCP Server Connection Issues:
- Ensure the directory path in Claude Desktop config is correct
- Check that
uvis installed and accessible from the command line - Verify all dependencies are installed with
uv sync
Debug Mode
To run the server with debug output:
uv run mcp_server.py
This will show console output including API calls and error messages.
Dependencies
- mcp[cli]: Model Context Protocol server framework
- openai: OpenAI API client
- google-generativeai: Google Gemini API client
- requests: HTTP library for API calls
- yt-dlp: YouTube video information extraction
- python-dotenv: Environment variable loading
Development
This project was built following the MCP Python Server Development Guide.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Support
If you encounter issues:
- Check the troubleshooting section above
- Verify your API keys are valid and have sufficient credits
- Ensure all dependencies are properly installed
- Check the console output for detailed error messages
☕ Support This Project
If you find this YouTube Summarizer MCP Server helpful and would like to support my future work, please consider buying me a coffee! Your support helps me continue improving this tool and creating more useful MCP servers for the community.
Every contribution, no matter how small, is greatly appreciated and motivates me to keep building awesome tools! 🚀
