OpenAI Image Generation
About
Generate and edit images using OpenAI's DALL-E models via the official Python SDK.
Details
- Author
- incomestreamsurfer
- Categories
- Developer Tools, AI, Other
- Tags
- #content-creation
Jump to
Setup
Install OpenAI Image Generation in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/incomestreamsurfer/chatgpt-native-image-gen-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
This project implements an MCP (Model Context Protocol) server that provides tools for generating and editing images using OpenAI'sgpt-image-1model via the official Python SDK.
This MCP server provides the following tools:
-
generate_image: Generates an image using OpenAI'sgpt-image-1model based on a text prompt and saves it.
- Input Schema:
{ "type": "object", "properties": { "prompt": { "type": "string", "description": "The text description of the desired image(s)." }, "model": { "type": "string", "default": "gpt-image-1", "description": "The model to use (currently 'gpt-image-1')." }, "n": { "type": ["integer", "null"], "default": 1, "description": "The number of images to generate (Default: 1)." }, "size": { "type": ["string", "null"], "enum": ["1024x1024", "1536x1024", "1024x1536", "auto"], "default": "auto", "description": "Image dimensions ('1024x1024', '1536x1024', '1024x1536', 'auto'). Default: 'auto'." }, "quality": { "type": ["string", "null"], "enum": ["low", "medium", "high", "auto"], "default": "auto", "description": "Rendering quality ('low', 'medium', 'high', 'auto'). Default: 'auto'." }, "user": { "type": ["string", "null"], "default": null, "description": "An optional unique identifier representing your end-user." }, "save_filename": { "type": ["string", "null"], "default": null, "description": "Optional filename (without extension). If None, a default name based on the prompt and timestamp is used." } }, "required": ["prompt"] }
edit_image: Edits an image or creates variations using OpenAI'sgpt-image-1model and saves it. Can use multiple input images as reference or perform inpainting with a mask.
- Input Schema:
{ "type": "object", "properties": { "prompt": { "type": "string", "description": "The text description of the desired final image or edit." }, "image_paths": { "type": "array", "items": { "type": "string" }, "description": "A list of file paths to the input image(s). Must be PNG. < 25MB." }, "mask_path": { "type": ["string", "null"], "default": null, "description": "Optional file path to the mask image (PNG with alpha channel) for inpainting. Must be same size as input image(s). < 25MB." }, "model": { "type": "string", "default": "gpt-image-1", "description": "The model to use (currently 'gpt-image-1')." }, "n": { "type": ["integer", "null"], "default": 1, "description": "The number of images to generate (Default: 1)." }, "size": { "type": ["string", "null"], "enum": ["1024x1024", "1536x1024", "1024x1536", "auto"], "default": "auto", "description": "Image dimensions ('1024x1024', '1536x1024', '1024x1536', 'auto'). Default: 'auto'." }, "quality": { "type": ["string", "null"], "enum": ["low", "medium", "high", "auto"], "default": "auto", "description": "Rendering quality ('low', 'medium', 'high', 'auto'). Default: 'auto'." }, "user": { "type": ["string", "null"], "default": null, "description": "An optional unique identifier representing your end-user." }, "save_filename": { "type": ["string", "null"], "default": null, "description": "Optional filename (without extension). If None, a default name based on the prompt and timestamp is used." } }, "required": ["prompt", "image_paths"] }
- Python (3.8 or later recommended)
- pip (Python package installer)
- An OpenAI API Key (set directly in the script or via theOPENAI_API_KEYenvironment variable -using environment variables is strongly recommended for security).
- An MCP client environment (like the one used by Cline) capable of managing and launching MCP servers.
- Clone the repository:
git clone https://github.com/IncomeStreamSurfer/chatgpt-native-image-gen-mcp.git cd chatgpt-native-image-gen-mcp
python -m venv venv source venv/bin/activate # On Windows use venv\Scripts\activate`
To make this server available to your AI assistant (like Cline), add its configuration to your MCP settings file (e.g.,cline_mcp_settings.json).
Find themcpServersobject in your settings file and add the following entry:
{ "mcpServers": { // ... other server configurations ... "openai-image-gen-mcp": { "autoApprove": [ "generate_image", "edit_image" ], "disabled": false, "timeout": 180, // Increased timeout for potentially long image generation "command": "python", // Or path to python executable if not in PATH "args": [ // IMPORTANT: Replace this path with the actual absolute path // to the openai_image_mcp.py file on your system "C:/path/to/your/cloned/repo/chatgpt-native-image-gen-mcp/openai_image_mcp.py" ], "env": { // If using environment variables for the API key: // "OPENAI_API_KEY": "YOUR_API_KEY_HERE" }, "transportType": "stdio" } // ... other server configurations ... } }
Important:ReplaceC:/path/to/your/cloned/repo/with the correct absolute path to where you cloned this repository on your machine. Ensure the path separator is correct for your operating system (e.g., use backslashes\on Windows). If you set the API key via environment variable, you can remove it from the script and potentially add it to theenvsection here if your MCP client supports it.
You don't typically need to run the server manually. The MCP client (like Cline) will automatically start the server using thecommandandargsspecified in the configuration file when one of its tools is called for the first time.
If you want to test it manually (ensure dependencies are installed and API key is available):
The AI assistant interacts with the server using thegenerate_imageandedit_imagetools. Images are saved within anai-imagessubdirectory created where theopenai_image_mcp.py`script is located. The tools return the absolute path to the saved image upon success.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Generate images using Amazon Nova Canvas with text prompts and color guidance.
Server for advanced AI-driven video editing, semantic search, multilingual transcription, generative media, voice cloning, and content moderation.
Generate images using the Together AI API. Supports custom aspect ratios, save paths, and batch generation.
Trim, watermark, extract audio from, and convert any video to 9:16 vertical — via REST API or MCP tools for Claude, Cursor, and other AI agents.
Generate images using OpenAI's DALL-E API.
Generate images from text using Flux and Stable Diffusion models.
Integrates the Dify AI API to generate Ant Design business component code. Supports text, image inputs, and streaming responses.
A server for the Fal.ai text-to-image API, powered by OpenAI's image model. Requires Fal.ai and OpenAI API keys.
Advanced text-to-image generation using the fal.ai Recraft v3 API.
A frontier image generation and editing model with advanced text rendering and contextual understanding, powered by the FAL AI API.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





