Loading...

An MCP server facilitating image generation and editing via OpenAI's API, supporting file output and base64 encoding with automatic file saving for large images.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
An MCP server facilitating image generation and editing via OpenAI's API, supporting file output and base64 encoding with automatic file saving for large images.
This server is relatively safe for image generation and editing, but it requires careful management of the OpenAI API key and attention to file system permissions. The automatic file output feature enhances safety by preventing large payloads. Risky scenarios involve unmanaged API key exposure or generation of harmful content.
Performance depends on the OpenAI API and network latency. Generating multiple images concurrently may improve throughput but can also increase API costs.
Cost is directly related to OpenAI API usage. Monitor API usage to avoid unexpected charges. Consider optimizing prompts and image sizes to reduce costs.
{
"mcpServers": {
"openai-gpt-image-mcp": {
"command": "node",
"args": ["/absolute/path/to/dist/index.js"],
"env": { "OPENAI_API_KEY": "sk-..." }
}
}
}OPENAI_API_KEYAZURE_OPENAI_API_KEYAZURE_OPENAI_ENDPOINTcreate-imageGenerates images from a text prompt using OpenAI's image models.
Generates images, potentially consuming significant API credits and disk space.
edit-imageEdits or extends images using a prompt and optional mask, supporting file paths and base64 input.
Modifies existing images, with potential for unintended alterations and API usage.
API Key
This server is relatively safe for image generation and editing, but it requires careful management of the OpenAI API key and attention to file system permissions. The automatic file output feature enhances safety by preventing large payloads. Risky scenarios involve unmanaged API key exposure or generation of harmful content.
The level of autonomy depends on how the client application utilizes the MCP server's tools. Ensure proper input validation and output handling to control the image generation process.
Production Tip
Implement robust error handling and monitoring in the client application to track API usage and identify potential issues.
Set the AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and OPENAI_API_VERSION environment variables in the MCP server configuration.
Images are saved to /tmp or the directory specified by the MCP_HF_WORK_DIR environment variable.
The server automatically saves the image to disk and returns the file path instead of the base64 encoded image.
Provide a mask image (file path or base64) to specify the areas to be edited.
The server supports OpenAI's GPT-4o/gpt-image-1 models.
Yes, set the 'n' parameter in the create-image tool to generate up to 10 images at once.
Common image formats like PNG, JPEG, and GIF are supported. Check OpenAI documentation for specific format limitations.