mcp-server-openai-image-generator
Generates images from text prompts using the OpenAI Images API, saves them locally, and serves them via HTTP.
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., "@mcp-server-openai-image-generatorgenerate a digital painting of an astronaut riding a horse on Mars"
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.
mcp-server-openai-image-generator
An MCP (Model Context Protocol) server that exposes an OpenAI image generation tool over HTTP. It generates images from text prompts, saves them locally, and serves them via an integrated static file server.
Stack
Runtime / Language: Bun + TypeScript
MCP Transport: HTTP — standard JSON responses (
POST /mcp)Image generation: OpenAI Images API (
gpt-image-2by default)CORS:
Access-Control-Allow-Origin: *on all routes
Related MCP server: nano-banana
Prerequisites
Bun >= 1.0
An OpenAI API key with access to the Images API
Installation
bun installConfiguration
Edit config.json at the project root:
{
"port": 1980,
"model": "gpt-image-2",
"size": "1024x1536",
"quality": "low",
"imagesDir": "images"
}Field | Description | Default |
| HTTP server listening port |
|
| OpenAI image model |
|
| Generated image dimensions |
|
| Image quality ( |
|
| Directory where generated images are stored |
|
The imagesDir directory is created automatically if it does not exist.
API Key
Provide your OpenAI key via the environment variable:
export OPENAI_API_KEY=sk-...Usage
# production
bun run start
# development (watch mode)
bun run devThe server starts on the configured port (default: http://localhost:1980).
MCP Tool: generate_image
Request
POST /mcp with a JSON-RPC 2.0 body:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "generate_image",
"arguments": {
"description": "A futuristic city at sunset, digital art"
}
}
}Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"url": "http://localhost:1980/images/1720000000000.png",
"filename": "1720000000000.png",
"model": "gpt-image-2",
"size": "1024x1536",
"prompt": "A futuristic city at sunset, digital art"
}
}Generated images are saved as <timestamp>.png in imagesDir and immediately accessible at GET /images/:filename.
Project Structure
src/
index.ts # Entry point — loads config, starts server
server.ts # Bun HTTP server, routes requests
mcpHandler.ts # JSON-RPC 2.0 MCP handler
imageGenerator.ts # OpenAI Images API integration
staticHandler.ts # Static file serving for generated images
config.ts # Config loading from config.json
types.ts # Shared TypeScript types
config.json # Server configuration
images/ # Generated images (auto-created)License
Private — all rights reserved.
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
- AlicenseBqualityDmaintenanceA local MCP server for generating and editing images using OpenAI-compatible APIs. It provides text-to-image generation and image editing capabilities with configurable endpoints and saves output directly to local files.Last updated27MIT
- Alicense-qualityDmaintenanceA local stdio MCP server for generating images using Google's Gemini image models, saving to disk as JPEG.Last updated1,110MIT
- Flicense-qualityDmaintenanceGenerates images using Google's Gemini model, with options to save to file or return as base64 data URL.Last updated
- Alicense-qualityDmaintenanceLocal-first MCP image generation server supporting OpenAI and Google Gemini models for generating and editing images, with an embedded interactive studio.Last updated101ISC
Related MCP Connectors
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
Generate PWA icon sets and iOS splash screens from a text prompt or an existing image.
Transform video, audio and images, and generate media from prompts. FFmpeg, captions, models.
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/jlg-formation/mcp-server-openai-image-generator'
If you have feedback or need assistance with the MCP directory API, please join our Discord server