gemini-cli-media-generation
An example of using Gemini CLI with MCP Servers for Genmedia and Gemini 2.5 Flash Image model
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:
-
Install Node.js and npm if not already installed. Visit https://nodejs.org/ and follow the installer for your OS.
-
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
-
Install dependencies (if any) for the MCP server component: npm install
-
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
-
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.
-
Start the MCP server (example): npm run start
or node path/to/server.js (depending on your setup)
-
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
gemini-cli
An open-source AI agent that brings the power of Gemini directly into your terminal.
edumcp
EDUMCP is a protocol that integrates the Model Context Protocol (MCP) with applications in the education field, dedicated to achieving seamless interconnection and interoperability among different AI models, educational applications, smart hardware, and teaching AGENTs.
packt-netops-ai-workshop
🔧 Build Intelligent Networks with AI
gns3
AI-Powered GNS3 Network Simulation MCP Server
Youtube
YouTube MCP Server is an AI-powered solution designed to revolutionize your YouTube experience. It empowers users to search for YouTube videos, retrieve detailed transcripts, and perform semantic searches over video content—all without relying on the official API. By integrating with a vector database, this server streamlines content discovery.
gemini-code-assist
Model Context Protocol server integrating Google Gemini CLI with Claude Code for AI-powered development assistance