image-gen-mcp
Provides image generation through OpenAI-compatible images/generations endpoints, allowing agents to create images from prompts with configurable size, count, and output filename.
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-mcpgenerate an image of a golden retriever sitting on a surfboard 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.
image-gen-mcp
MCP server (stdio, Node >= 18) that exposes one tool, generate_image, backed by any
OpenAI-compatible images/generations endpoint. Images are saved to disk and returned
inline, so the model can see the result. Ships with a Claude Code skill (skills/image-gen)
and can be installed as a Claude Code plugin.
Configuration
All configuration is through environment variables.
var | required | default | meaning |
| yes | Full URL of | |
| yes | API key | |
| yes | Model or deployment name | |
| no |
|
|
| no |
| Output folder |
If a required variable is missing the server still starts; the tool call returns an error naming the missing variables.
Azure AI Foundry
IMAGE_ENDPOINT=https://<resource>.services.ai.azure.com/openai/v1/images/generations
IMAGE_MODEL=<deployment name>
IMAGE_API_KEY=<key of that resource>OpenAI
IMAGE_ENDPOINT=https://api.openai.com/v1/images/generations
IMAGE_MODEL=gpt-image-1
IMAGE_AUTH_HEADER=Authorization
IMAGE_API_KEY=sk-...Related MCP server: mcp-vision-server
Install
Requires Node >= 18 and git (npx fetches the package from GitHub).
As a plugin (server + skill, recommended)
/plugin marketplace add IlTeo285/image-gen-mcp
/plugin install image-gen@image-gen-mcpThe server reads the variables above from the environment Claude Code was started from,
so set them (or launch through a secret manager) before starting claude.
MCP server only
claude mcp add image-gen --scope user \
-e IMAGE_ENDPOINT=... -e IMAGE_API_KEY=... -e IMAGE_MODEL=... \
-- npx -y github:IlTeo285/image-gen-mcpPassing the key with -e stores it in plain text in ~/.claude.json. Prefer the secret-manager
approach below and omit -e. This route does not install the skill: copy skills/image-gen/
into ~/.claude/skills/image-gen/.
To keep the key out of config files, launch Claude Code through a secret manager, for example
op run --env-file=image-gen.env -- claude with 1Password.
Tool
generate_image(prompt, size?, n?, filename?)
size: default1024x1024, passed through to the API.n: 1-4.filename: optional base name. Existing files are never overwritten.
Files are named YYYYMMDD-HHMMSS-<slug>.<ext>; the extension follows the API's output_format.
Development
npm install
npm testTests use node:test with a mocked fetch, plus one real stdio handshake against src/index.js.
Security
The API key is read from the environment only. It is never logged, and it is redacted from error messages.
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
AI image + video generation for agents: --flag prompt DSL, async generate/poll, x402 pay-per-use.
Generate AI images and videos from any compatible MCP client.
Generate AI images, videos, music, SFX & speech in any AI assistant. Results appear inline in chat.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT
- AlicenseAqualityBmaintenanceEnables image analysis, OCR, and text-to-image generation through OpenAI-compatible APIs. Supports local paths, URLs, or base64 images with configurable models and backup endpoints.3275 npmMIT
- AlicenseAqualityBmaintenanceEnables image generation and editing through OpenAI's gpt-image-2 model, supporting text-to-image, reference-guided generation, and editing with local files or URLs.275 npm2MIT
- FlicenseAqualityCmaintenanceEnables generating and editing images through OpenAI image models, with configurable output as saved files or returned URLs.2-