Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Server Openai Image Generator

FreeNot checked

Generates images from text prompts using OpenAI's API, saves them locally, and serves them via an integrated HTTP static file server.

GitHubEmbed

About

Generates images from text prompts using OpenAI's API, saves them locally, and serves them via an integrated HTTP static file server.

README

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-2 by default)
  • CORS: Access-Control-Allow-Origin: * on all routes

Prerequisites

  • Bun >= 1.0
  • An OpenAI API key with access to the Images API

Installation

bun install

Configuration

Edit config.json at the project root:

{
  "port": 1980,
  "model": "gpt-image-2",
  "size": "1024x1536",
  "quality": "low",
  "imagesDir": "images"
}
Field Description Default
port HTTP server listening port 1980
model OpenAI image model "gpt-image-2"
size Generated image dimensions "1024x1536"
quality Image quality ("low", "medium", "high") "low"
imagesDir Directory where generated images are stored "images"

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 dev

The 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.

from github.com/jlg-formation/mcp-server-openai-image-generator

Installing Server Openai Image Generator

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/jlg-formation/mcp-server-openai-image-generator

FAQ

Is Server Openai Image Generator MCP free?

Yes, Server Openai Image Generator MCP is free — one-click install via Unyly at no cost.

Does Server Openai Image Generator need an API key?

No, Server Openai Image Generator runs without API keys or environment variables.

Is Server Openai Image Generator hosted or self-hosted?

A hosted option is available: Unyly runs the server in the cloud, no local setup required.

How do I install Server Openai Image Generator in Claude Desktop, Claude Code or Cursor?

Open Server Openai Image Generator on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Server Openai Image Generator with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All media MCPs