MCP HubMCP Hub
sarthakkimtani

mcp-image-gen

by: sarthakkimtani

MCP server enabling Image Generation for LLMs, built in Python and integrated with Together AI.

11created 20/12/2024
Visit
Python
AI

📌Overview

Purpose: To provide a standardized interface for high-quality image generation using Together AI via a Model Context Protocol (MCP) server.

Overview: The Image Generation MCP Server facilitates the seamless creation of images by allowing users to specify parameters and prompts while integrating easily with existing MCP-compatible applications. It leverages the Flux.1 Schnell model to deliver superior image quality.

Key Features:

  • High-Quality Image Generation: Utilizes the advanced Flux.1 Schnell model to produce visually appealing images based on textual descriptions.

  • Customizable Dimensions: Users can define the width and height of the generated images for tailored results.

  • Clear Error Handling: Provides straightforward management of potential errors related to prompt validation and API communication.

  • Easy Integration: Designed for hassle-free compatibility with MCP-compatible clients, streamlining the implementation process.


Image Generation MCP Server

A Model Context Protocol (MCP) server for generating high-quality images via Together AI. This server provides a standardized interface for image generation parameters.

Features

  • High-quality image generation powered by the Flux.1 Schnell model
  • Customizable dimensions (width and height)
  • Clear error handling for prompt validation and API issues
  • Easy integration with MCP-compatible clients

Installation

Claude Desktop

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

Development/Unpublished Servers Configuration

{
  "mcpServers": {
    "image-gen": {
      "command": "uv",
      "args": ["--directory", "/ABSOLUTE/PATH/TO/image-gen/", "run", "image-gen"],
      "env": {
        "TOGETHER_AI_API_KEY": "<API KEY>"
      }
    }
  }
}

Available Tools

generate_image

Generates an image based on the given textual prompt and optional dimensions.

Input Schema:

{
  "prompt": {
    "type": "string",
    "description": "A descriptive prompt for generating the image (e.g., 'a futuristic cityscape at sunset')"
  },
  "width": {
    "type": "integer",
    "description": "Width of the generated image in pixels (optional)"
  },
  "height": {
    "type": "integer",
    "description": "Height of the generated image in pixels (optional)"
  },
  "model": {
    "type": "string",
    "description": "The model name as it appears in Together AI. Defaults to (black-forest-labs/FLUX.1-schnell) if incorrect."
  }
}

Prerequisites

  • Python 3.12 or higher
  • httpx
  • mcp

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository
  2. Create a new branch (feature/my-new-feature)
  3. Commit your changes
  4. Push the branch to your fork
  5. Open a Pull Request

For significant changes, please open an issue first to discuss any proposed changes.

License

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