openai-imagegen-mcp
Enables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.
README
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
Installation
Install uv
On Mac you can install it using homebrew
brew install uv
Usage 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 project - For projects, consider using a path like
${PROJECT_ROOT}/generated-images - Defaults to
./imagesin the MCP server directory if not specified
-
When working in different projects:
- The agent will save images to
DEFAULT_SAVE_DIRby default - You can override this within each tool call using the
save_dirparameter - Images will be organized with unique timestamps to prevent conflicts
- The agent will save images to
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"
)
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.