Skip to main content
Glama
mario-andreschak

MCP Video Generation with Veo2

使用 Veo2 生成 MCP 视频

铁匠徽章

该项目实现了一个模型上下文协议 (MCP) 服务器,该服务器公开了 Google 的 Veo2 视频生成功能。它允许客户端根据文本提示或图像生成视频,并通过 MCP 资源访问生成的视频。

特征

  • 根据文本提示生成视频

  • 从图像生成视频

  • 通过 MCP 资源访问生成的视频

  • 视频生成模板示例

  • 支持 stdio 和 SSE 传输

Related MCP server: hyper-video-service

示例图像

1dec9c71-07dc-4a6e-9e17-8da355d72ba1

图像转视频示例

图像转视频 - 来自 Grok 生成的小狗

图像转视频 - 来自真猫

先决条件

  • Node.js 18 或更高版本

  • 可访问 Gemini API 和 Veo2 模型的 Google API 密钥(= 您需要使用 API 密钥设置信用卡!-> 转到 aistudio.google.com)

安装

在FLUJO中安装

  1. 单击“添加服务器”

  2. 将 Github URL 复制并粘贴到 FLUJO 中

  3. 单击解析、克隆、安装、构建和保存。

通过 Smithery 安装

要通过Smithery自动为 Claude Desktop 安装 mcp-video-generation-veo2:

npx -y @smithery/cli install @mario-andreschak/mcp-veo2 --client claude

手动安装

  1. 克隆存储库:

    git clone https://github.com/yourusername/mcp-video-generation-veo2.git
    cd mcp-video-generation-veo2
  2. 安装依赖项:

    npm install
  3. 使用您的 Google API 密钥创建一个.env文件:

    cp .env.example .env
    # Edit .env and add your Google API key

    .env文件支持以下变量:

    • GOOGLE_API_KEY :您的 Google API 密钥(必需)

    • PORT :服务器端口(默认值:3000)

    • STORAGE_DIR :存储生成视频的目录(默认值:./generated-videos)

    • LOG_LEVEL :日志记录级别(默认值:致命)

      • 可用级别:详细、调试、信息、警告、错误、致命、无

      • 对于开发,设置为debug或info以获取更详细的日志

      • 对于生产环境,保持为fatal以最小化控制台输出

  4. 构建项目:

    npm run build

用法

启动服务器

您可以使用 stdio 或 SSE 传输启动服务器:

stdio 传输(默认)

npm start
# or
npm start stdio

上交所运输

npm start sse

这将在端口 3000(或.env文件中指定的端口)上启动服务器。

MCP 工具

该服务器公开以下 MCP 工具:

生成视频文本

根据文本提示生成视频。

参数:

  • prompt (字符串):视频生成的文本提示

  • config (对象,可选):配置选项

    • aspectRatio (字符串,可选):“16:9”或“9:16”

    • personGeneration (字符串,可选):“dont_allow”或“allow_adult”

    • numberOfVideos (数字,可选):1 或 2

    • durationSeconds (数字,可选):5 到 8 之间

    • enhancePrompt (boolean,可选):是否增强提示

    • negativePrompt (字符串,可选):描述不生成内容的文本

例子:

{
  "prompt": "Panning wide shot of a serene forest with sunlight filtering through the trees, cinematic quality",
  "config": {
    "aspectRatio": "16:9",
    "personGeneration": "dont_allow",
    "durationSeconds": 8
  }
}

从图像生成视频

从图像生成视频。

参数:

  • image (字符串):Base64 编码的图像数据

  • prompt (字符串,可选):指导视频生成的文本提示

  • config (对象,可选):配置选项(与上面相同,但 personGeneration 仅支持“dont_allow”)

列出生成的视频

列出所有生成的视频。

MCP 资源

服务器公开以下 MCP 资源:

视频://{id}

通过 ID 访问生成的视频。

视频://模板

访问示例视频生成模板。

发展

项目结构

  • src/ :源代码

    • index.ts :主入口点

    • server.ts :MCP 服务器配置

    • config.ts :配置处理

    • tools/ :MCP 工具实现

    • resources/ :MCP 资源实现

    • services/ :外部服务集成

    • utils/ :实用函数

建筑

npm run build

开发模式

npm run dev

执照

麻省理工学院

Available Tools

7 tools
generateImageC

Generate an image from a text prompt using Google Imagen

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes
numberOfImagesNo
includeFullDataNo

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are provided, so the description must disclose behavioral traits. It does not mention side effects, authentication needs, rate limits, or whether the image is stored or returned directly.

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

Conciseness3/5

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

The description is a single sentence, which is concise. However, it sacrifices valuable information for brevity. Not every sentence earns its place when it omits critical details.

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

