openai-imagegen-mcp
Provides tools for generating and editing images using OpenAI's gpt-image-1 model, with options for customization and local storage.
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., "@openai-imagegen-mcpGenerate a serene mountain landscape at sunset with transparent background, save as 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.
OpenAI Image Generation MCP Server
A Model Context Protocol (MCP) Server that interfaces with the OpenAI API for image generation using the gpt-image-1 model.
Features
Generate images using OpenAI's gpt-image-1 model with various customization options
Edit images by providing source images and prompts
Save generated images to local storage in specified folders
Control image formats, quality, and background transparency
Related MCP server: OpenAI Image Generation MCP Server
Installation
Install uv
On Mac you can install it using homebrew
brew install uvUsage with Claude Code
Configure Claude Code to use this MCP server by updating your .cursor/mcp.json or other agent configuration:
{
"mcpServers": {
"openai-image": {
"command": "uv",
"args": [
"--directory",
"/Users/marabian/mcp-servers/openai-imagegen-mcp",
"run",
"mcp",
"run",
"main.py"
],
"env": {
"OPENAI_API_KEY": "your_api_key_here",
"DEFAULT_SAVE_DIR": "/path/to/default/save/directory"
}
}
}
}Important Configuration Notes:
Replace
your_api_key_herewith your actual OpenAI API key.For the
DEFAULT_SAVE_DIR:Set this to a directory where you want to save all generated images
You can use a relative path like
./imageswithin your projectFor projects, consider using a path like
${PROJECT_ROOT}/generated-imagesDefaults to
./imagesin the MCP server directory if not specified
When working in different projects:
The agent will save images to
DEFAULT_SAVE_DIRby defaultYou can override this within each tool call using the
save_dirparameterImages will be organized with unique timestamps to prevent conflicts
Available Tools
The OpenAI Image Generation MCP Server provides the following tools:
Image Generation
generate_image- Generate an image based on a text promptedit_image- Edit an existing image based on a new promptget_available_models- List available OpenAI image generation models
Image Management
list_saved_images- List images saved in the specified directoryset_save_directory- Set the directory where generated images will be saved
Examples
Generating an Image
# Generate a landscape image with transparent background
generate_image(
prompt="A serene mountain landscape at sunset",
size="1536x1024",
background="transparent",
output_format="png",
save_dir="/path/to/project/images",
filename="sunset_landscape"
)Editing Images
# Combine multiple source images into a new composition
edit_image(
prompt="Create a cohesive scene with these objects",
image_paths=["/path/to/image1.png", "/path/to/image2.png"],
quality="high",
save_dir="/path/to/project/edits",
filename="composed_scene"
)This server cannot be deployed
Maintenance
Related MCP Connectors
Generate and edit images and videos with imageat.
Generate AI images and videos from any compatible MCP client.
Create images and videos from prompts, with options for image mixing, reference images, and start/…
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.15Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables image generation using OpenAI's DALL-E and GPT-Image models directly through the Model Context Protocol. It allows users to create and save images with fine-grained control over parameters like size, quality, and background transparency.48 npmMIT
- AlicenseAqualityCmaintenanceEnables image generation and editing using OpenAI's GPT Image API (gpt-image-1, 1.5, 2) with support for multi-image generation, history management, and batch processing.12118 npm1MIT
- AlicenseBqualityBmaintenanceEnables generating images from text or transforming existing images using GPT-Image-compatible APIs, with support for OpenAI and Agnes AI backends.2MIT