ai-media-mcp
Allows generating images with OpenAI GPT image models (e.g. gpt-image-2) via an OpenAI-compatible API, supporting multiple images, reference images, and file-based output.
Click on "Install 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., "@ai-media-mcpGenerate a cinematic video of a city skyline at sunset"
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.
ai-media-mcp
A single-file, zero-dependency MCP server for image & video generation across GPT-Image / Gemini / Grok / Jimeng, with zero base64 โ everything is saved to disk and only file paths are returned.
Node.js 18+ required. No
npm install, no build step. Just run the.mjs.
โจ Features
๐ผ Image generation โ
generate_image: one OpenAI-compatible path, model name pass-through (gpt-image-2/gemini-3-pro-image/grok-imagine-image-quality/doubao-seedream/ Jimeng image models โฆ)๐ฌ Video generation โ
generate_video(submit only) /get_video_status(poll) /generate_video_and_wait(submit โ poll โ download). Auto-routes Grok video & Jimeng video.๐ Multi-key routing โ different models automatically use their own API key & base URL (common with relay/aggregator gateways).
๐ซ Zero base64 โ images/videos are saved to local disk; responses only contain
Saved to: ...(~350 bytes vs ~3 MB with typical MCP wrappers).๐ Capability lookup โ
list_model_capabilities: query supported resolutions / aspect ratios / durations per model; reverse-lookup (size: "720p",aspect_ratio: "21:9"). Zero cost.๐ผ Multi-reference images (image-to-image) โ
imagesarray (up to 5): Gemini native multi-image via multipleinlineData; GPT/Grok arrays with automaticedits โ generationsfallback. The requested model is preserved; GPT, Gemini, and Grok have each passed two-reference gateway tests.๐ฌ Reference-image video (image-to-video) โ single
image(Grokimage_url, Jimengfirst_frame_url) or multipleimages(Jimengreference_image_urlsup to 9, Grokimage_urlarray fallback).โ๏ธ Auto prompt enhancement โ
auto_prompt: true(default): if the prompt is < 15 chars and reference images are present, an internal "seamless fusion" template is applied (lighting / perspective / color grading / anti-cutout instructions verified on real generations).๐งช
@chatbox-latestโ passimage: "@chatbox-latest"to auto-read the most recent image dragged into the Chatbox window (chatbox-blobs\pictureinput-*). Repeated aliases inimagespreserve the UI attachment order.๐ Verifiable references โ every generated image reports ordered
reference_imagesmetadata derived from the exact bytes sent upstream: safe source label, MIME, byte count, dimensions, and SHA-256.๐ฅ Sandbox delivery โ callers can pass their writable sandbox as
output_dir, keepreturn_mode: "path", and turn returned files into download cards without moving files from unrelated external directories.
Related MCP server: imagen-mcp
๐ฆ Install
# Just clone/copy the mjs and run it directly
node ai-media-mcp.mjsNo npm dependencies. Add it to your MCP client (e.g. Chatbox / Claude Desktop) as a stdio server:
{
"command": "node",
"args": ["/path/to/ai-media-mcp.mjs"],
"env": { "...": "see .env.example" }
}โ๏ธ Configuration
All variables are optional. A group falls back to the unified AI_MEDIA_API_KEY / AI_MEDIA_BASE_URL only when its group variable is absent. If a group key is explicitly present but empty (for example AI_MEDIA_JIMENG_API_KEY=), that group is disabled and will not reuse another provider's key.
Variable | Group | Description |
| GPT |
|
| Gemini | native Gemini API ( |
| Grok |
|
| Jimeng |
|
| unified | fallback for all groups |
| โ | default image model ( |
| โ | default video model ( |
| โ | output dirs |
| โ |
|
| โ |
|
| โ | timeouts |
๐งญ Routing
By model name prefix:
Model prefix | Group | API |
| Gemini | native |
| Grok | OpenAI-compatible |
| Jimeng | task-based |
others ( | GPT | OpenAI-compatible |
๐ Tools
Tool | Purpose |
| Generate images (n, size/aspect_ratio/quality, |
| Submit a video task only (Grok/Jimeng auto-route, |
| Query task status |
| Submit โ poll โ download to |
| Query model capabilities (resolutions/ratios/durations), reverse-lookup by size or ratio |
| Probe actual supported sizes/ratios via minimal real calls, cache results |
๐ License
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI image generation through multiple providers including OpenAI GPT-Image-1, Google Imagen 4, Gemini 2.5 Flash (Nano Banana), Flux 1.1, Qwen Image, and SeedDream-4, supporting various formats, sizes, and advanced features like background control and seed-based reproduction.3810MIT
- AlicenseAqualityBmaintenanceEnables intelligent multi-provider image generation through OpenAI and Google Gemini APIs with automatic provider selection, support for reference images, real-time data grounding, and conversational refinement.8MIT
- FlicenseNot gradedqualityDmaintenanceEnables image generation, editing, and refinement using Google's Gemini 2.5 Flash Image model with support for multi-image composition and style transfer.
- FlicenseNot gradedqualityDmaintenanceEnables AI-powered image generation using Google's Gemini 2.5 Flash Image Preview model, supporting text-to-image and image-to-image generation through the MCP interface.
Related MCP Connectors
Generate images, video, and audio with Glif's media-generation agent
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/wojiaopanhaoran/ai-media-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server