GPT Image 1 MCP
This server provides an MCP interface to OpenAI's GPT-Image-1 model, enabling:
Image Generation: Create images from text prompts with customizable size, quality, background, number of images, and output format
Image Editing: Modify existing images using text prompts with optional masks, supporting both base64 and file paths
Output Management: Automatically save generated/edited images to a configurable directory
Integration: Works seamlessly with MCP-compatible clients for streamlined AI image workflows
Reporting: Provides token usage information and comprehensive error handling with troubleshooting advice
Uses curl commands for proper MIME handling when working with image files, especially for the image editing functionality.
Runs as a Node.js application, with the MCP server requiring Node.js v14+ to function properly.
Available as an npm package that can be installed globally or run directly with npx, making it easy to integrate with various MCP clients.
Provides access to OpenAI's gpt-image-1 model for generating and editing images through text prompts, with capabilities for controlling image size, quality, background style, and output formats.
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., "@GPT Image 1 MCP create a logo for a coffee shop called 'Morning Brew'"
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.
π Quick Start
npx -y @cloudwerxlab/gpt-image-1-mcpπ Prerequisites
π Environment Variables
π» Example Usage with NPX
# Set your OpenAI API key
export OPENAI_API_KEY=sk-your-openai-api-key
# Optional: Set custom output directory
export GPT_IMAGE_OUTPUT_DIR=/home/username/Pictures/ai-generated-images
# Run the server with NPX
npx -y @cloudwerxlab/gpt-image-1-mcp# Set your OpenAI API key
$env:OPENAI_API_KEY = "sk-your-openai-api-key"
# Optional: Set custom output directory
$env:GPT_IMAGE_OUTPUT_DIR = "C:\Users\username\Pictures\ai-generated-images"
# Run the server with NPX
npx -y @cloudwerxlab/gpt-image-1-mcp:: Set your OpenAI API key
set OPENAI_API_KEY=sk-your-openai-api-key
:: Optional: Set custom output directory
set GPT_IMAGE_OUTPUT_DIR=C:\Users\username\Pictures\ai-generated-images
:: Run the server with NPX
npx -y @cloudwerxlab/gpt-image-1-mcpRelated MCP server: OpenAI MCP
π Integration with MCP Clients
π οΈ Setting Up in an MCP Client
{
"mcpServers": {
"gpt-image-1": {
"command": "npx",
"args": [
"-y",
"@cloudwerxlab/gpt-image-1-mcp"
],
"env": {
"OPENAI_API_KEY": "PASTE YOUR OPEN-AI KEY HERE",
"GPT_IMAGE_OUTPUT_DIR": "OPTIONAL: PATH TO SAVE GENERATED IMAGES"
}
}
}
}Example Configurations for Different Operating Systems
{
"mcpServers": {
"gpt-image-1": {
"command": "npx",
"args": ["-y", "@cloudwerxlab/gpt-image-1-mcp"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key",
"GPT_IMAGE_OUTPUT_DIR": "C:\\Users\\username\\Pictures\\ai-generated-images"
}
}
}
}{
"mcpServers": {
"gpt-image-1": {
"command": "npx",
"args": ["-y", "@cloudwerxlab/gpt-image-1-mcp"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key",
"GPT_IMAGE_OUTPUT_DIR": "/home/username/Pictures/ai-generated-images"
}
}
}
}Note: For Windows paths, use double backslashes (
\\) to escape the backslash character in JSON. For Linux/macOS, use forward slashes (/).
β¨ Features
π‘ Enhanced Capabilities
π How It Works
π Output Directory Behavior
Installation & Usage
NPM Package
This package is available on npm: @cloudwerxlab/gpt-image-1-mcp
You can install it globally:
npm install -g @cloudwerxlab/gpt-image-1-mcpOr run it directly with npx as shown in the Quick Start section.
Tool: create_image
Generates a new image based on a text prompt.
Parameters
Parameter | Type | Required | Description |
| string | Yes | The text description of the image to generate (max 32,000 chars) |
| string | No | Image size: "1024x1024" (default), "1536x1024", or "1024x1536" |
| string | No | Image quality: "high" (default), "medium", or "low" |
| integer | No | Number of images to generate (1-10, default: 1) |
| string | No | Background style: "transparent", "opaque", or "auto" (default) |
| string | No | Output format: "png" (default), "jpeg", or "webp" |
| integer | No | Compression level (0-100, default: 0) |
| string | No | User identifier for OpenAI usage tracking |
| string | No | Moderation level: "low" or "auto" (default) |
Example
<use_mcp_tool>
<server_name>gpt-image-1</server_name>
<tool_name>create_image</tool_name>
<arguments>
{
"prompt": "A futuristic city skyline at sunset, digital art",
"size": "1024x1024",
"quality": "high",
"n": 1,
"background": "auto"
}
</arguments>
</use_mcp_tool>Response
The tool returns:
A formatted text message with details about the generated image(s)
The image(s) as base64-encoded data
Metadata including token usage and file paths
Tool: create_image_edit
Edits an existing image based on a text prompt and optional mask.
Parameters
Parameter | Type | Required | Description |
| string, object, or array | Yes | The image(s) to edit (base64 string or file path object) |
| string | Yes | The text description of the desired edit (max 32,000 chars) |
| string or object | No | The mask that defines areas to edit (base64 string or file path object) |
| string | No | Image size: "1024x1024" (default), "1536x1024", or "1024x1536" |
| string | No | Image quality: "high" (default), "medium", or "low" |
| integer | No | Number of images to generate (1-10, default: 1) |
| string | No | Background style: "transparent", "opaque", or "auto" (default) |
| string | No | User identifier for OpenAI usage tracking |
Example with Base64 Encoded Image
<use_mcp_tool>
<server_name>gpt-image-1</server_name>
<tool_name>create_image_edit</tool_name>
<arguments>
{
"image": "BASE64_ENCODED_IMAGE_STRING",
"prompt": "Add a small robot in the corner",
"mask": "BASE64_ENCODED_MASK_STRING",
"quality": "high"
}
</arguments>
</use_mcp_tool>Example with File Path
<use_mcp_tool>
<server_name>gpt-image-1</server_name>
<tool_name>create_image_edit</tool_name>
<arguments>
{
"image": {
"filePath": "C:/path/to/your/image.png"
},
"prompt": "Add a small robot in the corner",
"mask": {
"filePath": "C:/path/to/your/mask.png"
},
"quality": "high"
}
</arguments>
</use_mcp_tool>Response
The tool returns:
A formatted text message with details about the edited image(s)
The edited image(s) as base64-encoded data
Metadata including token usage and file paths
π§ Troubleshooting
π¨ Common Issues
π Error Handling and Reporting
The MCP server includes comprehensive error handling that provides detailed information when something goes wrong. When an error occurs:
Error Format: All errors are returned with:
A clear error message describing what went wrong
The specific error code or type
Additional context about the error when available
AI Assistant Behavior: When using this MCP server with AI assistants:
The AI will always report the full error message to help with troubleshooting
The AI will explain the likely cause of the error in plain language
The AI will suggest specific steps to resolve the issue
π License
π Acknowledgments
Available Tools
2 toolscreate_imageD
Inputs: prompt (required), background, n, output_compression, +5 more.
create_image_editD
Inputs: image (required), prompt (required), background, mask, +4 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 2 tools
The two tools have overlapping purposesβboth involve creating imagesβand without descriptions, it's unclear how they differ. 'create_image_edit' suggests editing an existing image, but this could easily be confused with the base 'create_image' tool, leading to potential misselection.
Both tools follow a consistent verb_noun pattern with 'create_image' as the base, and 'create_image_edit' extends this logically. The naming is predictable and clear, with no deviations in style or convention.
With only 2 tools, the server feels thin for an image-related domain, which typically requires operations like listing, retrieving, updating, or deleting images. This limited set may not support common workflows, making it under-scoped.
The tool surface is severely incomplete for an image server; there are no tools for reading, updating, deleting, or managing images beyond creation and editing. This will cause significant agent failures in handling image lifecycles or varied tasks.
Maintenance
Related MCP Connectors
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
MCP server for Qwen Image 3 AI image generation
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.19MIT
- AlicenseNot gradedqualityFmaintenanceA Model Context Protocol server enabling AI assistants to generate images through OpenAI's DALL-E API with full support for all available options and fine-grained control.104 npm1MIT
- AlicenseDqualityDmaintenanceA Model Context Protocol server that provides image generation capabilities using Google's Gemini 2 API, allowing users to generate multiple images with customizable parameters like prompts, aspect ratios, and person generation settings.1310 npm5MIT
- AlicenseBqualityDmaintenanceA Model Context Protocol server that provides OpenAI's DALL-E 3 image generation capabilities, allowing LLMs to generate high-quality images through a standardized interface.114 npm1MIT