Generate and edit images using OpenAI's GPT-4o image generation and editing APIs with advanced prompt control.
A Model Context Protocol (MCP) tool server for OpenAI's GPT-4o/gpt-image-1 image generation and editing APIs.
No installation needed! Use directly with npx:
{
"mcpServers": {
"openai-gpt-image": {
"command": "npx",
"args": ["openai-gpt-image-mcp-199bio"],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}
npm install -g openai-gpt-image-mcp-199bio
Or build from source:
git clone https://github.com/199-biotechnologies/openai-gpt-image-mcp.git
cd openai-gpt-image-mcp
yarn install
yarn build
The configuration shown above in the Quick Setup section works for all MCP-compatible clients:
Just add the configuration to your MCP client's config file with your OpenAI API key.
The tools now support common aspect ratios that automatically map to OpenAI's supported sizes:
1:1
, square
, 4:3
, 3:4
β 1024x102416:9
, landscape
, 3:2
β 1536x10249:16
, portrait
, 2:3
β 1024x1536auto
β Let OpenAI choose the best sizeExample: Instead of specifying size: "1536x1024"
, you can use size: "16:9"
or size: "landscape"
.
create-image
, set n
to generate up to 10 images at once.edit-image
, provide a mask image (file path or base64) to control where edits are applied.src/index.ts
for all options.src/index.ts
yarn build
node dist/index.js
MIT
OPENAI_API_KEY
is valid and has image API access./
(e.g., /path/to/image.png
):
(e.g., C:/path/to/image.png
or C:\path\to\image.png
)result exceeds maximum length of 1048576
.~/Pictures/gpt-image/
by default/tmp
(or the directory set by the MCP_HF_WORK_DIR
environment variable)file_output
path to override the defaultfilename
parameter (e.g., "cat-playing-football", "sunset-over-mountains")MCP_HF_WORK_DIR
: Set this to control the fallback directory for large images and file outputs. Example: export MCP_HF_WORK_DIR=/your/desired/dir
Manipulate Adventure Game Studio (AGS) compiled room (.crm) files to enable AI-powered game development.
Boost security in your dev lifecycle via SAST, SCA, Secrets & IaC scanning with Cycode.
Tools for Xcode project management, building, testing, archiving, code signing, and iOS development utilities.
Advanced code search and transformation powered by ugrep and ast-grep for modern development workflows.
Create and read feature flags, review experiments, generate flag types, search docs, and interact with GrowthBook's feature flagging and experimentation platform.
A test server that demonstrates all features of the MCP protocol, including prompts, tools, resources, and sampling.
Bring the full power of BrowserStackβs Test Platform to your AI tools, making testing faster and easier for every developer and tester on your team.
Fetches comprehensive information about NuGet packages from the NuGet Gallery, including READMEs, metadata, and search functionality.
Perform virtual try-ons using the HeyBeauty API.
A Binary Ninja plugin, MCP server, and bridge that seamlessly integrates Binary Ninja with your favorite MCP client.