MCP Omni Server
This tool provides video generation (with optional embedded audio) using Google’s Gemini Omni model (gemini-omni-1.1-flash-preview) via the Vertex Interactions API. It is one of the MCP tools for Google Cloud Genmedia services, acting as an MCP server component to allow LLMs and other MCP clients to generate videos from a text prompt, optionally conditioned on input images and/or videos.
Unlike the other genmedia servers (which use the Vertex genai client), Omni is reachable only through the Interactions API, so this server calls the shared common.GenerateOmniVideo helper (which owns the Interactions client) rather than a genai.Client. The Interactions endpoint is global-only: LOCATION defaults to global and the API call is always made against the global endpoint.
MCP Tool Definitions
Section titled “MCP Tool Definitions”The server exposes the following tool:
1. omni_video_generation
Section titled “1. omni_video_generation”- Description: Generates video (with optional embedded audio) from a text prompt, optionally conditioned on input images and/or videos, using Google’s Gemini Omni model via the Vertex Interactions API. Returns MP4(s) saved locally and/or to GCS.
- Handler:
omniVideoGenerationHandler - Parameters:
prompt(string, required): The text prompt describing the video to generate.model(string, optional): Model to use. Can be the canonical model ID (gemini-omni-1.1-flash-preview) or a common alias (e.g.Omni,Gemini Omni 1.1 Flash). The priorgemini-omni-flash-previewremains selectable via its ID or theGemini Omni Flashalias. Seemcp-common/models.gofor the supported list. Defaults togemini-omni-1.1-flash-preview.images(array of string, optional): Up to 10 input images to condition generation on. Each entry is a local file path or ags://URI. The MIME type is inferred from the file extension:image/png,image/jpeg,image/webp,image/gif,image/heic,image/heif.videos(array of string, optional): Input videos to reference or edit. Each entry is a local file path or ags://URI (e.g.video/mp4,video/webm,video/quicktime).sample_count(number, optional): Number of videos to generate (1-3, default 1). Clamped to the model maximum of 3.temperature(number, optional): Sampling temperature,0.0-2.0(higher = more varied). Sent ingeneration_config.top_p(number, optional): Nucleus sampling probability mass,0.0-1.0. Sent ingeneration_config.output_directory(string, optional): Local directory to save the generated video(s) to. Filenames (omni_<timestamp>_<n>.mp4) are generated automatically unlessoutput_filenameis set.output_filename(string, optional): Base name for the output(s), e.g.clip.mp4. The extension is forced to the true video type and, when more than one video is generated, a_1..nsuffix is inserted before the extension. Applied identically to local files and GCS objects. See Naming Outputs.gcs_bucket_uri(string, optional): GCS URI prefix to store generated video(s) (e.g.,your-bucket/outputs/). If not provided andGENMEDIA_BUCKETis set,gs://<GENMEDIA_BUCKET>/omni_outputs/is used. For each uploaded video a best-effort V4 signed HTTPS URL is also returned (seeOMNI_SIGNED_URL_EXPIRY_HOURS).
Authentication
Section titled “Authentication”This server uses Application Default Credentials (ADC) to authenticate to the Vertex Interactions API — run gcloud auth application-default login locally, or rely on the attached service account when running on Google Cloud. The Interactions API is invoked against the global location only; per-region overrides do not apply to the Interactions call itself.
Environment Variable Configuration
Section titled “Environment Variable Configuration”The tool utilizes the following environment variables:
GOOGLE_CLOUD_PROJECT(string): Required. Your Google Cloud Project ID. The application will terminate if this is not set. Note:PROJECT_IDis also supported as a fallback.- Override: You can override this globally for this specific server by setting
OMNI_PROJECT_ID.
- Override: You can override this globally for this specific server by setting
GOOGLE_CLOUD_LOCATION(string): The preferred Google Cloud location. For Omni this defaults toglobaland the Interactions call is always made against theglobalendpoint.- Fallback:
LOCATIONis also supported as a fallback forGOOGLE_CLOUD_LOCATION. - Override: You can override this globally for this specific server by setting
OMNI_LOCATION.
- Fallback:
GENMEDIA_BUCKET(string): An optional default Google Cloud Storage bucket to use for GCS outputs if thegcs_bucket_uriparameter is not specified in the tool request. The pathomni_outputs/will be appended to this bucket.- Default:
""(empty string).
- Default:
OMNI_SIGNED_URL_EXPIRY_HOURS(number): Validity, in hours, of the V4 signed HTTPS URL returned for each uploaded video. Clamped to168(the V4 maximum);0disables signed-URL generation (thegs://URI is still returned). Signing under ADC without a private key requiresroles/iam.serviceAccountTokenCreatoron the runtime service account (non-fatal if absent).- Default:
24
- Default:
PORT(string, for HTTP transport): The port for the HTTP server to listen on.- Default:
"8080"
- Default:
Transports Supported
Section titled “Transports Supported”stdio(default)sse(Server-Sent Events)http(Streamable HTTP)
CORS is enabled for the HTTP transport, allowing all origins by default.
Build the tool using go build or go install.
- STDIO (Default):
Terminal window ./mcp-omni-go# or./mcp-omni-go -transport stdio - HTTP:
The MCP server will be available at
Terminal window ./mcp-omni-go -transport http# Optionally set PORT environment variable, e.g., PORT=8084 ./mcp-omni-go -transport httphttp://localhost:<PORT>/mcp. - SSE (Server-Sent Events):
The MCP server will be available at
Terminal window ./mcp-omni-go -transport sse# SSE server typically runs on port 8081 by default in this configuration.http://localhost:8081.
Examples
Section titled “Examples”Text-to-Video (omni_video_generation)
Section titled “Text-to-Video (omni_video_generation)”{ "method": "tools/call", "params": { "name": "omni_video_generation", "arguments": { "prompt": "A majestic eagle soaring over a mountain range at sunset.", "sample_count": 1, "gcs_bucket_uri": "your-gcs-bucket/omni_outputs", "output_directory": "./omni_videos" } }}Image-conditioned generation (omni_video_generation)
Section titled “Image-conditioned generation (omni_video_generation)”{ "method": "tools/call", "params": { "name": "omni_video_generation", "arguments": { "prompt": "Animate this landscape with a gentle breeze and flowing river.", "images": ["gs://your-gcs-bucket/source_images/landscape.png"], "output_directory": "./omni_videos" } }}