Skip to main content
Glama

YouTube Vision MCP 服务器 ( youtube-vision )

NPM 版本 许可证:MIT 铁匠徽章

MCP(模型上下文协议)服务器利用 Google Gemini Vision API 与 YouTube 视频进行交互。它允许用户获取 YouTube 视频的描述、摘要、问题答案以及提取关键时刻。

特征

  • 使用 Gemini Vision API 分析 YouTube 视频。

  • 为不同的交互提供多种工具:

    • 一般说明或问答 ( ask_about_youtube_video )

    • 摘要( summarize_youtube_video

    • 关键时刻提取( extract_key_moments

  • 列出支持generateContent可用 Gemini 模型。

  • 可通过环境变量配置 Gemini 模型。

  • 通过 stdio(标准输入/输出)进行通信。

Related MCP server: YouTube Insights MCP Server

先决条件

在使用此服务器之前,请确保您具有以下条件:

  • **Node.js:**建议使用 18 或更高版本。您可以从nodejs.org下载。

  • **Google Gemini API 密钥:**Google AI Studio或 Google Cloud Console 获取您的 API 密钥。

安装和使用

使用此服务器主要有两种方式:

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 youtube-vision-mcp:

npx -y @smithery/cli install @minbang930/youtube-vision-mcp --client claude

选项 1:使用 npx(推荐快速使用)

运行此服务器的最简单方法是使用npx ,它可以下载并运行包而无需永久安装。

您可以在 MCP 客户端的设置文件(Claude、VSCode ..)中对其进行配置:

{
  "mcpServers": {
    "youtube-vision": {
      "command": "npx",
      "args": [
        "-y",
        "youtube-vision"
      ],
      "env": {
        "GEMINI_API_KEY": "YOUR_GEMINI_API_KEY",
        "GEMINI_MODEL_NAME": "gemini-2.0-flash"
      }
    }
  }
}

用您的实际 Google Gemini API 密钥替换"YOUR_GEMINI_API_KEY"

选项 2:手动安装(从源代码)

如果您想修改代码或直接从源代码运行它:

  1. 克隆存储库:

    git clone https://github.com/minbang930/Youtube-Vision-MCP.git
    cd youtube-vision
  2. 安装依赖项:

    npm install
  3. 构建项目:

    npm run build
  4. **配置并运行:**您可以直接使用node dist/index.js运行编译后的代码(确保GEMINI_API_KEY已设置为环境变量),或者配置您的 MCP 客户端使用node命令和dist/index.js的绝对路径来运行它,并通过env设置传递 API 密钥,如 npx 示例中所示。

配置

服务器使用以下环境变量:

  • GEMINI_API_KEY (必需):您的 Google Gemini API 密钥。

  • GEMINI_MODEL_NAME (可选):要使用的具体 Gemini 模型(例如gemini-1.5-flash )。默认为gemini-2.0-flash**重要提示:**对于生产或商业用途,请确保选择未标记为“实验”或“预览”的模型版本。

环境变量应在 MCP 客户端设置文件 (例如mcp_settings.json ) 的env部分中设置。

可用工具

1. ask_about_youtube_video

回答有关视频的问题,或者如果没有问题则提供一般描述。

  • 输入:

    • youtube_url (字符串,必需):YouTube 视频的 URL。

    • question (字符串,可选):关于视频的具体问题。如果省略,则生成一般描述。

  • **输出:**包含答案或描述的文本。

2. summarize_youtube_video

生成给定 YouTube 视频的摘要。

  • 输入:

    • youtube_url (字符串,必需):YouTube 视频的 URL。

    • summary_length (字符串,可选):所需的摘要长度(“短”、“中”、“长”)。默认为“中”。

  • **输出:**包含视频摘要的文本。

3. extract_key_moments

从给定的 YouTube 视频中提取关键时刻(时间戳和描述)。

  • 输入:

    • youtube_url (字符串,必需):YouTube 视频的 URL。

    • number_of_moments (整数,可选):要提取的关键时刻数量。默认为 3。

  • **输出:**带有时间戳的描述关键时刻的文本。

4. list_supported_models

列出支持generateContent方法(通过 REST API 获取)的可用 Gemini 模型。

  • **输入:**

  • **输出:**列出支持的模型名称的文本。

重要提示

  • **生产模型选择:**将此服务器用于生产或商业用途时,请确保所选的GEMINI_MODEL_NAME是适合生产使用的稳定版本。根据Gemini API 服务条款,标记为“实验”或“预览”的模型不允许用于生产部署。

  • **API 服务条款:**此服务器的使用依赖于 Google Gemini API。用户有责任查看并遵守Google API 服务条款Gemini API 附加服务条款。请注意,Gemini API 的免费版和付费版的数据使用政策可能有所不同。使用免费版时,请勿提交敏感或机密信息。

  • 内容责任: Gemini API 生成的内容的准确性和适当性无法得到保证。请谨慎信赖或发布生成的内容。

执照

本项目遵循 MIT 许可证。详情请参阅 LICENSE 文件。

Available Tools

4 tools
ask_about_youtube_videoB

Answers a question about the video or provides a general description if no question is asked.

ParametersJSON Schema
NameRequiredDescriptionDefault
youtube_urlYes
questionNoQuestion about the video content. If omitted, a general description will be generated.

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions the tool can answer questions or provide descriptions, but doesn't cover important aspects like rate limits, authentication needs, error conditions, or what constitutes a 'general description.' This leaves significant gaps for a tool that presumably processes external content.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core functionality without any wasted words. It's appropriately sized for a tool with two parameters and front-loads the essential information about what the tool does.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description provides basic purpose and parameter guidance but lacks sufficient detail about behavioral traits, error handling, or output format. For a tool that interacts with external video content, more context about limitations or capabilities would be helpful to achieve completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only the question parameter has a description). The description adds valuable context by explaining that omitting the question parameter triggers a general description, which clarifies the optional nature and default behavior. This compensates well for the schema's partial coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: answering questions about YouTube videos or providing general descriptions. It specifies the verb ('answers'/'provides') and resource ('video'), but doesn't explicitly differentiate from sibling tools like summarize_youtube_video or extract_key_moments, which prevents a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use this tool (for questions about video content or general descriptions) but doesn't provide explicit guidance on when to choose alternatives like summarize_youtube_video or extract_key_moments. No exclusions or prerequisites are mentioned, leaving usage context somewhat vague.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract_key_momentsC

Extracts key moments (timestamps and descriptions) from a given YouTube video.

ParametersJSON Schema
NameRequiredDescriptionDefault
youtube_urlYes
number_of_momentsNoNumber of key moments to extract (default: 3).

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It mentions what is extracted ('timestamps and descriptions') but doesn't cover critical aspects like error handling (e.g., invalid URLs, unsupported videos), performance (e.g., processing time), or output format details. This is inadequate for a tool with potential complexity.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It is front-loaded with the core action and resource, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, no output schema, and incomplete parameter documentation (50% coverage), the description is insufficient. It lacks details on behavioral traits, error conditions, and output structure, which are essential for an extraction tool. The description does not compensate for these gaps in structured data.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only 'number_of_moments' has a description), and the description adds no parameter-specific information beyond implying a YouTube URL is needed. It doesn't clarify URL format requirements or the nature of 'key moments,' leaving gaps in understanding the 'youtube_url' parameter. Baseline 3 is appropriate given partial schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('extracts') and resource ('key moments from a given YouTube video'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'summarize_youtube_video' or 'ask_about_youtube_video', which might also process video content in different ways.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose extraction over summarization or querying, nor does it specify prerequisites or constraints (e.g., video length, availability). This leaves the agent without context for tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_supported_modelsB

Lists available Gemini models that support the 'generateContent' method.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but only states what the tool does, not how it behaves. It lacks details on permissions, rate limits, output format, or whether it's a read-only operation. 'Lists' implies a safe read, but this isn't explicitly confirmed, leaving behavioral gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without redundancy. It's front-loaded with the core action and resource, making it easy to parse. Every word earns its place, with no wasted verbiage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (0 parameters, no output schema), the description is minimally adequate but incomplete. It explains what the tool does but lacks context on why to use it, output details, or behavioral traits. For a list operation, this is the bare minimum, scoring a 3.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters with 100% schema description coverage, so the schema fully documents the absence of inputs. The description adds no parameter information, which is appropriate here. Baseline is 4 for zero parameters, as no compensation is needed.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Lists') and resource ('available Gemini models'), specifying they support the 'generateContent' method. It distinguishes from sibling tools (YouTube-related) by focusing on model listing rather than video processing. However, it doesn't explicitly differentiate from hypothetical model-related siblings, keeping it at 4 rather than 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites, context for selecting models, or relationships to sibling tools. The agent must infer usage from the purpose alone, which is insufficient for optimal tool selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarize_youtube_videoC

Generates a summary of a given YouTube video URL using Gemini Vision API.

ParametersJSON Schema
NameRequiredDescriptionDefault
youtube_urlYes
summary_lengthNoDesired summary length: 'short', 'medium', or 'long' (default: 'medium').medium

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the method ('using Gemini Vision API') but lacks details on rate limits, authentication needs, error handling, or output format. For a tool that likely involves API calls and video processing, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary details. It's appropriately sized for the tool's complexity, with zero waste or redundancy, making it easy to understand at a glance.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (involving video processing and an external API), lack of annotations, no output schema, and incomplete parameter documentation, the description is insufficient. It doesn't cover behavioral aspects like performance, limitations, or what the summary output looks like, leaving significant gaps for effective tool use.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 50% (only 'summary_length' has a description). The description adds no parameter semantics beyond the schema, as it doesn't explain the 'youtube_url' parameter or provide additional context for 'summary_length'. With partial schema coverage, the description doesn't compensate for the undocumented parameter, resulting in a baseline score.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Generates a summary of a given YouTube video URL using Gemini Vision API.' It specifies the verb ('Generates a summary'), resource ('YouTube video URL'), and method ('using Gemini Vision API'). However, it doesn't explicitly differentiate from sibling tools like 'ask_about_youtube_video' or 'extract_key_moments', which might offer similar or overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where this tool is preferred, such as for quick overviews versus detailed analysis. Without such guidance, users might struggle to choose between this and tools like 'ask_about_youtube_video' or 'extract_key_moments'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 4 tool updates
    • First observedask_about_youtube_video
    • First observedextract_key_moments
    • First observedlist_supported_models
    • First observedsummarize_youtube_video

TDQS

B3.1/5.0

Scored across 4 tools

Disambiguation4/5

The tools have mostly distinct purposes, but 'ask_about_youtube_video' and 'summarize_youtube_video' could be confused as both provide descriptive outputs about video content. However, 'ask_about_youtube_video' is question-driven while 'summarize_youtube_video' is general, and the other tools ('extract_key_moments', 'list_supported_models') are clearly differentiated.

Naming Consistency3/5

Three tools follow a consistent verb_noun pattern ('ask_about_youtube_video', 'extract_key_moments', 'summarize_youtube_video'), but 'list_supported_models' deviates by using 'list' instead of a more descriptive verb like 'get' or 'retrieve', and it lacks the 'youtube_video' domain specificity. This mixed convention reduces predictability.

Tool Count4/5

With 4 tools, the count is reasonable for a focused YouTube video analysis server. It covers core functionalities like description, summarization, moment extraction, and model listing, though it could be slightly expanded for more comprehensive coverage (e.g., adding video metadata retrieval).

Completeness3/5

The server covers key video analysis tasks (description, summarization, moment extraction) and model support listing, but there are notable gaps. For example, it lacks tools for video metadata (e.g., title, duration, uploader), search capabilities, or interaction with YouTube's API beyond vision-based analysis, which limits agent workflows in broader YouTube contexts.

Maintenance

ActivityInactive
ResponsivenessUnresponsive

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    MCP server that fetches YouTube video transcripts and optionally summarizes them. Supports multiple transcript formats (text, JSON, SRT, WebVTT), multi-language retrieval, and flexible YouTube URL parsing.
    6
    37 PyPI
    6
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    A local MCP server for extracting YouTube video transcripts, metadata, and performing visual analysis using Gemini Vision or local Whisper models. It enables users to process video content through various tools for subtitle retrieval and frame analysis.
    12 npm
    MIT