image-gen-mcp
Generates images using OpenAI's gpt-image-2 model, allowing text-to-image generation and editing with reference images and masks, saving directly to specified paths.
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-mcpgenerate a 1024x1024 banner with a sunset and mountains, save as public/banner.png"
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.
image-gen-mcp
An MCP server that lets Claude Code generate real images to use in your projects (banners, icons, backgrounds, textures, etc.) with OpenAI gpt-image-2, and save them straight to a path you specify. It is meant for producing production assets — not for mocking up UI designs.
ภาษาไทย: ดู README.th.md
Tools
generate_image
Generate a new image from a text prompt and write it to a file.
param | values | default |
| text description of the image | — |
| where to save, e.g. | — |
|
|
|
|
|
|
|
| inferred from |
|
|
|
| 0-100 (jpeg/webp only) | — |
| 1-10 (if >1, saves |
|
| override the model |
|
edit_image
Edit / build on existing images. Pass 1-16 reference images, plus an optional mask for inpainting.
param | values |
| what to edit / create |
| 1-16 source (reference) image paths |
| where to save the result |
| (optional) mask for inpainting — transparent areas of the mask are what gets edited; must match the first image's dimensions |
+ |
Both tools return only { path, bytes, size, quality, ... } — never the raw image bytes (to avoid flooding the agent's context). A relative output_path is resolved against the calling project's CWD, and parent directories are created automatically.
Related MCP server: OpenAI Image Generation MCP Server
Install
cd image-gen-mcp
npm installConnect to Claude Code
Provide the API key via the server's env block in your MCP config (no .env file required) — in a project .mcp.json or a user-scoped config:
{
"mcpServers": {
"image-gen": {
"command": "node",
"args": ["/Users/palm/Desktop/projects/custom-mcp/image-gen-mcp/src/index.mjs"],
"env": { "OPENAI_API_KEY": "sk-..." }
}
}
}Or add it via the CLI:
claude mcp add image-gen -e OPENAI_API_KEY=sk-... -- node /Users/palm/Desktop/projects/custom-mcp/image-gen-mcp/src/index.mjsTest
npm run selftest # real in-memory MCP round-trip with a fake client — no key/network needed
OPENAI_API_KEY=sk-... npm run smoke # one real API call (quality low) that verifies a valid PNGPricing (approx., gpt-image-2, 1024x1024)
low ~$0.006 · medium ~$0.053 · high ~$0.211 per image — start at medium, use high only for final assets.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Latest Blog Posts
- 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/k12club/image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server