Image Gen MCP
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., "@Image Gen MCP Create a square product icon with OpenAI, save to /Users/me/project/assets"
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.
โก Introduction
Image Gen MCP is a STDIO MCP server for generating images with OpenAI and Google Gemini. It lets AI coding tools create image assets and save them directly inside your project, without a separate image generation workflow or manual downloads.
Related MCP server: mcp-image
โจ Features
๐ง Two AI providers - Generate images with OpenAI or Google Gemini
๐ผ๏ธ Batch generation - Create several images in one request, with up to 10 jobs running at once
๐จ Image controls - Set size, quality, aspect ratio, format, and background when supported by the model
๐พ Explicit file output - Save generated images to a required absolute directory
๐ท๏ธ Clear filenames - Files include the requested name, provider, model, and timestamp
๐ Useful results - Get a summary of saved files and any jobs that failed
โ๏ธ Tech Stack
Language - TypeScript
Runtime - Node.js 20 or newer
MCP - Model Context Protocol server over STDIO
AI SDKs - OpenAI and Google Gen AI
Validation - Zod
Build tools - tsup and Biome
๐ฆ Installation
Requirements:
Node.js 20 or newer
An OpenAI API key, a Gemini API key, or both
An MCP-compatible client
Add the following server configuration to your MCP client. The exact location of this configuration depends on the client.
{
"mcpServers": {
"image-gen-mcp": {
"command": "npx",
"args": ["-y", "@s4shibam/image-gen-mcp"],
"env": {
"OPENAI_API_KEY": "your-openai-api-key",
"GEMINI_API_KEY": "your-gemini-api-key"
}
}
}
}You only need the API key for the provider you want to use. You can also place the keys in a .env file in the workspace where the MCP server runs:
OPENAI_API_KEY=your-openai-api-key
GEMINI_API_KEY=your-gemini-api-key๐ Quick Start
After connecting the server, ask your MCP client to create an image. For example:
Use Gemini model gemini-3.1-flash-image to create a 16:9 hero image for a coffee shop website. Save it as coffee-shop-hero in /Users/you/projects/coffee-shop/assets/images.Use OpenAI model gpt-image-2 to create three square product icons and save them in /Users/you/projects/store/assets/images.Every tool call must include absolute_output_directory. Relative paths are rejected, so the MCP server never depends on its process working directory.
Tools
Tool | Description | Main options |
| Generate one or more images with the OpenAI Image API |
|
| Generate one or more images with the Gemini Interactions API |
|
Each item in images needs:
prompt- What the image should containfilename- Base filename without an extension
๐ Notes
Output files
absolute_output_directory is required and must be an absolute directory path. The directory is created when it does not exist. For example:
/Users/you/projects/coffee-shop/assets/imagesFiles use this format:
{filename}-{provider}-{model}-{timestamp}.{ext}Example:
coffee-shop-hero-gemini-gemini-3.1-flash-image-1784412779099.jpgProvider options
OpenAI supports model-specific settings such as size, quality, output format, and background.
Gemini supports aspect ratio, image size, and JPEG output.
Not every option works with every model. The provider's API rules still apply.
If one image in a batch fails, successful images are still saved and the result lists each failure.
๐๐ป Contact
Available Tools
2 toolsgenerate_image_geminiA
Generate one or more images with Google Gemini (Nano Banana) via the Interactions API and save them to disk.
Use this when the user (or your plan) needs Gemini-generated assets for a website or app. Pass the Gemini image model id (e.g. gemini-3.1-flash-image, gemini-3-pro-image, gemini-2.5-flash-image), a list of prompt + filename pairs, the required absolute_output_directory, and optional response_format settings: aspect_ratio, image_size, mime_type.
Notes:
aspect_ratio: 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9, 1:8, 8:1, 1:4, 4:1.
image_size: 512, 1K, 2K, or 4K (uppercase K required).
mime_type: currently only image/jpeg is supported.
Images are written only to absolute_output_directory. It must be an absolute path; relative paths are rejected. Each file is named: {filename}-gemini-{model}-{timestamp}.{ext}
Inputs: model (required), images (required), absolute_output_directory (required), mime_type, +2 more.
generate_image_openaiA
Generate one or more images with OpenAI's Image API and save them to disk.
Use this when the user (or your plan) needs OpenAI-generated assets for a website or app. Pass the OpenAI image model id (e.g. gpt-image-2, gpt-image-1.5, gpt-image-1, dall-e-3), a list of prompt + filename pairs, the required absolute_output_directory, and optional settings: size, quality, background, output_format.
Notes:
size: standard GPT sizes are 1024x1024, 1536x1024, 1024x1536, or auto; gpt-image-2 also allows arbitrary WIDTHxHEIGHT (divisible by 16).
quality: low/medium/high/auto for GPT image models; standard/hd for dall-e-3.
background: transparent/opaque/auto; transparent is unsupported on gpt-image-2 and requires png or webp.
output_format: png, jpeg, or webp (GPT image models only).
Images are written only to absolute_output_directory. It must be an absolute path; relative paths are rejected. Each file is named: {filename}-openai-{model}-{timestamp}.{ext}
Inputs: model (required), images (required), absolute_output_directory (required), size, +3 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 2 tools
The two tools are clearly distinct: one generates images via Gemini, the other via OpenAI. Each has unique parameters (model lists, size formats, settings) that make selection unambiguous based on which provider the agent needs.
Both tools follow a consistent generate_image_{provider} pattern with snake_case naming. The verb 'generate' and noun 'image' are used uniformly, with the provider suffix distinguishing them clearly.
Two tools is on the thin side for a server, but for a focused image generation purpose, two tools (one per provider) is a reasonable and intentional scope. The slight deduction is for the low count.
The server covers image generation for two major providers, which covers the core generation workflow. However, there are no complementary operations like listing generated images, deleting them, or fetching generation historyโthe surface is purely one-directional (generate and save).
Related MCP Connectors
Generate AI images and videos from any compatible MCP client.
Generate AI video, images and audio, and browse your history, from any MCP client.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
Generate AI videos, images, music, and speech from any MCP client
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables generating images via OpenAI and images/videos via Google Gemini (including Veo video generation), saving outputs to local asset folders. It integrates with Claude Code and any MCP client using your own API keys.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants in MCP clients to generate and edit images by automatically expanding short requests into detailed prompts with composition, lighting, and camera direction, then saving results to disk. Supports Gemini, OpenAI, and BytePlus Seedream providers with selectable quality presets, aspect ratios, and image sizes.1,225 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables users to generate and edit images from MCP-compatible clients by automatically enhancing prompts with details like composition, lighting, and camera angle before sending them to Gemini, OpenAI, or BytePlus Seedream. Supports quality presets, multiple providers, and saving generated images to disk.1,225 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants in any MCP client to generate new images or edit existing ones by turning short requests into detailed prompts with configurable quality presets. Supports Gemini, OpenAI GPT Image, and BytePlus Seedream providers, saving results to disk and returning them as MCP resources.1,225 npmMIT