Completeness1/5

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

Given 3 parameters, no output schema, and no annotations, the description is severely incomplete. It does not explain return values or parameter behavior, leaving the agent without enough context to use the tool effectively.

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

Parameters1/5

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

Schema description coverage is 0%. The description adds no meaning beyond the parameter names and types in the input schema. It fails to explain prompt constraints, the number of images, or the includeFullData field.

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

Purpose5/5

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

The description clearly states the verb ('Generate'), the resource ('an image'), and the input ('from a text prompt using Google Imagen'). It effectively distinguishes from sibling tools focused on video generation or listing.

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?

No guidance on when to use this tool versus alternatives like getImage or listGeneratedImages. The description does not mention prerequisites, exclusions, or context for invocation.

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

generateVideoFromGeneratedImageC

Generate a video from a generated image (one-step process)

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes
aspectRatioNo16:9
videoPromptNo
autoDownloadNo
enhancePromptNo
negativePromptNo
numberOfImagesNo
numberOfVideosNo
durationSecondsNo
includeFullDataNo
personGenerationNodont_allow

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are present, and the description only mentions 'one-step process'. Important behavioral traits such as cost, async behavior, output format, and side effects are not disclosed. The description fails to compensate for the lack of annotations.

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

Conciseness2/5

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

The description is a single sentence, which is too brief given the tool's complexity (11 parameters). It is under-specified and does not effectively convey necessary information despite being concise.

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?

The description is minimal given the large parameter count and lack of output schema. It does not explain the overall workflow (e.g., whether the image is generated first or input is needed) or how the tool fits with siblings. Important context like return values and constraints is missing.

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

Parameters1/5

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

With 0% schema description coverage, the description must explain parameters but does not. None of the 11 parameters are described in the description, and the schema itself lacks descriptions. The agent cannot understand what parameters like 'autoDownload' or 'personGeneration' do.

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 states the action (generate video) and the source (generated image). However, it does not differentiate from the sibling tool 'generateVideoFromImage', which could lead to confusion about when to use this tool vs that one.

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?

No guidance is provided on when to use this tool versus alternatives like generateVideoFromImage or generateVideoFromText. There is no explanation of prerequisites or exclusions.

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

generateVideoFromImageC

Generate a video from an image

ParametersJSON Schema
NameRequiredDescriptionDefault
imageYes
promptNoGenerate a video from this image
aspectRatioNo16:9
autoDownloadNo
enhancePromptNo
negativePromptNo
numberOfVideosNo
durationSecondsNo
includeFullDataNo
personGenerationNodont_allow

TDQS

C2.5/5.0
Behavior2/5

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

No annotations are provided, and the description only states the basic operation. It does not disclose any behavioral traits such as processing time, image format requirements, or potential limitations, leaving the agent without important context.

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

Conciseness2/5

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

The description is a single sentence, which is under-specified for a tool with 10 parameters. It lacks structure and important details, making it minimally informative.

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

Completeness1/5

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

Given the complexity (10 parameters, no output schema, no annotations), the description is grossly incomplete. It fails to provide context for the output, parameter behavior, or usage scenarios.

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

Parameters1/5

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

The input schema has zero description coverage for parameters, and the description adds no meaning about any of the 10 parameters. Parameters like 'prompt', 'aspectRatio', 'durationSeconds' are not explained, so the agent cannot infer their purpose from the description.

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 generates a video from an image, using a specific verb and resource. However, it does not differentiate from sibling tool 'generateVideoFromGeneratedImage', which has a similar purpose.

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 usage when you have an image to convert to a video, but provides no explicit guidance on when to use this tool versus alternatives like 'generateVideoFromText' or 'generateVideoFromGeneratedImage'. No exclusions or context are given.

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

generateVideoFromTextC

Generate a video from a text prompt

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYes
aspectRatioNo16:9
autoDownloadNo
enhancePromptNo
negativePromptNo
numberOfVideosNo
durationSecondsNo
includeFullDataNo
personGenerationNodont_allow

TDQS

C2.6/5.0
Behavior1/5

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

With no annotations, the description bears full burden for behavioral transparency. It only states the basic function without disclosing any behavioral traits such as generation time, cost, success/failure handling, or return format. This is insufficient for responsible agent use.

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

Conciseness3/5

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

The description is very concise at one sentence, but given the tool's complexity (9 parameters), it is too brief. While front-loaded with the core action, it sacrifices necessary detail for brevity.

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

Completeness1/5

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

Considering the tool's complexity (9 parameters, no output schema, no annotations), the description is critically incomplete. It lacks details on output, behavior, parameter effects, and usage context, making it inadequate for correct agent selection and invocation.

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

