A Modern Context Protocol (MCP) server for YouTube that retrieves and processes video content.a
- Retrieve YouTube video metadata (title, description, thumbnail)
- Extract and process video transcripts
- Generate video summaries
- Find similar videos
- Translate content to different languages
- Support for multiple transport methods: TCP, STDIO, and SSE
- Python 3.9+
- Google Cloud Project with YouTube Data API v3 enabled
- API key for YouTube Data API
- Clone the repository:
git clone https://github.com/yourusername/MCP-Youtube.git
cd MCP-Youtube- Install dependencies:
pip install -r requirements.txt- Create a
.env_ytfile with your YouTube API key:
YOUTUBE_API_KEY=your_api_key_here
OPENAI_API_KEY=your_openai_api_key_here # For translation and summarization
Note: The .env_yt file is already listed in .gitignore to protect your API keys. Do NOT commit your .env_yt file to version control.
MCP-Youtube implements the Modern Context Protocol and can be used with LLMs that support MCP.
When an LLM encounters a YouTube URL (e.g., http://youtube.com/watch?v=VIDEO_ID), MCP-Youtube will:
- Retrieve video metadata (title, description, thumbnail URL)
- Extract the transcript
- Generate a summary
- Provide similar video recommendations
- Support translation of content
MCP-Youtube supports multiple transport methods:
- TCP Transport: Connect via TCP socket
- STDIO Transport: Use standard input/output for communication
- SSE Transport: Server-Sent Events for streaming communication
/youtube/video/{video_id}: Get video metadata/youtube/transcript/{video_id}: Get video transcript/youtube/summary/{video_id}: Get video summary/youtube/similar/{video_id}: Get similar videos/youtube/translate: Translate content
Environment variables:
YOUTUBE_API_KEY: Your YouTube Data API key (required)OPENAI_API_KEY: Your OpenAI API key for translation/summarization (optional)MCP_PORT: Port for TCP transport (default: 3000)LOG_LEVEL: Logging level (default: INFO)
- Install development dependencies:
pip install -r requirements-dev.txt- Run tests:
pytest tests/- Run the server:
YOUTUBE_API_KEY=#####. python3 -m mcp_youtube.mcp_server --transport http --port 9091MIT License