DEV Community

xbill for Google Developer Experts

Posted on • Originally published at xbill999.Medium on

Omni Flash Preview with Codex

This article covers the MCP setup and configuration for using Google Omni Preview and underlying Gemini LLM with Codex CLI to enhance and extend Omni operations over MCP.

What is Google Omni?

Google Gemini Omni (often referred to simply as Google Omni) is a powerful, multimodal AI video model developed by Google. It allows users to generate, edit, and iterate on video content using any combination of text, images, video, and audio inputs through simple, conversational prompts. [1, 2, 3]

More details are here:

https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-omni

Gemini Omni

and here:

Start building with Nano Banana 2 Lite and Gemini Omni Flash

But wait- there is more!

Gemini Omni Flash Preview | Gemini Enterprise Agent Platform | Google Cloud Documentation

Haven’t You Done this One Before?

What is old is new.

This article extends a previous article covering using Antigravity CLI with MCP servers. The original article is here:

Google Omni Flash Preview with MCP and Antigravity CLI

The same structured approach is used to enable Python MCP servers on Codex CLI.

This seems Pretty Basic- why even Bother?!

When configuring a new environment and new tools — the key to a successful deployment is to validate the basic building blocks for the approach. Python MCP servers allow CLI tools like Codex to be dynamically extended with a clear approach to enable minimal MCP tools. Before attempting more complicated MCP tools — a set of basic MCP commands with the simplest MCP protocol (stdio) is used to verify the functionality.

What is MCP?

Unless you have been living off grid without Internet- MCP is the new universal connector and next “Big Thing”.

More information is here:

What is Model Context Protocol (MCP)? A guide

Python MCP Documentation

The official GitHub Repo provides samples and documentation for getting started:

GitHub - modelcontextprotocol/python-sdk: The official Python SDK for Model Context Protocol servers and clients

Isn’t MCP overkill?

There are many ways to call the Omni models. Native MCP support in Codex opens up a new pathway to call the underlying Omni model.

So what is the Secret Sauce?

The Interactions API allows for a clean consistent call to the model.

The Interactions API is Google’s unified interface for building with Gemini AI models and autonomous agents. Rather than using multiple separate endpoints for text chat, tool use, image generation, or background agents, it provides a single, streamlined API to handle complex, stateful workflows. [1, 2, 3]

More information is here:

Interactions API | Gemini API | Google AI for Developers

and here:

Gemini Interactions API | Gemini API | Google AI for Developers

There is A Skill for That!

You can make the magic happen!

Interactions API: our primary interface for Gemini models and agents

npx skills add google-gemini/gemini-skills --skill gemini-interactions-api
Enter fullscreen mode Exit fullscreen mode

Setup the Basic Environment

At this point you should have a working Python environment and a working Codex CLI installation. The next step is to clone the GitHub samples repository with support scripts:

cd ~
git clone https://github.com/xbill9/omni-flash-video-agent-codex
Enter fullscreen mode Exit fullscreen mode

Then run init.sh from the cloned directory.

The script will attempt to determine your shell environment and set the correct variables:

cd omni-flash-video-agent-codex
source init.sh
Enter fullscreen mode Exit fullscreen mode

If your session times out or you need to re-authenticate- you can run the set_env.sh script to reset your environment variables:

cd omni-flash-video-agent-codex
source set_env.sh
Enter fullscreen mode Exit fullscreen mode

Variables like PROJECT_ID need to be setup for use in the various build scripts- so the set_env script can be used to reset the environment if you time-out.

Running the Python Code

First- switch the directory with the Python version of the MCP sample code:

xbill@penguin:~/omni-flash-video-agent-codex$ make install
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

The project can also be linted:

xbill@penguin:~/omni-flash-video-agent-codex$ make lint
ruff check .
All checks passed!
ruff format --check .
4 files already formatted
mypy .
Success: no issues found in 4 source files
Enter fullscreen mode Exit fullscreen mode

Codex CLI MCP Config

A sample MCP config file:

[mcp_servers.omni-video-agent]
command = "/home/xbill/.pyenv/shims/python"
args = ["/home/xbill/omni-flash-video-agent-codex/server.py"]
enabled = true
Enter fullscreen mode Exit fullscreen mode

Validation with Codex CLI

The final connection test uses Codex CLI as a MCP client with the Python code providing the MCP server:

/mcp

🔌 MCP Tools

  • codex_apps
    • Auth: Bearer token
    • Tools: (none)

  • omni-video-agent
    • Auth: Unsupported
    • Tools: animate_image, edit_user_video, edit_video, generate_video, generate_with_subjects, get_help,
    interpolate_images, upload_to_youtube
