YO

YouTube Video Summarizer for MCP Server

Summarize lengthy YouTube videos on your MCP server quickly to get concise, shareable highlights and timestamps.

Quick Install
npx -y @nabid-pf/youtube-video-summarizer-mcp

Overview

This MCP (Model Context Protocol) server provides fast, programmatic summarization of YouTube videos. It fetches a video’s audio, generates a transcript, and produces concise summaries and timestamped highlights that are easy to share or embed into downstream workflows. The server is designed to run as a tool within an MCP-enabled environment so that language models and other agents can call it as part of larger pipelines.

Summarizing long videos manually is time-consuming; this service automates the common steps (download/extract, transcription, chunking, summarization, and timestamp mapping) and returns structured JSON output that includes clipable highlights and a full summary. The result is useful for content discovery, research, note-taking, accessibility, and automations that integrate video content into conversational agents.

Features

  • Download and extract audio from YouTube videos (supports yt-dlp/ffmpeg workflows)
  • Automatic transcription (configurable backend: cloud LLMs or local transcription models)
  • Chunking and context-aware summarization to preserve coherence
  • Timestamped highlights and short, shareable blurbs for each key moment
  • Full video summary for quick comprehension
  • Simple HTTP API suitable for MCP tool integration
  • Caching of transcriptions and summaries to reduce repeated work
  • Configurable model, language, and chunking parameters

Installation / Configuration

Prerequisites:

  • Python 3.9+
  • ffmpeg installed and on PATH
  • yt-dlp (or similar) available
  • Optional: API key for your chosen LLM/transcription backend

Clone and install:

git clone https://github.com/nabid-pf/youtube-video-summarizer-mcp.git
cd youtube-video-summarizer-mcp
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Environment variables (example):

export MCP_BIND_HOST=0.0.0.0
export MCP_BIND_PORT=8080

# Transcription / LLM provider (example keys)
export TRANSCRIBE_BACKEND=openai   # or "local"
export OPENAI_API_KEY=sk-...
export TRANSCRIPT_CACHE_DIR=/var/cache/ytsummaries

Run the server (development):

uvicorn app.main:app --host ${MCP_BIND_HOST:-127.0.0.1} --port ${MCP_BIND_PORT:-8080} --reload

Docker example:

# Dockerfile (simplified)
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -r requirements.txt
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]

Build & run:

docker build -t youtube-summarizer-mcp .
docker run -p 8080:8080 -e OPENAI_API_KEY="${OPENAI_API_KEY}" youtube-summarizer-mcp

Available Tools / Resources

HTTP endpoints (example):

  • POST /summarize
    • Accepts JSON payload describing the YouTube URL and options
  • GET /health
    • Basic liveness/ readiness check
  • Static files / cache folder
    • Local cache for downloaded audio and transcripts

Example POST /summarize request:

POST /summarize
Content-Type: application/json

{
  "url": "https://www.youtube.com/watch?v=VIDEO_ID",
  "language": "en",
  "transcription_model": "whisper-1",
  "summary_model": "gpt-4o-mini",
  "max_chunk_seconds": 300,
  "highlight_count": 5
}

Example response (abbreviated):

{
  "video_id": "VIDEO_ID",
  "title": "Example Video Title",
  "duration_seconds": 3600,
  "full_summary": "A concise paragraph summarizing the whole video...",
  "highlights": [
    {
      "start": "00:12:34",
      "end": "00:13:05",
      "summary": "Key highlight one in a short sentence."
    },
    {
      "start": "00:25:00",
      "end": "00:25:30",
      "summary": "Important insight about the main topic."
    }
  ],
  "transcript_path": "/cache/transcripts/VIDEO_ID.json"
}

Parameter reference:

ParameterTypeDefaultDescription
urlstringrequiredFull YouTube URL or video id
languagestring“auto”Language to force for transcription
transcription_modelstringbackend-dependentWhich transcription/backend to use
summary_modelstringbackend-dependentModel used for summarization
max_chunk_secondsint300Max seconds per chunk for context windowing
highlight_countint5Number of top highlights to return

MCP tool manifest example (to register this server as a tool):

{
  "name": "youtube_video_summarizer",
  "description": "Summarize YouTube videos and return highlights + timestamps",
  "type": "http",
  "entrypoint": "http://localhost:8080/summarize",
  "schema": {
    "url": "string",
    "language": "string"
  }
}

Use Cases

  • Content creators: Generate short highlight reels or show notes with exact timestamps to save editing time.
  • Researchers and journalists: Quickly extract the most relevant segments from long talks, interviews, or lectures.
  • Education: Produce study guides and time-marked clips that students can review.
  • Accessibility: Provide concise summaries and time-indexed captions for people who prefer skimming long videos.
  • Agents and automations: Allow conversational agents (MCP-aware) to fetch summarized video content to inform responses without streaming the whole video.

Notes, Limitations & Troubleshooting

  • Quality depends on the transcription backend and audio quality; noisy or music-heavy tracks may yield less accurate transcripts.
  • Respect rate limits and usage costs of cloud LLM/transcription providers.
  • Caching significantly reduces repeated work—check cache directory when debugging repeated runs.
  • If timestamps seem misaligned, verify ffmpeg + yt-dlp versions and that the downloaded audio matches the video timeline.

For detailed implementation specifics, code examples, and contribution guidelines, see the project repository: https://github.com/nabid-pf/youtube-video-summarizer-mcp

Tags:media