media-gen-mcp
Generates images using Google's Nano Banana models (Gemini 3 Pro Image and Gemini 3.1 Flash Image) and videos using Google's Veo 3.1 models, accessed via a LiteLLM/OpenAI-compatible gateway.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@media-gen-mcp Generate an image of a serene lake surrounded by autumn trees"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
media-gen-mcp
MCP server for AI image & video generation — Google Nano Banana (Gemini image) and Veo 3.1 (video) — routed through a LiteLLM / OpenAI-compatible gateway.
Inspired by hosted media MCPs like Higgsfield's: video generation is asynchronous with polling, and every asset comes back as a public URL (never inline base64), so agents can pass results around cheaply.
Tools
Tool | What it does |
| Text → PNG(s) with |
| Text (± reference image) → async Veo job. |
| Poll a job; on completion downloads the MP4 once, caches it, and returns its URL. |
| Browse recent generations (id, kind, model, prompt, URL), newest first. |
Related MCP server: Nanana AI Image Generation Server
How it works
agent ──MCP──▶ media-gen-mcp ──OpenAI API──▶ LiteLLM ──▶ Gemini (Nano Banana / Veo)
│
└── saves PNG/MP4 to MEDIA_DIR, serves at /files/* → URL back to agentImages:
POST /v1/images/generations(returns base64; decoded and stored here).Videos:
POST /v1/videos→ pollGET /v1/videos/{id}→GET /v1/videos/{id}/content.
The LiteLLM deployment must expose the four model aliases (nano-banana-pro,
nano-banana-2, veo-3.1, veo-3.1-lite) — see LiteLLM image generation
and video passthrough docs for the gemini/ provider mappings.
Quickstart (Docker)
cp .env.example .env # fill in LITELLM_BASE_URL, LITELLM_API_KEY, MCP_BEARER, PUBLIC_URL
docker compose up -d --build
curl -s localhost:8156/healthzEndpoints
Path | Auth | Purpose |
|
| Streamable-HTTP MCP endpoint (stateless — safe for concurrent clients). |
| none (unguessable names) | Generated assets, immutable-cached. |
| none | Liveness probe. |
The bearer is mandatory — each generation spends real money, so /mcp must never be
exposed unauthenticated.
Environment
Var | Required | Description |
| ✅ | LiteLLM / OpenAI-compatible gateway base URL. |
| ✅ | Key for the gateway — prefer a virtual key scoped to the media models with a budget. |
| ✅ | Static bearer required on |
| ✅ | Public base URL used to build the asset links returned by tools. |
| — | Asset storage dir (default |
| — | Listen port (default 8000). |
Connecting a client
Any MCP client that supports Streamable HTTP + bearer headers:
{
"mcpServers": {
"media-gen": {
"url": "https://your-host/mcp",
"headers": { "Authorization": "Bearer <MCP_BEARER>" }
}
}
}For local/stdio use (claude mcp add media-gen -- node build/index.js), set the same env
vars in .env.
Development
npm install
npm run dev # HTTP entrypoint with hot reload
npm run typecheck
npm run smoke # initialize + tools/list against a running server
SMOKE_GENERATE=1 npm run smoke # also runs one real (paid) image generationLicense
MIT
Available Tools
4 toolsgenerate_imageA
Generate one or more images from a text prompt using Google's Nano Banana models (Gemini image generation). Returns public URLs to the generated PNGs — pass those URLs onward instead of re-downloading the bytes. Synchronous: the call returns when the images are ready (typically a few seconds). Models: 'nano-banana-pro' (Gemini 3 Pro Image — highest quality, default) and 'nano-banana-2' (Gemini 3.1 Flash Image — faster and cheaper, good for drafts and iterations).
Inputs: prompt (required), n, model.
generate_videoA
Start an ASYNCHRONOUS video generation job with Google's Veo models. Returns a video_id immediately — poll it with the get_video tool every ~10s until status is 'completed', which yields the final MP4 URL. Optionally pass image_url to animate a still image (image-to-video). Models and cost: 'veo-3.1' (flagship quality with native audio, $0.40 per second of video, default) and 'veo-3.1-lite' ($0.05 per second — use for drafts and iterations).
Inputs: prompt (required), size, model, seconds, +1 more.
get_videoAIdempotent
Check a video generation job started by generate_video. While the job is running it returns the current status; once completed it downloads the MP4, stores it, and returns its public URL. Safe to call repeatedly — completed videos are cached.
Inputs: video_id (required).
list_generationsAIdempotent
Browse recently generated media (images and videos) with their public URLs, models, and prompts — newest first.
Inputs: limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: image generation (synchronous), video generation (asynchronous start), video polling/retrieval, and history listing. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern with snake_case: generate_image, generate_video, get_video, list_generations. No deviations.
Four tools is slightly on the low end but appropriate for a focused media generation service. Each tool earns its place and covers the core workflows.
The set covers image generation, video generation (with polling), and history listing. Minor gaps like a cancel tool for video jobs are not essential for a minimal viable surface.
Maintenance
Related MCP Connectors
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Image and video AI tools and your own pipelines, run from any AI assistant.
Make AI images and videos with Nano Banana, GPT Image, Veo, Kling and more, using your credits.
Generate AI images, video, voiceovers and music from Claude, ChatGPT or Cursor through 50+ models (Veo 3.1, Kling 3, Seedance, Nano Banana, GPT Image, ElevenLabs). Also image editing, upscaling, background removal, face swap, transcription, voice cloning and UGC-style video ads. Sign in with OAuth — no API key to paste. Tools are annotated (read-only vs. credit-spending); failed generations are refunded.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables video generation from text prompts or images using Google's Veo 3 API. Supports multiple models, audio generation, and various aspect ratios for creating high-quality videos.157 PyPI2MIT
- AlicenseAqualityDmaintenanceEnables AI assistants to generate images from text prompts and transform existing images using Google Gemini's nano banana model through the Nanana AI service. Supports both text-to-image generation and image-to-image transformation capabilities.2215 npm10MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to generate, edit, and analyze images using Google's Gemini image generation models including Nano Banana Pro (gemini-3-pro-image-preview).192 npm18MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to generate Nano Banana 2 images and Omni Flash/Veo 3.1 videos through Google Flow, with tools for checking render status and managing projects.2MIT