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.


image-generator MCP Server

An MCP server that generates images based on image prompts using OPENAI's dall-e-3 image generation model. This server is built with TypeScript.

Features

Tools

  • generate_image
    • Generates an image for a given prompt.
    • Requires prompt and imageName parameters.
    • Saves the generated image in a generated-images directory on your desktop.

Development

Install dependencies:

npm install

Build the server:

npm run build

For development with auto-rebuild:

npm run watch

Installation

To use with Claude Desktop, add the server config:

  • On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On Windows: %APPDATA%/Claude/claude_desktop_config.json

Example config:

{
  "mcpServers": {
    "command": "image-generator",
    "env": {
      "OPENAI_API_KEY": "<your-openai-api-key>"
    }
  }
}

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

Debugging

Since MCP servers communicate over stdio, debugging can be challenging. It is recommended to use the MCP Inspector, available as a package script:

npm run inspector

The Inspector provides a URL to access debugging tools in your browser.