YouTube MCP Server
Provides tools for extracting content from YouTube videos, including timestamped transcripts and visually meaningful frames with quality scoring, for use in summarization, Q&A, and content analysis.
Click on "Install 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., "@YouTube MCP ServerGet the transcript and key frames from this YouTube video: https://youtu.be/dQw4w9WgXcQ"
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.
YouTube MCP Server
A Python-based Model Context Protocol (MCP) server that extracts educational content from YouTube videos — transcripts and visually meaningful frames — and makes it available to AI assistants like Claude, ChatGPT, and any MCP-compatible client.
What It Does
Give an AI assistant a YouTube URL, and it can:
Read the transcript — Full captions with timestamps, ready for summarization, Q&A, or content analysis.
See the video — A 5-phase computer-vision pipeline extracts the most informative frames, scores them for quality, removes duplicates, and returns them as base64-encoded JPEGs the AI can "look at."
No manual downloading. No copy-pasting. Just paste a URL and ask questions.
Tools
get_transcript
Fetches the video's captions using youtube-transcript-api.
Parameters:
url(required) — YouTube video URLlanguage(optional, default:"en") — Preferred caption languageprefer_manual(optional, default:true) — Prefer manually-written captions over auto-generated
Returns: A clean, timestamped transcript block:
[00:00:00] So I want to start by offering you a free ...
[00:00:15] The key insight here is that ...get_video_frames
Runs a full video-analysis pipeline to surface the most meaningful visual moments.
Parameters:
url(required) — YouTube video URLmax_frames(optional, default:20) — Maximum frames to return (hard cap:40)scene_threshold(optional, default:0.25) — FFmpeg scene-detection sensitivityoutput_width(optional, default:640) — Width of returned JPEGs (proportional height)min_importance_score(optional, default:0.35) — Minimum composite quality score
Returns:
Metadata:
video_id,duration_seconds,pipeline_stats,fallback_usedFrame blocks: each includes
timestamp_ms,composite_score, and abase64-encoded JPEG imageAn index listing every returned frame with its timestamp and score
The Frame Pipeline (5 Phases)
Phase | Module | What It Does |
1. Download |
| Downloads the video via |
2. Extract |
| Detects scene changes with |
3. Score |
| Scores each frame across 5 signals: motion stability, entropy, edge density, rectangular coverage, and OCR word count |
4. Deduplicate |
| Removes near-identical frames using DCT perceptual hashing (pHash) with a Hamming-distance threshold |
5. Load |
| Resizes frames, compresses to JPEG (quality 85), and base64-encodes them for MCP transport |
Quick Start
Prerequisites
Python 3.11
ffmpeg — video processing
Tesseract OCR — text detection in frames
macOS:
brew install ffmpeg tesseractUbuntu / Linux:
sudo apt-get install ffmpeg tesseract-ocr tesseract-ocr-engWindows: Download ffmpeg and Tesseract, then add both to your PATH.
Verify:
ffmpeg -version
tesseract --versionInstallation
# Clone the repository
git clone https://github.com/Ayush-Mamgain/youtube-mcp-server.git
cd youtube-mcp-server
# Create a virtual environment
python3 -m venv venv
source venv/bin/activate # macOS / Linux
# venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtConfiguration
Create a .env file in the project root:
LOG_LEVEL=DEBUG
MCP_HTTP_PORT=8000Optional tuning (loaded from config.py defaults if omitted):
Variable | Default | Description |
|
| Reject videos longer than this (seconds) |
|
| Absolute cap on returned frames |
|
| FFmpeg scene-change threshold |
|
| Minimum composite frame score |
|
| Width of returned JPEGs |
Start the Server
python server.pyThe server starts at http://localhost:8000.
Connecting to Claude.ai (Local)
Start the server:
python server.pyGo to Claude.ai → Settings → Integrations → Add MCP server
Enter:
http://localhost:8000/mcp
For cloud-hosted Claude to reach your server, you'll need to expose it publicly (see Deployment below).
API Endpoints
Endpoint | Method | Description |
| GET | Health check — verifies |
| POST | Streamable HTTP endpoint for MCP tool calls |
Project Structure
youtube-mcp-server/
├── server.py # MCP entry point — FastMCP + Starlette HTTP server
├── config.py # Loads and validates environment variables
├── logger.py # stderr-only logging
├── url_parser.py # Validates YouTube URLs and extracts video IDs
├── transcript.py # Fetches captions via youtube-transcript-api
├── downloader.py # Phase 1 — video download with yt-dlp
├── frame_extractor.py # Phase 2 — scene-change frame extraction via ffmpeg
├── scorer.py # Phase 3 — multi-signal frame scoring (OpenCV + Tesseract)
├── deduplicator.py # Phase 4 — perceptual-hash deduplication
├── frame_loader.py # Phase 5 — resize, JPEG encode, base64
├── video_frames.py # Orchestrates Phases 1–5 with semaphore and cleanup
├── requirements.txt # Pinned Python dependencies
└── .gitignore # Excludes .env, venv, caches, test artifactsDevelopment Workflow
This project was built in 9 self-contained stages, each with its own test file and verification step:
Stage | Focus | Test File |
1 | Project scaffold, config, logger |
|
2 | YouTube URL parser & validation |
|
3 | Transcript fetching |
|
4 | Video downloader with duration guard |
|
5 | Frame extraction via ffmpeg |
|
6 | Multi-signal importance scoring |
|
7 | pHash deduplication + base64 loading |
|
8 | Full pipeline orchestration |
|
9 | MCP server entry point + health checks |
|
Golden rule: Each stage is verified before proceeding. Run
python test_stage{N}.pyto validate.
Deployment
Docker support is planned but not yet configured. This section will be updated once containerization is complete.
For now, the server runs directly on any machine with Python 3.11, ffmpeg, and Tesseract installed. Recommended hosting options once Docker is ready:
Once deployed, update your Claude.ai integration URL to:
https://YOUR-DEPLOYMENT-URL/mcpDesign Notes
All logging goes to stderr only.
stdoutis reserved exclusively for MCP communication.Thread-safe: The
get_video_framespipeline uses athreading.Semaphore(1)to prevent concurrent downloads from overwhelming the system.Automatic cleanup: Temporary files created during video processing are deleted after each run.
Strict validation: Video IDs are validated against
^[A-Za-z0-9_-]{11}$. Playlist-only URLs, channel URLs, and malformed inputs are rejected with clear error messages.Graceful degradation: If all frames score below the minimum importance threshold, the pipeline falls back to the top 5 frames and flags
fallback_used: true.
License
MIT © Ayush Mamgain
Acknowledgments
Built with FastMCP, Starlette, yt-dlp, youtube-transcript-api, and OpenCV.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Fetch transcripts, subtitles, chapters, metadata and frames from YouTube and 10+ video platforms
Provide token-optimized, structured YouTube data to enhance your LLM applications. Access efficien…
Search YouTube transcripts and read a video's frames; answers cite clickable timestamps.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chaitanyapandey09/YouTube-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server