openai-imagegen-mcp

openai-imagegen-mcp

Enables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.

Category
Visit Server

README

OpenAI Image Generation MCP Server

A Model Context Protocol (MCP) Server that interfaces with the OpenAI API for image generation using the gpt-image-1 model.

Features

  • Generate images using OpenAI's gpt-image-1 model with various customization options
  • Edit images by providing source images and prompts
  • Save generated images to local storage in specified folders
  • Control image formats, quality, and background transparency

Installation

Install uv

On Mac you can install it using homebrew

brew install uv

Usage with Claude Code

Configure Claude Code to use this MCP server by updating your .cursor/mcp.json or other agent configuration:

{
  "mcpServers": {
    "openai-image": {
      "command": "uv",
      "args": [
        "--directory",
        "/Users/marabian/mcp-servers/openai-imagegen-mcp",
        "run",
        "mcp",
        "run",
        "main.py"
      ],
      "env": {
        "OPENAI_API_KEY": "your_api_key_here",
        "DEFAULT_SAVE_DIR": "/path/to/default/save/directory"
      }
    }
  }
}

Important Configuration Notes:

  1. Replace your_api_key_here with your actual OpenAI API key.

  2. For the DEFAULT_SAVE_DIR:

    • Set this to a directory where you want to save all generated images
    • You can use a relative path like ./images within your project
    • For projects, consider using a path like ${PROJECT_ROOT}/generated-images
    • Defaults to ./images in the MCP server directory if not specified
  3. When working in different projects:

    • The agent will save images to DEFAULT_SAVE_DIR by default
    • You can override this within each tool call using the save_dir parameter
    • Images will be organized with unique timestamps to prevent conflicts

Available Tools

The OpenAI Image Generation MCP Server provides the following tools:

Image Generation

  • generate_image - Generate an image based on a text prompt
  • edit_image - Edit an existing image based on a new prompt
  • get_available_models - List available OpenAI image generation models

Image Management

  • list_saved_images - List images saved in the specified directory
  • set_save_directory - Set the directory where generated images will be saved

Examples

Generating an Image

# Generate a landscape image with transparent background
generate_image(
    prompt="A serene mountain landscape at sunset",
    size="1536x1024",
    background="transparent",
    output_format="png",
    save_dir="/path/to/project/images",
    filename="sunset_landscape"
)

Editing Images

# Combine multiple source images into a new composition
edit_image(
    prompt="Create a cohesive scene with these objects",
    image_paths=["/path/to/image1.png", "/path/to/image2.png"],
    quality="high",
    save_dir="/path/to/project/edits",
    filename="composed_scene"
)

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured