image-gen-mcp
Generates and edits images via OpenAI's gpt-image-2, saving them directly to specified file paths for production assets like banners and icons.
README
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 |
|---|---|---|
prompt * |
text description of the image | — |
output_path * |
where to save, e.g. public/images/banner.png |
— |
quality |
low | medium | high | auto |
medium |
size |
auto | 1024x1024 | 1536x1024 (landscape) | 1024x1536 (portrait) | 2048x2048 | WxH |
1024x1024 |
format |
png | jpeg | webp |
inferred from output_path extension |
background |
opaque | transparent | auto (transparent needs png/webp) |
auto |
compression |
0-100 (jpeg/webp only) | — |
n |
1-10 (if >1, saves name-1.ext, name-2.ext, ...) |
1 |
model |
override the model | gpt-image-2 |
edit_image
Edit / build on existing images. Pass 1-16 reference images, plus an optional mask for inpainting.
| param | values |
|---|---|
prompt * |
what to edit / create |
image_paths * |
1-16 source (reference) image paths |
output_path * |
where to save the result |
mask_path |
(optional) mask for inpainting — transparent areas of the mask are what gets edited; must match the first image's dimensions |
+ quality / size / format / background / compression / n / model — same as generate_image |
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.
Install
cd image-gen-mcp
npm install
Connect 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.mjs
Test
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 PNG
Pricing (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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.