Get the FREE Ultimate OpenClaw Setup Guide →

gemini-cli-media-generation

An example of using Gemini CLI with MCP Servers for Genmedia and Gemini 2.5 Flash Image model

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio vladkol-gemini-cli-media-generation node path/to/server.js \
  --env GCP_REGION="your-region (e.g. us-central1)" \
  --env GCS_BUCKET="your-gcs-bucket-name" \
  --env GCP_PROJECT_ID="your-google-cloud-project-id"

How to use

This MCP server exposes Gemini CLI-based media generation capabilities via MCP Genmedia integration. It leverages Vertex AI Creative Studio workflows (Imagen, Veo, and AVTool servers) to concept, ideate, and generate media assets (images and videos) through Gemini CLI within an MCP framework. You can configure the Gemini CLI sessions to drive iterative media generation, leveraging the included environment to manage your Google Cloud project, region, and storage bucket. Once the server is running, you can connect Gemini CLI to the MCP server flow and issue prompts to generate or edit media assets, while the MCP layer handles orchestration, caching, and session state.

To use it, start the MCP server using the provided configuration, ensure your environment variables point to your GCP project and storage bucket, and then use Gemini CLI within the workflow to request generation steps (e.g., image prompts, style guidance, and scene continuity). The setup supports iterative ideation: after each generation, you can refine prompts, switch models (Imagen, Veo, AVTool), and re-run steps to converge on a final set of media assets suitable for your project.

How to install

Prerequisites:

  • Node.js (LTS version) and npm installed on your machine
  • Git installed
  • Access to a Google Cloud project with Vertex AI and Cloud Storage enabled
  • A destination Cloud Storage bucket for generated assets

Step-by-step installation:

  1. Install Node.js and npm if not already installed. Visit https://nodejs.org/ and follow the installer for your OS.

  2. Clone this repository (or prepare your MCP server package if you have a custom deployment): git clone https://github.com/vladkol/gemini-cli-media-generation cd gemini-cli-media-generation

  3. Install dependencies (if any) for the MCP server component: npm install

  4. Create a .env file or use the provided environment variable configuration to set your Google Cloud project, region, and storage bucket. Example .env content: GCP_PROJECT_ID=your-project-id GCP_REGION=us-central1 GCS_BUCKET=your-gcs-bucket-name

  5. Adjust the MCP server configuration to point to your Node server entry point. For example, ensure path/to/server.js is the actual path to your MCP server script.

  6. Start the MCP server (example): npm run start

    or node path/to/server.js (depending on your setup)

  7. Verify the server is running and reachable via your MCP orchestration tooling. Check logs for any environment-related errors and confirm that the Gemini CLI workflows can connect to this MCP server.

Additional notes

Tips and notes:

  • Ensure Vertex AI APIs are enabled in your Google Cloud project and that the Vertex AI Service Agent has access to your Cloud Storage bucket.
  • Keep your .env or environment variables secure and do not commit sensitive values to version control.
  • This repository demonstrates an MCP-based integration with Gemini CLI and Genmedia workflows. Adapt the server entry point path and environment details to match your deployment environment.
  • If you encounter authentication issues with Google Cloud, re-authenticate using gcloud and ensure the service account used by the MCP server has proper permissions on the bucket and Vertex AI resources.
  • When testing prompts, consider saving intermediate results to the generated_images or prompts directories (as appropriate for your workflow) to support iterative refinements.

Related MCP Servers

Sponsor this space

Reach thousands of developers