create-image-mcp
Provides image generation and editing tools for OpenAI Codex via the MCP protocol.
Click on "Install 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., "@create-image-mcpCreate a serene mountain landscape at sunset"
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.
Create Image MCP Server
A Model Context Protocol (MCP) server that generates and edits images using OpenAI's GPT Image model (gpt-image-1.5). This server enables Claude Desktop, Claude Code, and other MCP clients to create images from text descriptions and edit existing images.
Features
Text-to-image generation via OpenAI GPT Image model
Image editing and style transfer with input image support
Configurable size, quality, and output format
Transparent background support
Multiple image variations in a single request
Images saved to disk with text-only responses (no base64 bloat)
Retry with exponential backoff for transient failures
Related MCP server: GPT Image MCP Server
Prerequisites
Node.js >= 20.0.0
OpenAI API Key
Installation
Option 1: NPM Global Install (Recommended)
npm install -g @gpriday/create-image-mcpThe create-image-mcp command will be available globally.
Option 2: Local Development Install
git clone https://github.com/gpriday/create-image-mcp.git
cd create-image-mcp
npm installConfiguration
Create a .env file in your project root or home directory (~/.env):
OPENAI_API_KEY=your_api_key_hereYou can get an OpenAI API key from OpenAI Platform.
For local development, validate your configuration with:
npm run check-envThe server will automatically load .env from:
Current working directory (
.env)Home directory (
~/.env) as fallbackOr use environment variables directly
Usage
Run the MCP Server
If installed globally:
create-image-mcpIf running locally:
npm startThe server runs on stdio and communicates via JSON-RPC 2.0.
Test the Server
npm test # Unit tests
npm run test:integration # Integration test with live API
npm run test:all # All testsAvailable Tools
create_image
Generate or edit images using OpenAI GPT Image.
Use when: user says "create an image", "generate a picture", "draw", "make an illustration", "edit an image", "transform a photo", or any visual content creation request.
Parameters:
Parameter | Required | Type | Default | Description |
| Yes | string | - | Image description or editing instructions (1-32,000 chars) |
| Yes | string | - | File path to save the generated image |
| No | array | - | File paths to input images for editing (supports PNG/JPEG/WebP/GIF, max 20MB each) |
| No | enum |
|
|
| No | enum |
|
|
| No | enum |
|
|
| No | integer |
| Number of variations (1-4) |
| No | enum |
|
|
Examples:
Generate a simple image:
{
"name": "create_image",
"arguments": {
"prompt": "A serene mountain landscape at sunset with golden light",
"output_file": "./landscape.png"
}
}Generate with specific settings:
{
"name": "create_image",
"arguments": {
"prompt": "A futuristic city skyline with flying cars, cyberpunk style",
"output_file": "./cyberpunk-city.png",
"size": "1536x1024",
"quality": "high",
"number_of_images": 2
}
}Generate with transparent background:
{
"name": "create_image",
"arguments": {
"prompt": "A minimalist flat vector logo of an owl",
"output_file": "./logo.png",
"background": "transparent"
}
}Edit an existing image:
{
"name": "create_image",
"arguments": {
"prompt": "Change the background to a beach scene",
"input_images": ["./photo.jpg"],
"output_file": "./edited-photo.png"
}
}Style transfer:
{
"name": "create_image",
"arguments": {
"prompt": "Make this image look like a watercolor painting",
"input_images": ["./source.png"],
"output_file": "./watercolor.png"
}
}Response Format:
The tool saves images to disk and returns a text-only response:
Image saved to: ./landscape.png (245.3 KB, image/png)For multiple images, files are numbered:
Image saved to: ./cyberpunk-city_1.png (312.1 KB, image/png)
Image saved to: ./cyberpunk-city_2.png (298.7 KB, image/png)Integration with Claude Desktop
Add this server to your Claude Desktop configuration.
If Installed Globally (Recommended)
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "create-image-mcp",
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "create-image-mcp",
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}Linux
Edit ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "create-image-mcp",
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}If Running Locally
macOS
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "node",
"args": ["/path/to/create-image-mcp/src/index.js"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}Windows
Edit %APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "node",
"args": ["C:\\path\\to\\create-image-mcp\\src\\index.js"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}Linux
Edit ~/.config/Claude/claude_desktop_config.json:
{
"mcpServers": {
"create-image": {
"command": "node",
"args": ["/path/to/create-image-mcp/src/index.js"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}After updating the configuration, restart Claude Desktop.
Integration with Claude Code
Option 1: Project-Level mcp.json (Recommended)
Add an mcp.json file to your project root. This is the simplest approach and works automatically when Claude Code opens the project.
Note: If
OPENAI_API_KEYis already set in your shell environment (e.g. in~/.zshrc,~/.bashrc, or~/.env), you can omit theenvfield entirely.
If installed globally:
{
"mcpServers": {
"create-image": {
"command": "create-image-mcp",
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}If running locally:
{
"mcpServers": {
"create-image": {
"command": "node",
"args": ["/path/to/create-image-mcp/src/index.js"],
"env": {
"OPENAI_API_KEY": "your_api_key_here"
}
}
}
}Option 2: CLI Command
For current project only:
claude mcp add --scope project create-image -e OPENAI_API_KEY=your_api_key_here -- create-image-mcpFor your user (available in all projects):
claude mcp add --scope user create-image -e OPENAI_API_KEY=your_api_key_here -- create-image-mcpVerify the server is running:
claude mcp listIntegration with OpenAI Codex
Add the MCP server using the codex mcp add command or by editing ~/.codex/config.toml.
Using CLI (Recommended)
If installed globally:
codex mcp add create-image --env OPENAI_API_KEY=your_api_key_here -- create-image-mcpIf running locally:
codex mcp add create-image --env OPENAI_API_KEY=your_api_key_here -- node /path/to/create-image-mcp/src/index.jsManual Configuration
Edit ~/.codex/config.toml:
[mcp.create-image]
command = "create-image-mcp"
env = ["OPENAI_API_KEY=your_api_key_here"]Development
Dependency Management
Semver Ranges: Dependencies use caret (
^) ranges for automatic patch/minor security updatesLockfile:
package-lock.jsonis committed for reproducible buildsCI/CD: Use
npm ci(notnpm install) to enforce lockfile versionsSecurity: Run
npm run security:auditregularly
Project Structure
create-image/
├── src/
│ └── index.js # Main MCP server
├── scripts/
│ └── check-env.js # Environment validation
├── test/
│ ├── unit/
│ │ ├── tool-handler.test.js # Unit tests
│ │ └── tool-description.test.js # Schema tests
│ └── test-create-image-mcp.js # Integration tests
├── package.json
├── package-lock.json # Committed for reproducibility
├── .env # API key (git-ignored)
├── .env.example # API key template
├── .gitignore
├── LICENSE
└── README.mdScripts
Development:
npm start- Start the MCP server (auto-runs environment validation)npm test- Run unit testsnpm run test:integration- Run integration testsnpm run test:all- Run all testsnpm run dev- Run server with auto-reload
Environment & Security:
npm run check-env- Validate environment configurationnpm run security:audit- Check for security vulnerabilitiesnpm run security:fix- Auto-fix security issuesnpm run security:update- Update dependencies and audit
Error Handling
The server provides categorized error handling:
Input Validation: Parameters validated for presence, type, length, and enum membership
[AUTH_ERROR]: Missing or invalid API keys
[QUOTA_ERROR]: API quota, rate limit, or billing errors
[TIMEOUT_ERROR]: Request timeout errors
[SAFETY_ERROR]: Content blocked by safety filters or content policy violations
[API_ERROR]: General API errors
Retry Logic: Transient failures retried with exponential backoff (up to 3 attempts)
Process Stability: Unhandled rejections and exceptions trigger clean shutdown
License
MIT
Contributing
Contributions welcome! Please open an issue or PR.
Support
For issues or questions:
Check the MCP documentation
Review OpenAI API docs
Open an issue in this repository
Available Tools
1 toolcreate_imageA
Generate or edit images using OpenAI GPT Image. Use when asked to 'create an image', 'generate a picture', 'draw', 'make an illustration', 'edit an image', 'transform a photo', or any visual content creation request. Supports image input for editing and style transfer.
| Name | Required | Description | Default |
|---|---|---|---|
| mask | No | File path to a PNG image with an alpha channel to use as a mask for targeted inpainting. Transparent areas of the mask indicate where the image should be edited. Only used with the edit endpoint (when input_images is provided). | |
| size | No | Size of the generated image. '1024x1024' for square, '1024x1536' for portrait, '1536x1024' for landscape, or 'auto' to let the model decide. | 1024x1024 |
| style | No | Optional style preset that guides image generation towards a specific visual style. | |
| prompt | Yes | A detailed description of the image to generate, or editing instructions when input images are provided. Be specific about style, composition, colors, mood, and subject matter for best results. | |
| quality | No | Quality of the generated image. 'high' produces the most detailed output, 'medium' balances quality and speed, 'low' is fastest, 'auto' lets the model decide. | auto |
| background | No | Background style for the generated image. 'transparent' generates images with a transparent background (requires PNG or WebP output), 'opaque' forces a solid background, 'auto' lets the model decide. | auto |
| output_file | Yes | File path to save the generated image. Supports both absolute paths (/Users/name/image.png) and relative paths (./output/image.png). The image will be written to this path and the path returned in the response. | |
| input_images | No | File paths to input images for editing or style reference. Supports PNG, JPEG, WebP, and GIF formats. Max 20MB per image. When provided, the prompt should describe how to modify or use these images. Accepts a single path string, a JSON-encoded array string, or an array of strings. | |
| input_fidelity | No | Controls how strictly the output image preserves the original input image details. 'high' preserves more details, 'low' allows more creative freedom. Only used with the edit endpoint (when input_images is provided). | |
| number_of_images | No | Number of image variations to generate (1-4). Multiple images are saved with numbered filenames (e.g., output_1.png, output_2.png). | |
| output_mime_type | No | Output image format. 'image/png' supports transparency, 'image/jpeg' for smaller file sizes, 'image/webp' for modern web use. | image/png |
| system_message_file | No | File path to a text file containing system-level instructions. The file contents are prepended to the prompt (truncated to 4000 chars). Use for persistent style guidelines, brand constraints, or negative constraints. Since the OpenAI images API does not support a native system role, the content is prepended to the prompt. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It only restates the tool's purpose and the fact that it supports image input, but does not disclose side effects like writing output to files, number of generated variants, or model limitations. The rich parameter descriptions help, but behavioral transparency beyond structured schema is minimal.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the core action, and every sentence adds value by providing usage triggers and capability context. There is no redundant or filler content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is complex with 12 parameters, but the schema is highly descriptive and covers all parameters with examples and defaults. The description adequately frames the high-level use cases, and the absence of an output schema and annotations is compensated by the detail in the input schema. It could mention file-saving side effects, but the output_file parameter already documents this.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description adds only marginal semantic context by noting that input images are used for editing and style transfer, which is already implied by the schema parameter descriptions. It does not substantially enhance parameter understanding beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it generates or edits images using OpenAI GPT Image and lists explicit trigger phrases ('create an image', 'generate a picture', 'draw', etc.). It is specific about the verb and resource, but since no sibling tools are provided, it cannot demonstrate differentiation from alternatives.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says 'Use when asked to...' and enumerates several concrete user request types. It provides clear context for when to invoke the tool, though it does not mention exclusions or alternatives because none are listed in the sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.2.0- First observed
create_image
TDQS
With only one tool, there is no possibility of confusion. The tool's name and description clearly define its purpose for image generation and editing.
The single tool name follows a clear verb_noun convention (create_image), which is consistent and predictable. There are no other tools to create inconsistency.
A single tool feels thin for a server, but it is appropriately scoped to a narrow domain of image creation and editing. It is borderline but functional.
The tool covers both generation and editing of images, fulfilling the stated purpose fully. There are no obvious gaps in the core lifecycle for this domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
MCP server for NanoBanana AI image generation and editing
MCP server for Midjourney AI image generation and editing
MCP server for Qwen Image 3 AI image generation
MCP server for OpenAI Sora AI video generation
Related MCP Servers
- FlicenseAqualityDmaintenanceAn MCP server that allows users to generate, edit, and create variations of images through OpenAI's DALL-E API, supporting both DALL-E 2 and DALL-E 3 models.49-
- FlicenseNot gradedqualityCmaintenanceAn MCP server that enables text-to-image generation and editing using OpenAI's gpt-image-1 model, supporting multiple output formats, quality settings, and background options.69-
- AlicenseAqualityDmaintenanceAn MCP server that provides AI image generation and editing capabilities using Google's Gemini 2.5 Flash Image API. It allows users to create new images from text, modify existing files, and perform iterative edits through natural language prompts.6758MIT
- FlicenseAqualityDmaintenanceAn MCP server for generating and editing images using OpenAI's GPT Image and DALL·E models. It provides tools for image generation, editing, variation creation, and model listing with support for multiple AI models.4-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/gregpriday/create-image-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server