Enter fullscreen mode Exit fullscreen mode

Omni Video Management via MCP

The MCP tools provide a complete suite of agent-oriented operations for managing the Omni Video calls.

Overview of MCP tools :

• get_help returns the project’s inline guide for the Gemini Omni Flash Video Agent.

  Available tools:

  1. generate_video
  2. edit_video
  3. animate_image
  4. interpolate_images
  5. generate_with_subjects
  6. edit_user_video
  7. upload_to_youtube
  8. get_help

  Delivery modes:

  - inline: base64 video data, best for small clips under 4 MB.
  - uri: Google File API delivery, recommended for larger clips.

  Prompting guidance:

  - Describe scene layout, subjects, clothing, and spatial arrangement.
  - Be specific about subject movement.
  - Include camera motion like pan, tracking shot, crane shot, or slow zoom.
  - Specify lighting and mood.
  - State the visual style clearly.

Enter fullscreen mode Exit fullscreen mode

We have Lift Off!

Finally- the MCP tools are now available for working with the Omni models:

use the mcp tool generate_video to create a video of the kiro ghost in a futuristic data center


https://www.youtube.com/watch?v=qpXWySOHFSQ
Enter fullscreen mode Exit fullscreen mode


   omni-video-
        agent.edit_video({"previous_interaction_id":"v1_ChdheWxKYXVEaUJmQzVzT0lQbG9haTJRSRIXYXlsSmF1RGlCZkM1c09
        JUGxvYWkyUUk","edit_prompt":"Edit the existing video to add a small friendly nano banana companion
        beside the Codex mascot. Make it a cute futuristic banana-shaped AI sidekick with tiny glowing eyes,
        polished yellow-and-silver materials, subtle circuit-line details, and a gentle hovering motion. Keep
        the original futuristic data center, holographic code panels, lighting, camera movement, and Codex
        mascot consistent. The companion should appear naturally in the scene, floating alongside the mascot
        and reacting as the mascot orchestrates streams of light. High-detail photorealistic 3D animation, warm
        futuristic tone, no text overlays, no logos, no watermarks.","delivery":"inline"})
    🟢 Video successfully saved!
     Saved to: /home/xbill/omni-flash-video-agent-codex/edit_1783181125.mp4
     Delivery mode: inline
     Interaction ID: v1_ChdheWxKYXVEaUJmQzVzT0lQbG9haTJRSRIXUkM5SmFwT3hJcEs5MU1rUDRPcmR1UW8

https://www.youtube.com/watch?v=dIaWhrJR0vA
Enter fullscreen mode Exit fullscreen mode


 Called
   omni-video-agent.animate_image({"image_path":"/home/xbill/omni-flash-video-agent-codex/
        gen_1783111489_1ac76ec9.jpg","motion_prompt":"Animate this image into a cinematic 10-second video.
        Preserve the original subject, composition, style, colors, and lighting. Add subtle lifelike motion
        appropriate to the scene, gentle parallax depth, soft atmospheric movement, and a smooth slow camera
        push-in. Keep the animation polished and natural with no text overlays, no logos, and no
        watermarks.","delivery":"inline"})
    🟢 Video successfully saved!
     Saved to: /home/xbill/omni-flash-video-agent-codex/animated_1783181403.mp4
     Delivery mode: inline
     Interaction ID: v1_ChdXVEJKYXYzVk1aUEFzT0lQeV9YeXVROBIXV1RCSmF2M1ZNWlBBc09JUHlfWHl1UTg

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

 The animation succeeded. I’ll verify the output file and size.

 Explored
   List animated_1783181403.mp4

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

 Animated video saved here:

  animated_1783181403.mp4

  Interaction ID:

  v1_ChdXVEJKYXYzVk1aUEFzT0lQeV9YeXVROBIXV1RCSmF2M1ZNWlBBc09JUHlfWHl1UTg

  Size: 2.5 MB.


https://www.youtube.com/watch?v=WlKzO-r_HYw
Enter fullscreen mode Exit fullscreen mode


> interpolate_images banana.jpg Codex.jpg

 Called
   omni-video-agent.interpolate_images({"start_image_path":"/home/xbill/omni-flash-video-agent-codex/
        banana.jpg","end_image_path":"/home/xbill/omni-flash-video-agent-codex/codex.jpg","prompt":"Create a
        smooth cinematic 10-second interpolation transition from the banana image to the Codex image. Preserve
        the visual style and lighting continuity while the first image gradually transforms into the second.
        Add subtle parallax depth, gentle camera motion, soft atmospheric lighting, and a polished futuristic
        transition feel. No text overlays, no logos, no watermarks.","delivery":"inline"})
    🟢 Video successfully saved!
     Saved to: /home/xbill/omni-flash-video-agent-codex/interpolation_1783181661.mp4
     Delivery mode: inline
     Interaction ID: v1_ChdXekZKYXBMX0pKYTAxTWtQX015Q3FRbxIXV3pGSmFwTF9KSmEwMU1rUF9NeUNxUW8

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

 The interpolation succeeded. I’ll verify the generated MP4 and size.

 Explored
   List interpolation_1783181661.mp4

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

 Interpolation video saved here:

  interpolation_1783181661.mp4

  Interaction ID:

  v1_ChdXekZKYXBMX0pKYTAxTWtQX015Q3FRbxIXV3pGSmFwTF9KSmEwMU1rUF9NeUNxUW8

  Size: 2.6 MB.

https://www.youtube.com/watch?v=rGshv20b1Qg
Enter fullscreen mode Exit fullscreen mode


 Called
        generated cinematic interpolation transitioning from a banana image into a Codex image with smooth
        motion, parallax depth, and atmospheric lighting.","category_id":"22","privacy_status":"public"})
• I’ll use both images as subject references and generate a new scene featuring them together.

◦ Calling
  └ omni-video-agent.generate_with_subjects({"subject_image_paths":["/home/xbill/omni-flash-video-agent-codex/
        banana.jpg","/home/xbill/omni-flash-video-agent-codex/codex.jpg"],"prompt":"Create a cinematic 10-
        second video featuring both referenced subjects together: the banana companion and the Codex mascot.
        Preserve their recognizable visual identities from the reference images. Place them in a futuristic
        data center with transparent server racks, flowing blue and green data streams, holographic code
        panels, polished reflective floors, and warm volumetric lighting. The Codex mascot walks confidently
        while the banana companion hovers playfully beside it, reacting to streams of light as they move
        through the scene. Smooth tracking camera motion, high-detail photorealistic 3D animation, polished
        futuristic tone, no text overlays, no logos, no watermarks.","delivery":"inline"})


https://www.youtube.com/watch?v=CYcNQaVxldA
Enter fullscreen mode Exit fullscreen mode


 Called
   omni-video-agent.edit_user_video({"video_path":"/home/xbill/omni-flash-video-agent-codex/
        subject_1783181961.mp4","edit_prompt":"Restyle this video into a richly detailed steampunk version
        while preserving the Codex mascot, banana companion, main composition, motion, and timing. Transform
        the futuristic data center into a brass-and-copper steampunk machine room with glowing vacuum tubes,
        exposed gears, analog gauges, polished pipes, warm amber lighting, steam wisps, and Victorian
        industrial details. Keep the scene cinematic, high-detail, and polished. No text overlays, no logos, no
        watermarks.","delivery":"inline"})
    🟢 Video successfully saved!
     Saved to: /home/xbill/omni-flash-video-agent-codex/user_edit_1783182179.mp4
     Delivery mode: inline
     Interaction ID: v1_ChdZak5KYXJ5QkdmNkQtOFlQd05qT29BRRIXWWpOSmFyeUJHZjZELThZUHdOak9vQUU

───────────────────────────────────────────────────────────────────────────────────────────────────────────────

 Explored
   List user_edit_1783182179.mp4
  Interaction ID:

  v1_ChdZak5KYXJ5QkdmNkQtOFlQd05qT29BRRIXWWpOSmFyeUJHZjZELThZUHdOak9vQUU

  Size: 2.6 MB.

 Worked for 1m 38s ───────────────────────────────────────────────────────────────────────────────────────────



https://www.youtube.com/watch?v=F8zymvxCFyk
Enter fullscreen mode Exit fullscreen mode

One last thought- Where are Agents?

Where are the Agents?

The Codex CLI harness itself uses agents to manage the workflow.

The additional touch point for leveraging the MCP interface is that they all are exposed as MCP tools. The MCP tools can be called directly from Agent code or used as a template for Interactions API calls embedded in an Agent.

Summary

The strategy for using MCP with Omni and Codex CLI was validated with a incremental step by step approach.

A minimal stdio transport MCP Server was started from Python source code and validated with Codex CLI running as a MCP client in the same local environment. This Python server provided all of the management tools to interact with the Omni models.

Top comments (0)