MCP HubMCP Hub
sammyl720

image-generator-mcp-server

by: sammyl720

A Model Context Protocol Server To Generate Images

6created 01/12/2024
Visit
Image
Protocol

📌Overview

Purpose: The framework aims to facilitate image generation by providing a server that interacts with OpenAI's DALL-E 3 model based on user prompts.

Overview: This TypeScript-based MCP (Model Context Protocol) server allows users to generate images from textual prompts, integrating seamlessly with the OpenAI image generation capabilities. The server is designed for ease of use and quick setup for generating images on a desktop environment.

Key Features:

  • Image Generation Tool: Enables users to generate an image by providing a textual prompt and naming the image, which is then saved in a designated directory, enhancing user experience by organizing the output effectively.

  • Development Integration: Supports various development commands such as building the server and watching for changes, making it easy for developers to maintain and update the server efficiently. Additionally, it offers debugging capabilities through the MCP Inspector for troubleshooting during development.


MCP Server - Image Generator

An MCP server that generates images based on prompts using OPENAI's dall-e-3 model.

Features

Tools

  • generate_image: Generates an image based on the provided prompt.
    • Parameters:
      • prompt: Required parameter for the image prompt.
      • imageName: Required parameter to save the generated image.

Development

Installation

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Configuration

To use with Claude Desktop, add the server config in the following file:

  • MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "command": "image-generator",
      "env": {
        "OPENAI_API_KEY": "<your-openai-api-key>"
    }
  }
}

Replace <your-openai-api-key> with your actual OPENAI Api Key.

Debugging

For debugging, use the MCP Inspector available as a package script:

npm run inspector

This will provide a URL for debugging tools in your browser.