create-imageLABSCO SUMMARY
It handles the failure everyone else hits on image two.
Clients cap a tool response at 1MB, and a couple of high-resolution images blow straight past that as base64 — the error is unhelpful and the fix is not obvious. Switching to file output above the threshold is the whole difference between a demo and something you can use on real work, and it is why the absolute-path and writable-directory rules are worth reading before the first run.
What it is
An MCP server over OpenAI's image generation and editing APIs, usable against api.openai.com or an Azure OpenAI deployment. Two tools, a lot of options, and one piece of plumbing that matters more than it sounds.
What you get
create-image— text to image with size, quality and background options, andnup to 10 images in a single calledit-image— inpainting, outpainting and compositing, taking a file path or base64, with an optional mask that bounds where edits apply- Automatic file output: anything over the 1MB tool-response ceiling is written to disk and the path returned, which is what prevents
result exceeds maximum length of 1048576 - Azure OpenAI deployments alongside the standard API
- An
--env-fileargument so credentials can come from a file rather than the client config
Requirements
OPENAI_API_KEY, or the Azure trio AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT and OPENAI_API_VERSION. Image API access needs a verified OpenAI organization, and after verifying it can take 15–20 minutes to activate. Built from source with yarn install and yarn build, then run as node dist/index.js. MCP_HF_WORK_DIR sets where saved images land, defaulting to /tmp. File paths passed in must be absolute, and the output directory must be writable.
Setup effort
Build from source — git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git
USE CASES
Producing several options in one pass
Request up to ten images from one prompt with the size and quality you want, and pick from the batch.
Changing part of an image and leaving the rest alone
Supply a mask alongside the edit prompt so the model only touches the region you marked.
Keeping large output usable
Point MCP_HF_WORK_DIR at a real project directory so generated files land where you want them instead of /tmp.
2 tools
Listed in project docs. Your client may show a different list.
edit-imageBEFORE YOU INSTALL
What to know first
Tools you get
2 tools named in the project's documentation.
Requires
OPENAI_API_KEY in your environment
Optional
AZURE_OPENAI_API_KEY in your environment
Where it runs
All 4 documented clients run the server on your machine.
INSTALLATION
Connect your client
Server setup
git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git
cd openai-gpt-image-mcp
yarn install
yarn buildMCP Clients
VS Code
{
"servers": {
"openai-gpt-image-mcp": {
"command": "node",
"args": [
"<YOUR_PATH_TO_DIST>/index.js"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}The configuration on this page does not set AZURE_OPENAI_API_KEY; the project's instructions put it in a .env file. To supply AZURE_OPENAI_API_KEY without depending on where the server looks for that file, use the block's "env" section.
Cursor, Windsurf, Claude Desktop
{
"mcpServers": {
"openai-gpt-image-mcp": {
"command": "node",
"args": [
"<YOUR_PATH_TO_DIST>/index.js"
],
"env": {
"OPENAI_API_KEY": "<YOUR_OPENAI_API_KEY>"
}
}
}
}The configuration on this page does not set AZURE_OPENAI_API_KEY; the project's instructions put it in a .env file. To supply AZURE_OPENAI_API_KEY without depending on where the server looks for that file, use the block's "env" section.