Get the FREE Ultimate OpenClaw Setup Guide →

gpt-image-1

A Model Context Protocol (MCP) server for generating and editing images using the OpenAI gpt-image-1 model.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio cloudwerx-dev-gpt-image-1-mcp npx -y @cloudwerxlab/gpt-image-1-mcp \
  --env OPENAI_API_KEY="PASTE YOUR OPENAI API KEY HERE" \
  --env GPT_IMAGE_OUTPUT_DIR="OPTIONAL: PATH TO SAVE GENERATED IMAGES"

How to use

This MCP server exposes the GPT Image 1 capabilities via an MCP client-friendly interface. It leverages OpenAI's gpt-image-1 model to generate new images from text prompts and to edit existing images using prompts and masks. Core commands exposed by the server include create_image for generating fresh visuals from prompts, and create_image_edit for modifying an existing image by applying edits guided by text prompts and optional masks. By running the MCP server with NPX, you can quickly prototype image generation workflows within your MCP client ecosystem and route results back to your editor or application.

To use the server from an MCP client, ensure you provide your OpenAI API key and (optionally) a dedicated output directory. The server will save generated images to disk and return metadata and image references in responses. Use the create_image tool to describe the scene you want, including prompts, seeds, resolution, and style preferences. Use create_image_edit to tweak an existing image by specifying a new prompt and any applicable masks to constrain edits. The MCP layer handles request/response formatting and preserves a consistent interface across supported clients.

How to install

Prerequisites:

  • Node.js 14+ installed on your machine
  • Access to OpenAI API with gpt-image-1 capabilities
  • An environment to run NPX commands (npm/yarn should be installed)

Installation steps:

  1. Ensure Node.js is installed. You can verify with:
node -v
  1. Install and run the MCP server using NPX (no permanent installation required):
npx -y @cloudwerxlab/gpt-image-1-mcp
  1. Set required environment variables when prompted or configure them in your MCP client settings:
export OPENAI_API_KEY=your-openai-key
export GPT_IMAGE_OUTPUT_DIR=/path/to/save/images
  1. If using Windows, set environment variables in PowerShell or Command Prompt equivalents. For example:
$env:OPENAI_API_KEY = "sk-..."
$env:GPT_IMAGE_OUTPUT_DIR = "C:\\Images\\ai-generated-images"
  1. Verify the server is accessible through your MCP client, then start issuing create_image and create_image_edit commands.

Additional notes

Tips and notes:

  • Ensure your OPENAI_API_KEY has access to the gpt-image-1 model endpoints.
  • If you want to organize outputs, set GPT_IMAGE_OUTPUT_DIR to a dedicated folder; the server will store generated images there.
  • When using Windows paths in JSON-based MCP configurations, escape backslashes (e.g., C:\Users\... ).
  • The NPX approach runs the package on demand; for production workloads, consider a persistent install or container deployment with the same environment variables.
  • The server responses include image references and metadata; use these to link images in your UI or downstream tooling.

Related MCP Servers

Sponsor this space

Reach thousands of developers