Youtube Video Analyzer

io.github.ludmila-omlopes由 GitHub 帳號 ludmila-omlopes 發布v0.2.1更新於 Oct 24, 2026

MCP stdio server for analyzing YouTube videos with Google Gemini

已驗證STDIO僅桌面媒體與設計AI 與機器學習

概覽

AI 產生的概覽

本機 MCP 伺服器,讓助理透過 Google Gemini 分析公開 YouTube 影片:摘要、帶時間戳的重點、畫面影格、中繼資料與長影片問答

可以做什麼
分析影片:用 Gemini 摘要公開 YouTube 影片、分析以語音為主的音訊、分析限定片段區間,並可依自訂結構回傳 JSON。處理長影片與 VOD:以 MCP 任務或背景作業方式執行長影片分析,可輪詢、取得結果與取消,並在可重複使用的工作階段中繼續追問。檢視影片:取得正規化的 YouTube 中繼資料,並依時間戳擷取高解析度 JPEG 畫面影格。檢查環境:回報本機支援哪些長影片處理策略。
適用情境
適合讓助理摘要或追問公開 YouTube 內容、擷取帶時間戳的重點或畫面影格,或處理超出單次同步呼叫時限的長影片與 VOD。
執行需求
透過 npx 或全域 npm 安裝以 stdio 在本機執行;需要 Node.js 20 或更新版本,並在 GEMINI_API_KEY 提供 Gemini API 金鑰。僅查詢中繼資料時才需要 YouTube Data API 金鑰;yt-dlp 與 ffmpeg 為選用,可獲得更佳的長影片支援。GEMINI_MODEL 與 YT_DLP_PATH 為選用覆寫項。
安裝前請注意
YouTube 網址、提示詞以及相關媒體或衍生片段會傳送給 Google Gemini;uploaded_file 策略可能先在本機下載暫存媒體再上傳。url_chunks 策略可避免下載,但會增加 Gemini 呼叫次數。私人、有年齡限制、僅限會員、受 DRM 保護或地區受限的影片可能失敗,使用者須自行遵守 YouTube 與 Gemini 條款及著作權法規。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Youtube Video Analyzer,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

YouTube Video Analyzer MCP

MCP stdio server for analyzing public YouTube videos with Google Gemini.

Use it from any MCP-compatible client to summarize videos, extract timestamped insights, analyze spoken content, inspect metadata, work with long VODs, and ask follow-up questions against reusable long-video sessions.

What It Can Do

  • Analyze public YouTube videos with Gemini.
  • Analyze speech-focused videos with audio-first instructions.
  • Fetch normalized YouTube metadata through the YouTube Data API.
  • Extract high-resolution JPEG frames from YouTube videos with yt-dlp and ffmpeg.
  • Analyze long videos and VODs through required MCP tasks.
  • Analyze long videos and VODs through compatibility background jobs for clients without MCP task support.
  • Reuse long-video sessions for follow-up questions.
  • Fall back to URL chunking when local download tools are unavailable.
  • Return structured JSON when you provide a custom response schema.

Requirements

  • Node.js 20 or newer.
  • A Gemini API key.
  • Optional: a YouTube Data API key for metadata lookup.
  • Optional for best long-video support: yt-dlp and ffmpeg.

Quick Start

Use the published package directly from your MCP client with npx:

json
{  "mcpServers": {    "youtube-analyzer": {      "command": "npx",      "args": ["-y", "@ludylops/youtube-video-analyzer-mcp"],      "env": {        "GEMINI_API_KEY": "your_gemini_key_here",        "YOUTUBE_API_KEY": "optional_youtube_key_here"      }    }  }}

GEMINI_API_KEY is required. YOUTUBE_API_KEY is only required for get_youtube_video_metadata.

Global Setup

You can also install the package globally and store reusable config:

bash
npm install -g @ludylops/youtube-video-analyzer-mcpyoutube-video-analyzer-mcp setup

Then your MCP client can use:

