Skip to content

4kk11/mcp-gpt-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mcp-gpt-image

npm version Docker Image

An MCP server for generating and editing images using the OpenAI API.
Generated images are saved in the specified directory and returned along with scaled-down preview images.

Key Features

1. Image Generation (generate_image)

Generates new images from text prompts.

Input Parameters:

  • prompt: Description of the image you want to generate (required)
  • size: Output image size (optional, default: "auto")
    • "1024x1024"
    • "1536x1024"
    • "1024x1536"
    • "auto"

2. Image Editing (edit_image)

Edits existing images based on text prompts.

Input Parameters:

  • image: File path of the image to edit (required)
  • prompt: Text prompt describing the desired edits (required)

Usage Examples

Generating Variations

movie2.mp4

Role-playing as a Designer

movie.mp4

Installation

Using Docker

  1. Pull the Docker image
docker pull 4kk11/mcp-gpt-image
  1. Configuration example (claude_desktop_config.json)
{
  "mcpServers": {
    "gpt-image": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "YOUR_IMAGES_DIR:/app/temp",
        "-e",
        "OPENAI_API_KEY=YOUR_API_KEY",
        "4kk11/mcp-gpt-image"
      ]
    }
  }
}

Using npx

Configuration example (claude_desktop_config.json):

{
  "mcpServers": {
    "gpt-image": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-gpt-image"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_API_KEY",
        "IMAGES_DIR": "YOUR_IMAGES_DIR"
      }
    }
  }
}

Environment Variables

Variable Name Description Default Value
OPENAI_API_KEY OpenAI API key (required) -
IMAGES_DIR Path to directory for saving generated/edited images ./temp

For Developers

Building and Managing Docker Images

# Build Docker image
make docker-build

# Remove Docker image
make docker-clean
{
  "mcpServers": {
    "gpt-image": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "YOUR_IMAGES_DIR:/app/temp",
        "-e",
        "OPENAI_API_KEY",
        "mcp-gpt-image"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

License

This project is released under the MIT License. See LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors