GPT Image MCP
Provides tools for generating and editing images using OpenAI's image models (DALL-E etc.).
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., "@GPT Image MCPgenerate a photo of a futuristic city skyline at night"
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.
GPT Image MCP
FastAPI + FastMCP service for generating and editing images with OpenAI image models.
What you get
MCP tools:
generate_image,edit_image,healthStreamable HTTP MCP transport at
POST /mcp/HTTP health check at
GET /healthStatic image hosting at
GET /images/{filename}Optional bearer auth for MCP and image routes
Upload validation, retry logic, structured logs, and image cleanup
Related MCP server: OpenAI Image Generation MCP Server
MCP tools
generate_imagecreates a new image from text.edit_imageedits one or more images and supports an optional mask.healthreturns a simple service status payload.
Environment variables
Copy the example file first:
cp .env.example .envRequired:
OPENAI_API_KEY- OpenAI API key
Optional:
PUBLIC_URL- public base URL for returned image linksMCP_API_KEY- bearer token required for/mcp/and/images/*IMAGE_DIR- image storage directoryLOG_LEVEL- logging level, defaultINFOMAX_UPLOAD_MB- max size for uploaded images, default50MAX_MASK_MB- max size for masks, default4MAX_IMAGE_EDGE_PX- max image edge length, default8192IMAGE_RETENTION_DAYS- cleanup retention window, default7CLEANUP_INTERVAL_SECONDS- cleanup interval, default86400OPENAI_RETRY_ATTEMPTS- retry count for OpenAI image calls, default3OPENAI_RETRY_BASE_DELAY_SECONDS- retry backoff base, default0.75REQUEST_TIMEOUT_SECONDS- timeout for remote image downloads, default60
Run locally
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8080The MCP endpoint is available at:
http://localhost:8080/mcp/
Run with Docker
docker compose up --buildTests
python3 -m unittest discover -s tests -p "test*.py" -vIf you have pytest installed:
pytest -qVerify on GitHub
git remote -v
git push -u origin mainIf you have not connected the repository yet:
git branch -M main
git remote add origin git@github.com:<your-username>/<your-repo>.git
git push -u origin mainNotes
POST /mcp/is the MCP transport endpoint expected by LobeHub.generate_imageandedit_imagereturn the same response shape.edit_imageaccepts image files stored underIMAGE_DIRor publichttp(s)URLs.Local paths outside
IMAGE_DIRand private or localhost remote URLs are rejected for security.Returned image URLs use
PUBLIC_URLwhen it is set, otherwise they fall back to/images/{filename}.Old images are cleaned up automatically according to
IMAGE_RETENTION_DAYS.
Troubleshooting
401 UnauthorizedSet
MCP_API_KEYon the server and sendAuthorization: Bearer <token>from the client.If you are using LobeHub or nginx, make sure the proxy forwards the
Authorizationheader.
404 Not Foundon/mcp/Use the trailing slash:
POST /mcp/.Confirm nginx proxies to the local container port and does not rewrite the path.
Verify the FastMCP server is mounted through
app.main:app.
Invalid imageorUnsupported imageUse a real PNG, JPEG, or WEBP input image.
For masks, use PNG only and keep the mask the same size as the first input image.
Check that the file is not corrupted and is smaller than
MAX_UPLOAD_MBorMAX_MASK_MB.
File not foundorRemote image hosterrorsKeep local file references under
IMAGE_DIR.Use public, reachable
http(s)URLs only.
OpenAI APIerrorsConfirm
OPENAI_API_KEYis set and valid.Check rate limits, quota, and model availability.
Verify the server has outbound network access to OpenAI.
Image URL is not reachable
Set
PUBLIC_URLto the external domain that serves the service.Make sure nginx serves
/images/correctly and the image directory is mounted into the container.
This server cannot be installed
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 Servers
- Alicense-qualityFmaintenanceAn MCP tool server that enables generating and editing images through OpenAI's image models, supporting text-to-image generation and advanced image editing (inpainting, outpainting) across various MCP-compatible clients.Last updated105MIT
- Alicense-qualityDmaintenanceProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.Last updated15Apache 2.0
- Alicense-quality-maintenanceEnables AI assistants to generate and edit images through OpenAI's DALL-E models via MCP tools. Supports text-to-image generation and image-to-image editing with configurable parameters for size, quality, and style.Last updated
- Alicense-qualityDmaintenanceMCP server that wraps OpenAI's image generation and editing APIs, enabling text-to-image and image-to-image operations via tools.Last updated61337ISC
Related MCP Connectors
Generate on-brand images from your AI agent: design, edit, and render templates over MCP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP server for Midjourney AI image generation and editing
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/Yularzhi/gpt-image-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server