gpt-image-1
A Model Context Protocol (MCP) server for generating and editing images using the OpenAI gpt-image-1 model.
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:
- Ensure Node.js is installed. You can verify with:
node -v
- Install and run the MCP server using NPX (no permanent installation required):
npx -y @cloudwerxlab/gpt-image-1-mcp
- 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
- 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"
- 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
any-chat-completions
MCP Server for using any LLM as a Tool
bitbucket
Bitbucket MCP - A Model Context Protocol (MCP) server for integrating with Bitbucket Cloud and Server APIs
mcp-llm
An MCP server that provides LLMs access to other LLMs
ClueoMCP
🎭 The Personality Layer for LLMs- Transform any MCP-compatible AI with rich, consistent personalities powered by Clueo's Big Five personality engine.
openai -agent-dotnet
Sample to create an AI Agent using OpenAI models with any MCP server running on Azure Container Apps
unity-editor
An MCP server and client for LLMs to interact with Unity Projects