garoth_dalle_mcp

garoth_dalle_mcp

by Garoth
An MCP server for generating and editing images using OpenAI's DALL-E API.

DALL-E MCP Server: Image Generation and Editing with DALL-E

DALL-E MCP Logo

An MCP (Model Context Protocol) server for generating and editing images using OpenAI's DALL-E API.

Features

  • Generate images using DALL-E 2 or DALL-E 3
  • Edit existing images (DALL-E 2 only)
  • Create variations of existing images (DALL-E 2 only)
  • Validate OpenAI API key

Installation

# Clone the repository
git clone https://github.com/Garoth/dalle-mcp.git
cd dalle-mcp

# Install dependencies
npm install

# Build the project
npm run build

Important Note for Cline Users

When using this DALL-E MCP server with Cline, it's recommended to save generated images in your current workspace directory by setting the saveDir parameter to match your current working directory. This ensures Cline can properly locate and display the generated images in your conversation.

Example usage with Cline:

{
  "prompt": "A tropical beach at sunset",
  "saveDir": "/path/to/current/workspace"
}

Usage

Running the Server

# Run the server
node build/index.js

Configuration for Cline

Add the DALL-E server to your Cline MCP settings file inside VSCode's settings (e.g., ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json):

{
  "mcpServers": {
    "dalle-mcp": {
      "command": "node",
      "args": ["/path/to/dalle-mcp-server/build/index.js"],
      "env": {
        "OPENAI_API_KEY": "your-api-key-here",
        "SAVE_DIR": "/path/to/save/directory"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Make sure to:

  1. Replace /path/to/dalle-mcp-server/build/index.js with the actual path to the built index.js file.
  2. Replace your-api-key-here with your OpenAI API key.

Available Tools

generate_image

Generate an image using DALL-E based on a text prompt.

{
  "prompt": "A futuristic city with flying cars and neon lights",
  "model": "dall-e-3",
  "size": "1024x1024",
  "quality": "standard",
  "style": "vivid",
  "n": 1,
  "saveDir": "/path/to/save/directory",
  "fileName": "futuristic-city"
}

edit_image

Edit an existing image using DALL-E based on a text prompt.

{
  "prompt": "Add a red hat",
  "imagePath": "/path/to/image.png",
  "mask": "/path/to/mask.png",
  "model": "dall-e-2",
  "size": "1024x1024",
  "n": 1,
  "saveDir": "/path/to/save/directory",
  "fileName": "edited-image"
}

create_variation

Create variations of an existing image using DALL-E.

{
  "imagePath": "/path/to/image.png",
  "model": "dall-e-2",
  "size": "1024x1024",
  "n": 4,
  "saveDir": "/path/to/save/directory",
  "fileName": "image-variation"
}

validate_key

Validate the OpenAI API key.

{}

Development

Testing Configuration

Note: The following .env configuration is ONLY needed for running tests, not for normal operation.

Create a .env file in the root directory with your OpenAI API key:

# Required for TESTS ONLY: OpenAI API Key
OPENAI_API_KEY=your-api-key-here

# Optional: Default save directory for test images
# If not specified, images will be saved to the current directory
# SAVE_DIR=/path/to/save/directory

Running Tests

# Run basic tests
npm test

# Run all tests including edit and variation tests
npm run test:all

# Run tests in watch mode
npm run test:watch

# Run specific test by name
npm run test:name "should validate API key"

Generating Test Images

# Generate a test image in the assets directory
npm run generate-test-image

License

MIT

About

Uses DALL-E to generate/edit images, an MCP (Model Context Protocol) server.

Resources

Stars

2 stars

Watchers

1 watching

Forks

1 fork

Report repository

Releases


No releases published

Packages 0


No packages published

Languages

Features & Capabilities

Categories
mcp_server model_context_protocol dall-e openai image_generation api_integration typescript javascript cline

Implementation Details

Stats

0 Views
2 GitHub Stars

Repository Info

Garoth Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300