json
{  "mcpServers": {    "youtube-analyzer": {      "command": "youtube-video-analyzer-mcp"    }  }}

Packages

This repository is a small npm workspace:

  • @ludylops/video-analysis-core: reusable transport-agnostic video analysis logic in packages/video-analysis-core.
  • @ludylops/youtube-video-analyzer-mcp: MCP stdio server adapter in the repository root.

The MCP server depends on the core package, so SaaS apps, CLIs, skills, and other integrations can reuse the same analysis logic without depending on MCP.

Local Development

bash
npm installnpm run buildnpm testnpm start

Copy .env.example to .env for local runs:

bash
GEMINI_API_KEY=your_gemini_api_key_hereYOUTUBE_API_KEY=your_youtube_api_key_hereGEMINI_MODEL=gemini-2.5-proYT_DLP_PATH=yt-dlpMCP_LOG_LEVEL=warn

Tools

  • get_youtube_analyzer_capabilities: inspects local support for long-video strategies.
  • get_youtube_video_metadata: fetches normalized public YouTube metadata.
  • get_youtube_video_frame: extracts a high-resolution JPEG frame at a timestamp, with optional Gemini timestamp refinement before local extraction.
  • analyze_youtube_video: analyzes short videos or bounded clip windows.
  • analyze_youtube_video_audio: analyzes speech-focused videos using audio-first instructions.
  • analyze_long_youtube_video: analyzes long videos or VODs as a required MCP task.
  • start_long_youtube_analysis: starts a background long-video job and returns a jobId.
  • get_long_youtube_analysis_status: polls a background long-video job.
  • get_long_youtube_analysis_result: fetches a completed background long-video job result.
  • cancel_long_youtube_analysis: cancels a background long-video job.
  • continue_long_video_analysis: asks follow-up questions for a previous long-video session as a required MCP task.

For detailed inputs, strategies, and examples, see docs/tools.md.

Long Videos

For VODs and long videos, call get_youtube_analyzer_capabilities first.

The native long-video tools require MCP task execution. If your client only supports synchronous tool calls with a fixed timeout such as 120 seconds, use the compatibility job workflow: start_long_youtube_analysis, poll get_long_youtube_analysis_status, then fetch get_long_youtube_analysis_result. You can also analyze shorter bounded windows with analyze_youtube_video.

When yt-dlp, ffmpeg, and a writable temp directory are available, use analyze_long_youtube_video with strategy=auto or strategy=uploaded_file. This path can create a reusable Gemini file session and return a sessionId.

When local download tools are unavailable, use strategy=url_chunks. It avoids local media downloads, but can require more Gemini calls.

Read the full guide in docs/long-videos.md.

Documentation

Privacy And Limitations

This server sends the YouTube URL, prompts, and relevant media or derived chunks to Google Gemini. With strategy=uploaded_file, local tools may download temporary media before uploading it to Gemini. get_youtube_video_frame downloads a small temporary high-quality video window and returns an exact JPEG frame; if timestamp refinement is requested, Gemini is used only to choose a timestamp, not to create image pixels. With strategy=url_chunks, the server avoids local media downloads but may make more Gemini calls.

Private, deleted, age-restricted, member-only, DRM-protected, or region-blocked videos may fail depending on YouTube and Gemini access. Users are responsible for complying with YouTube terms, Gemini API terms, copyright rules, and local law.

Project Layout

  • packages/video-analysis-core/src: reusable video analysis core.
  • src/server.ts: MCP server and tool registration.
  • src/mcp-server-main.ts: stdio transport entry point.
  • src/platform-runtime: runtime adapters used by the MCP server.
  • bin/youtube-video-analyzer-mcp.js: CLI wrapper and setup flow.
  • src/test: test suite.

Contributing

Contributions are welcome. Start with CONTRIBUTING.md, run npm test before opening changes, and update CHANGELOG.md for user-visible behavior changes.

License

MIT. See LICENSE.

來源:README.md,提交 cdb00e9

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.2.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分