Parameters2/5

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

Schema description coverage is 0%, yet the description adds no value by explaining parameters like enhancePrompt, autoDownload, includeFullData, or personGeneration. Agents must infer meaning from names alone, risking misuse. At minimum, key parameters should be explained.

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

Purpose5/5

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

The description 'Generate a video from a text prompt' clearly states the verb (Generate) and resource (video from text), distinguishing it from siblings like generateImage (image from text) and generateVideoFromImage (video from existing image). It's specific and unambiguous.

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 vs alternatives. It doesn't mention scenarios, prerequisites, or exclusions, leaving the agent without context for appropriate usage.

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

getImageB

Get a specific image by ID

ParametersJSON Schema
NameRequiredDescriptionDefault
idYes
includeFullDataNo

TDQS

B3.1/5.0
Behavior2/5

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

The description does not disclose behavioral traits beyond the basic operation. It lacks details about error handling, response format, or side effects. With no annotations, the description carries the full burden but provides minimal insight.

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, front-loaded sentence. Every word is necessary and there is no wasted information.

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 absence of an output schema, no parameter descriptions in the schema, and no annotations, the description is insufficient. It does not explain return values, error states, or the effect of optional parameters, leaving significant gaps for the agent.

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

Parameters2/5

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

The description only hints at the 'id' parameter through the phrase 'by ID', but does not explain the 'includeFullData' parameter. Schema description coverage is 0%, so the description should compensate but does not.

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

Purpose5/5

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

The description 'Get a specific image by ID' clearly states the verb (Get), resource (specific image), and method (by ID). It effectively distinguishes from sibling tools like generateImage, which are generative in nature.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it does not clarify that this tool is for retrieving existing images, while siblings handle generation or listing.

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

listGeneratedImagesB

List all generated images

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.4/5.0
Behavior2/5

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

No annotations provided; description does not disclose read-only nature, auth requirements, or any side effects. Simply states 'list all', offering no behavioral context.

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

Conciseness4/5

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

Extremely concise at one sentence, no wasted words. Could be slightly improved by front-loading key info, but currently adequate.

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?

Simple list tool with no params or output schema; however, lacks any mention of pagination or ordering, which may be necessary for 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?

Tool has zero parameters; schema coverage is 100%. Description adds no parameter info, but none is needed. Baseline 4 is appropriate for no-param tool.

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

Purpose5/5

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

Description clearly states verb (list) and resource (generated images), distinguishing from siblings like getImage (single) and generateImage.

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?

No guidance on when to use this tool vs alternatives; no mention of filtering, pagination, or context such as if the list is all images or scoped to a user.

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

listGeneratedVideosB

List all generated videos

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.3/5.0
Behavior1/5

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

No annotations provided, and the description merely repeats the tool name without disclosing any behavioral traits (e.g., pagination, scope of 'all', or read-only nature).

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?

Single, efficient sentence with no extraneous words. Appropriate for a simple list tool with no parameters.

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?

For a zero-parameter list tool, the description is acceptable but lacks details like result format, sorting, or limits. Could be improved with a note on scope or output structure.

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?

No parameters exist (schema is empty), so the description has no parameter semantics to add. Baseline 4 applies as the schema already covers 100% of parameters.

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

Purpose5/5

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

The description 'List all generated videos' clearly states the verb (List) and resource (generated videos), distinguishing it from siblings like generateImage, generateVideoFromText, and listGeneratedImages.

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?

No guidance on when to use this tool versus alternatives such as getImage or generateVideoFromText. The description does not specify context, prerequisites, or exclusions.

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. 7 tool updatesv1.0.0
    • First observedgenerateImage
    • First observedgenerateVideoFromGeneratedImage
    • First observedgenerateVideoFromImage
    • First observedgenerateVideoFromText
    • First observedgetImage
    • First observedlistGeneratedImages
    • First observedlistGeneratedVideos

TDQS

B3/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have distinct purposes, but generateVideoFromGeneratedImage and generateVideoFromImage overlap in functionality; one is described as 'one-step process' but the distinction is not immediately clear from names alone.

Naming Consistency4/5

Tool names follow a verb_noun pattern, but there is inconsistency: 'generateImage' uses a direct object while video tools use 'from' prepositional phrases. Also, 'getImage' differs from 'listGeneratedImages/listGeneratedVideos' in tense.

Tool Count5/5

With 7 tools, the set is well-scoped for an image/video generation server, covering creation and listing without being overly numerous.

Completeness3/5

The tool surface includes generation and listing but lacks retrieval of individual videos (no getVideo), update, and delete operations, leaving notable gaps in lifecycle management.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers