MCP Google Vertex AI Server

MCP Google Vertex AI Server

Enables AI image and video generation using Google Vertex AI's Imagen and Veo models, with support for configurable parameters and local storage.

Category
访问服务器

README

MCP Google Vertex AI Server

A Model Context Protocol (MCP) server that provides AI-powered image and video generation capabilities using Google Vertex AI's Imagen and Veo models.

Features

  • 🎨 Image Generation: Create AI images using Google's Imagen model
  • 🎬 Video Generation: Generate AI videos using Google's Veo model
  • 💾 Local Storage: Automatically save generated content to local server storage
  • 🔒 Secure Configuration: Environment-based configuration for API credentials
  • 🚀 Express v5: Built on the latest Express framework
  • 📝 TypeScript: Fully typed for better developer experience
  • ♻️ DRY Principles: Clean, maintainable, and reusable code architecture

Prerequisites

  • Node.js 24.0.0 or higher
  • Google Cloud Project with Vertex AI API enabled
  • Service account credentials with appropriate permissions

MCP Tools

generate-image

Generate AI images using the configured Imagen model (set via VERTEX_AI_IMAGE_MODEL).

Parameters:

Parameter Type Default Description
prompt string required Text description of the image to generate
numberOfImages number (1-8) 1 Number of images to generate
aspectRatio 1:1 | 3:4 | 4:3 | 9:16 | 16:9 1:1 Aspect ratio
imageSize 1K | 2K 2K Output resolution
outputMimeType image/png | image/jpeg image/png Output format
negativePrompt string Things to avoid in the image
guidanceScale number (1-20) How closely the model follows the prompt
seed number Random seed for reproducible results
enhancePrompt boolean false Auto-enhance the prompt before generation

Example:

{
  "name": "generate-image",
  "arguments": {
    "prompt": "A serene mountain landscape at sunset with a lake",
    "aspectRatio": "16:9",
    "numberOfImages": 2
  }
}

generate-video

Generate AI videos using the configured Veo model (set via VERTEX_AI_VIDEO_MODEL).

Parameters:

Parameter Type Default Description
prompt string required Text description of the video to generate
numberOfVideos number (1-4) 1 Number of videos to generate
durationSeconds number (4-8) 8 Clip length in seconds (4, 6, or 8)
aspectRatio 16:9 | 9:16 16:9 Aspect ratio
resolution 720p | 1080p | 4K 1080p Video resolution
seed number Random seed for reproducible results
negativePrompt string Things to avoid in the video
enhancePrompt boolean true Auto-enhance the prompt before generation
generateAudio boolean false Generate audio alongside the video
lastFrame string Image to use as the last frame (image-to-video)
referenceImages array Reference images to guide generation (see below)

Reference images (provide either a local file path, Cloud Storage URI, or public URL):

  • Local file path: /path/to/image.png
  • Cloud Storage URI: gs://my-bucket/image.jpg
  • Public URL: https://cdn.example.com/image.jpg

Supported formats: JPEG, PNG. Maximum size: 10 MB.

referenceImages supports up to 3 ASSET images or 1 STYLE image.

Example — text to video:

{
  "name": "generate-video",
  "arguments": {
    "prompt": "A butterfly flying through a garden of flowers",
    "durationSeconds": 8,
    "aspectRatio": "16:9",
    "resolution": "1080p"
  }
}

Example — image reference:

{
  "name": "generate-video",
  "arguments": {
    "prompt": "The product spinning on a white background",
    "referenceImages": [
      {
        "image": "/path/to/product.png",
        "referenceType": "ASSET"
      }
    ]
  }
}

Connecting to MCP Clients

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "google-vertex": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:3005/mcp"]
    }
  }
}

VS Code

Add to your .vscode/mcp.json:

{
  "servers": {
    "google-vertex": {
      "type": "http",
      "url": "http://localhost:3005/mcp"
    }
  }
}

MCP Inspector

Test your server with the MCP Inspector:

npx @modelcontextprotocol/inspector

Then connect to: http://localhost:3005/mcp

Architecture

The server follows clean architecture principles with separation of concerns:

  • Config Layer: Environment variable management and validation
  • Service Layer: Vertex AI integration and storage management
  • Tools Layer: Shared utilities (e.g. reference image resolution)
  • Server Layer: MCP protocol implementation and Express server setup

Error Handling

The server includes comprehensive error handling:

  • Graceful error responses for tool invocations
  • Detailed error messages for troubleshooting
  • Proper HTTP status codes

Performance Tips

  • Use appropriate aspect ratios and resolutions for your use case
  • Monitor Vertex AI quotas and billing
  • Consider implementing request queuing for high-traffic scenarios

License

MIT

Acknowledgments

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选