npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@aiondadotcom/mcp-openai-image

v1.0.8

Published

MCP server for OpenAI image generation with STDIO transport

Readme

MCP OpenAI Image Generation Server

Tests npm version

A Model Context Protocol (MCP) server that integrates with OpenAI's image generation API to create, edit, and stream images. Images are automatically saved to the Desktop for easy access by AI applications.

Note: This logo was generated by the MCP OpenAI Image Server itself, demonstrating the server's image generation capabilities.

Features

  • Image Generation: Create images using OpenAI's GPT-Image-1 model
  • Multi-turn Editing: Edit existing images using conversation history
  • Streaming Support: Real-time partial image generation
  • Desktop Integration: Automatic saving to ~/Desktop
  • Internal Configuration: Secure API key management
  • STDIO Transport: Runs over standard input/output

Installation

npm install
npm run build

Usage

Development

npm run dev

Production

npm run build
npm start

Configuration

The server manages its own configuration internally. On first use, configure your OpenAI API key:

{
  "name": "configure-server",
  "arguments": {
    "apiKey": "sk-your-openai-api-key",
    "organization": "optional-org-id",
    "model": "gpt-4.1-mini"
  }
}

Available Tools

1. generate-image

Generate images using OpenAI's image generation API.

Parameters:

  • prompt (required): Image description
  • size: Image dimensions (1024x1024, 1024x1536, 1536x1024)
  • quality: Image quality (standard, hd)
  • format: Output format (png, jpeg, webp)
  • background: Background setting (transparent, opaque, auto)
  • compression: Compression level for JPEG/WebP (0-100)

2. configure-server

Configure OpenAI API settings and credentials.

Parameters:

  • apiKey (required): OpenAI API key
  • organization: OpenAI organization ID
  • model: Model to use (gpt-4.1-mini, gpt-4.1, gpt-4o, gpt-4o-mini)

3. edit-image

Edit existing images using previous response ID.

Parameters:

  • editPrompt (required): Edit instructions
  • previousResponseId: Previous response ID for multi-turn editing
  • imageId: Specific image ID to edit

4. stream-image

Generate images with streaming for faster feedback.

Parameters:

  • prompt (required): Image description
  • partialImages: Number of partial images (1-3)
  • size: Image dimensions

5. get-config-status

Check current configuration status.

6. list-supported-models

List all supported OpenAI models for image generation.

File Management

  • Images are saved to ~/Desktop with unique filenames
  • Metadata is stored in JSON sidecar files
  • Automatic cleanup of old images (keeps last 50)
  • Naming convention: openai-image-{timestamp}-{randomId}.{extension}

Error Handling

The server provides comprehensive error handling with:

  • Configuration validation
  • API key verification
  • Network error recovery
  • File system error handling
  • Helpful error messages and suggestions

Security

  • API keys are stored securely in internal configuration
  • No logging of sensitive information
  • Validation of all inputs
  • Secure file system operations

Development

Project Structure

src/
├── index.ts            # Main entry point
├── server.ts           # MCP server implementation
├── config-manager.ts   # Configuration management
├── image-generator.ts  # OpenAI API integration
├── file-manager.ts     # Desktop file operations
└── types.ts           # TypeScript definitions

Building

npm run build

Testing

npm test

Requirements

  • Node.js 18+
  • OpenAI API key
  • Write permissions to Desktop
  • Network access to OpenAI API

Important Notice

⚠️ BILLING WARNING ⚠️

OpenAI bills for all successful API requests, even if technical issues with this MCP server prevent the delivery of usable results. This means you may be charged by OpenAI even when the MCP server fails to generate or save images properly due to bugs, configuration issues, or other technical problems. We do not guarantee or take responsibility for any costs that may be incurred through the use of this MCP server. Use at your own risk.

Please monitor your OpenAI API usage and billing to avoid unexpected charges.

License

MIT