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

openai-dalle-mcp

v1.0.2

Published

MCP server for generating images via OpenAI DALL-E API

Readme

OpenAI DALL-E MCP Server

npm version License: MIT

A stateless MCP (Model Context Protocol) server that allows generating images via the OpenAI DALL-E API.

Now available on npm! Install with npm install openai-dalle-mcp

Features

  • Generate images using DALL-E 3 with customizable parameters
  • Save generated images to local files
  • Implements the Model Context Protocol for seamless integration with MCP clients
  • Stateless design using stdio transport

Prerequisites

  • Node.js 18.x or higher
  • OpenAI API key

Installation

Option 1: Install from npm (Recommended)

# Install globally
npm install -g openai-dalle-mcp

# Or install locally in your project
npm install openai-dalle-mcp

Option 2: Clone the Repository

  1. Clone this repository:

    git clone https://github.com/piwi3910/openai-dalle-mcp.git
    cd openai-dalle-mcp
  2. Install dependencies:

    npm install
  3. Build the package:

    npm run build

Usage

Using as a Command Line Tool (when installed globally)

# Set your OpenAI API key as an environment variable
export OPENAI_API_KEY=your_openai_api_key_here

# Run the server
openai-dalle-mcp

Using in Your Project

The server is designed to be used with stdio transport, which means it doesn't run as a standalone service. Instead, it's started by MCP clients when needed.

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

// Create client
const client = new Client({
  name: "image-client",
  version: "1.0.0"
});

// Connect to the server
const transport = new StdioClientTransport({
  command: "openai-dalle-mcp", // If installed globally
  // Or use the path to the node_modules binary
  // command: "./node_modules/.bin/openai-dalle-mcp",
  env: {
    OPENAI_API_KEY: "your_openai_api_key_here"
  }
});

await client.connect(transport);

MCP Server Configuration

To add this server to your MCP configuration file (typically mcp_settings.json), add the following entry:

{
  "servers": [
    {
      "name": "openai-dalle",
      "command": "openai-dalle-mcp",
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key_here"
      }
    }
  ]
}

If you've installed the package locally in your project:

{
  "servers": [
    {
      "name": "openai-dalle",
      "command": "node",
      "args": ["./node_modules/.bin/openai-dalle-mcp"],
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key_here"
      }
    }
  ]
}

Available Tools

1. generate-image

Generates an image using OpenAI's DALL-E 3 model.

Parameters:

  • prompt (string, required): Text description of the image to generate
  • size (string, optional): Size of the generated image. Options: "1024x1024" (default), "1792x1024", "1024x1792"
  • quality (string, optional): Quality of the generated image. Options: "standard" (default), "hd"
  • style (string, optional): Style of the generated image. Options: "vivid" (default), "natural"

Returns:

  • url: URL of the generated image
  • revisedPrompt: The prompt after OpenAI's revision process

2. save-image

Saves an image from a URL to a local file.

Parameters:

  • imageUrl (string, required): URL of the image to save
  • filePath (string, required): Path where the image should be saved

Returns:

  • filePath: Absolute path where the image was saved
  • success: Boolean indicating whether the operation was successful

Using with MCP-enabled AI Assistants

Once configured in your MCP settings, you can use this server with AI assistants that support the Model Context Protocol. For example, with Claude:

You can now generate images using DALL-E 3. Try using the openai-dalle server's generate-image tool with a prompt like "a futuristic city with flying cars".

Example Client Usage

Here's an example of how to use this server with an MCP client:

import { Client } from "@modelcontextprotocol/sdk/client/index.js";
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";

async function main() {
  // Create client
  const client = new Client({
    name: "image-client",
    version: "1.0.0"
  });

  // Connect to the server
  const transport = new StdioClientTransport({
    command: "openai-dalle-mcp", // If installed globally
    // Or if installed locally in your project:
    // command: "./node_modules/.bin/openai-dalle-mcp",
    env: {
      OPENAI_API_KEY: "your_openai_api_key_here"
    }
  });
  await client.connect(transport);

  try {
    // Generate an image
    const generateResult = await client.callTool({
      name: "generate-image",
      arguments: {
        prompt: "A futuristic city with flying cars and neon lights",
        size: "1024x1024",
        quality: "hd",
        style: "vivid"
      }
    });

    console.log("Generated image:", JSON.parse(generateResult.content[0].text));

    // Save the image
    const imageData = JSON.parse(generateResult.content[0].text);
    const saveResult = await client.callTool({
      name: "save-image",
      arguments: {
        imageUrl: imageData.url,
        filePath: "./images/futuristic-city.png"
      }
    });

    console.log("Saved image:", JSON.parse(saveResult.content[0].text));
  } finally {
    // Close the connection
    await transport.close();
  }
}

main().catch(console.error);

Running the Example Client

We've included an example client in the examples directory:

  1. Navigate to the examples directory:

    cd examples
  2. Install dependencies:

    npm install
  3. Build the client:

    npm run build
  4. Run the client:

    npm start

The example client will generate an image of a futuristic city and save it to the examples/images directory.

Versioning and Updates

Current version: 1.0.2

To update to the latest version:

# For global installation
npm update -g openai-dalle-mcp

# For local installation
npm update openai-dalle-mcp

Check for the latest version on npm.

License

MIT