Image Gen MCP
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., "@Image Gen MCPCreate 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.
✨ 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
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
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/s4shibam/image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server