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 分