Cover image
Try Now
2025-03-16

用于生成图像的MCP服务器

3 years

Works with Finder

1

Github Watches

2

Github Forks

3

Github Stars

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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • INFOLAB OPERATIONS 2
  • A medical specialist offering assistance grounded in clinical guidelines. Disclaimer: This is intended for research and is NOT safe for clinical use!

  • ANGEL LEON
  • A world class elite tech co-founder entrepreneur, expert in software development, entrepreneurship, marketing, coaching style leadership and aligned with ambition for excellence, global market penetration and worldy perspectives.

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • Daren White
  • A supportive coach for mastering all Spanish tenses.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • zhaoyunxing92
  • MCP(消息连接器协议)服务

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

    Reviews

    4 (1)
    Avatar
    user_Om0fflpM
    2025-04-16

    I've been using mcp-imagegen by GMKR and I'm thoroughly impressed. The tool is user-friendly and efficient in generating high-quality images for my projects. The seamless integration and robust performance make mcp-imagegen a must-have for any developer or designer. Highly recommended! Check it out at https://github.com/GMKR/mcp-imagegen.