Skip to main content
Glama

mcp-image-generator

by GMKR

MCP 图像生成器

一个模型上下文协议 (MCP) 服务器,用于使用 Together AI 的图像生成模型生成图像。此 MCP 服务器可以在本地运行,也可以使用 SSE 端点运行。MCP 图像生成器需要一个提供程序,目前仅支持“Replicate”和“Together”。您需要设置TOGETHER_API_KEYREPLICATE_API_TOKEN环境变量,并将PROVIDER环境变量设置为“replicate”或“together”。

SSE 端点(Docker 环境)

克隆存储库

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

构建并运行 Docker 容器

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

使用 MCP 客户端进行配置

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

url调整为您要使用的 MCP 服务器的端点。 provider可以是“replicate”或“together”。

使用 stdio 在本地运行

先决条件

  • Node.js
  • Together AI API 密钥或复制 API 令牌

安装

  1. 克隆存储库:
    git clone https://github.com/gmkr/mcp-imagegen.git cd mcp-imagegen
  2. 安装依赖项:
    pnpm install

配置

为您的 MCP 客户端创建一个配置文件。以下是示例配置:

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

/path/to/mcp-imagegen替换为克隆存储库的绝对路径,并将your-replicate-api-token替换为实际的复制 API 令牌。

用法

MCP 图像生成器提供了一个名为generate_image的工具,可用于根据文本提示生成图像。

工具:generate_image

根据提供的提示生成图像。

参数:

  • prompt (字符串):生成图像的文本提示
  • width (数字,可选):要生成的图像的宽度(默认值:512)
  • height (数字,可选):要生成的图像的高度(默认值:512)
  • numberOfImages (数字,可选):要生成的图像数量(默认值:1)

环境变量

  • PROVIDER :用于图像生成的提供程序(默认值:“replicate”)
  • REPLICATE_API_TOKEN :您的复制 API 令牌
  • TOGETHER_API_KEY :您的 Together AI API 密钥
  • MODEL_NAME :用于图像生成的模型(默认值:“black-forest-labs/flux-schnell”)

执照

麻省理工学院

-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

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

使用 Together.ai 生成并返回图像

  1. SSE 端点(Docker 环境)
    1. 克隆存储库
    2. 构建并运行 Docker 容器
    3. 使用 MCP 客户端进行配置
  2. 使用 stdio 在本地运行
    1. 先决条件
    2. 安装
    3. 配置
  3. 用法
    1. 工具:generate\_image
  4. 环境变量
    1. 执照

      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
        4
        JavaScript
        MIT License
        • Apple
        • Linux
      • -
        security
        A
        license
        -
        quality
        A server that integrates Flux's advanced image generation and manipulation features into AI coding assistants, enabling seamless text-to-image and image control workflows in IDEs like Cursor and Windsurf.
        Last updated -
        4
        10
        Python
        MIT License
      • 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
        29
        8
        JavaScript
        MIT License
      • A
        security
        A
        license
        A
        quality
        A MCP server that enables Claude and other MCP-compatible assistants to generate images from text prompts using Together AI's image generation models.
        Last updated -
        1
        2
        TypeScript
        MIT License
        • Apple
        • Linux

      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