Skip to main content
Glama

mcp-image-generator

by GMKR

MCP Image Generator

A Model Context Protocol (MCP) server for generating images using Together AI's image generation models. This MCP Server can be run locally or using an SSE endpoint. The MCP Image Generator required a provider, only "Replicate" and "Together" are supported currently. You need to set the TOGETHER_API_KEY or REPLICATE_API_TOKEN environment variables. and set the PROVIDER environment variable to "replicate" or "together"/

SSE Endpoint (Docker environment)

Clone the repository

git clone https://github.com/gmkr/mcp-imagegen.git cd mcp-imagegen

Build and run Docker container

docker build -f Dockerfile.server -t mcp-imagegen . docker run -p 3000:3000 mcp-imagegen

Configuring with MCP Client

{ "mcpServers": { "imagegenerator": { "url": "http://localhost:3000/sse", "env": { "PROVIDER": "replicate", "REPLICATE_API_TOKEN": "your-replicate-api-token" } } } }

Adjust the url to the endpoint of the MCP server you want to use. provider can be "replicate" or "together".

Running locally using stdio

Prerequisites

  • Node.js
  • Together AI API key or Replicate API token

Installation

  1. Clone the repository:
    git clone https://github.com/gmkr/mcp-imagegen.git cd mcp-imagegen
  2. Install dependencies:
    pnpm install

Configuration

Create a configuration file for your MCP client. Here's an example configuration:

{ "mcpServers": { "imagegenerator": { "command": "pnpx", "args": [ "-y", "tsx", "/path/to/mcp-imagegen/src/index.ts" ], "env": { "PROVIDER": "replicate", "REPLICATE_API_TOKEN": "your-replicate-api-token" } } } }

Replace /path/to/mcp-imagegen with the absolute path to your cloned repository and your-replicate-api-token with your actual Replicate API token.

Usage

The MCP Image Generator provides a tool called generate_image that can be used to generate images based on text prompts.

Tool: generate_image

Generates an image based on the provided prompt.

Parameters:

  • prompt (string): The text prompt to generate an image for
  • width (number, optional): The width of the image to generate (default: 512)
  • height (number, optional): The height of the image to generate (default: 512)
  • numberOfImages (number, optional): The number of images to generate (default: 1)

Environment Variables

  • PROVIDER: The provider to use for image generation (default: "replicate")
  • REPLICATE_API_TOKEN: Your Replicate API token
  • TOGETHER_API_KEY: Your Together AI API key
  • MODEL_NAME: The model to use for image generation (default: "black-forest-labs/flux-schnell")

License

MIT

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Generates and returns and image using Together.ai

  1. SSE Endpoint (Docker environment)
    1. Clone the repository
    2. Build and run Docker container
    3. Configuring with MCP Client
  2. Running locally using stdio
    1. Prerequisites
    2. Installation
    3. Configuration
  3. Usage
    1. Tool: generate_image
  4. Environment Variables
    1. License

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        Enables the generation of images using Together AI's models through an MCP server, supporting customizable parameters such as model selection, image dimensions, and output directory.
        Last updated -
        1
        7
        JavaScript
        MIT License
        • Apple
        • Linux
      • A
        security
        A
        license
        A
        quality
        A Model Context Protocol server that enables high-quality image generation using the Flux.1 Schnell model via Together AI with customizable parameters.
        Last updated -
        1
        472
        8
        JavaScript
        MIT License
      • A
        security
        A
        license
        A
        quality
        A Model Context Protocol server that enables generation of high-quality images using the Flux.1 Schnell model via Together AI, allowing users to create images from text prompts with customizable dimensions.
        Last updated -
        1
        14
        Python
        MIT License
        • Apple
      • -
        security
        F
        license
        -
        quality
        A server that connects to the xAI/Grok image generation API, allowing users to generate images from text prompts with support for multiple image generation and different response formats.
        Last updated -
        8
        JavaScript

      View all related MCP servers

      MCP directory API

      We provide all the information about MCP servers via our MCP API.

      curl -X GET 'https://glama.ai/api/mcp/v1/servers/GMKR/mcp-imagegen'

      If you have feedback or need assistance with the MCP directory API, please join our Discord server