MCP server for image generation with Replicate FLUX

MCP server for image generation with Replicate FLUX

mcp-replicate-flux•byandylee20014

An MCP server that generates images from text prompts with Replicate's FLUX model and uploads the results to Cloudflare R2, returning accessible image URLs.

License: MIT•Runtime: Awaiting documentation review•Category: media design

WHAT IT DOES

  • •Generates images using Replicate's black-forest-labs/flux-schnell model.
  • •Exposes a generate-image MCP tool that accepts a text prompt and a filename.
  • •Stores generated images in Cloudflare R2 and returns accessible image URLs.
  • •Communicates over MCP protocol messages on standard input/output.

BEST FOR

  • •Generating images from text prompts inside MCP-compatible clients.
  • •Producing generated images with custom prompts and filenames that are stored and served via Cloudflare R2.

ABOUT MCP-REPLICATE-FLUX

MCP server for image generation with Replicate FLUX is cataloged as an MCP server attributed to andylee20014. An MCP server that generates images from text prompts with Replicate's FLUX model and uploads the results to Cloudflare R2, returning accessible image URLs. It is categorized under media design. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for MCP server for image generation with Replicate FLUX are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Who needs to provide credentials to use this server?

Users must supply a Replicate API token and Cloudflare R2 bucket credentials.

What does the server return after generating an image?

It returns content including an image entry with a URL to the uploaded file on the configured domain.

上游原版 README

在 GitHub 查看同一版本原文

readme.md · e2a86f62b69c · 采集于 2026-11-13 10:13:47 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

MCP Replicate FLUX

smithery badge

A Model Context Protocol (MCP) server that generates images using Replicate's FLUX model and stores them in Cloudflare R2.

使用 Replicate 的 FLUX 模型生成图片并存储到 Cloudflare R2 的模型上下文协议(MCP)服务器。

Features 功能特点

  • Generate images using Replicate's black-forest-labs/flux-schnell model

  • Store generated images in Cloudflare R2

  • Return accessible image URLs

  • Support for custom prompts and filenames

  • 使用 Replicate 的 black-forest-labs/flux-schnell 模型生成图片

  • 将生成的图片存储到 Cloudflare R2

  • 返回可访问的图片链接

  • 支持自定义提示词和文件名

Prerequisites 前置要求

  • Node.js (v16 or higher)

  • Replicate API token

  • Cloudflare R2 bucket and credentials

  • npm or yarn

  • Node.js(v16 或更高版本)

  • Replicate API 令牌

  • Cloudflare R2 存储桶和凭证

  • npm 或 yarn

Environment Variables 环境变量

Required environment variables in .env file:

.env 文件中需要的环境变量:

REPLICATE_API_TOKEN=your_replicate_token
STORAGE_ENDPOINT=your_r2_endpoint
STORAGE_ACCESS_KEY=your_r2_access_key
STORAGE_SECRET_KEY=your_r2_secret_key
STORAGE_BUCKET=your_bucket_name
STORAGE_DOMAIN=your_domain

Local Installation 本地安装

Installing via Smithery

To install MCP Replicate FLUX for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @andylee20014/mcp-replicate-flux --client claude

Installing manually

Follow these steps to set up the project locally:

按照以下步骤在本地设置项目:

# Clone the repository
git clone https://github.com/andylee20014/mcp-replicate-flux.git
cd mcp-replicate-flux

# Install dependencies
npm install

# Create .env file and add your credentials
cp .env.example .env
# Edit .env with your actual credentials

Make sure your Cloudflare R2 bucket has appropriate CORS settings for public access to the uploaded images.

确保您的 Cloudflare R2 存储桶具有适当的 CORS 设置,以允许公共访问上传的图片。

Running Locally 本地运行

To start the MCP server locally:

在本地启动 MCP 服务器:

node index.js

The server will start and listen for MCP protocol messages on standard input/output.

服务器将启动并通过标准输入/输出监听 MCP 协议消息。

Usage 使用方法

The server provides a generate-image tool that accepts two parameters:

  • prompt: The text prompt for image generation
  • filename: The desired filename for the generated image

服务器提供了一个 generate-image 工具,接受两个参数:

  • prompt:用于生成图片的文本提示词
  • filename:生成的图片所需的文件名

Integration Example 集成示例

Here's an example of how to integrate with this MCP server using the MCP client library:

以下是使用 MCP 客户端库与此 MCP 服务器集成的示例:

const { McpClient } = require('@modelcontextprotocol/sdk/client/mcp.js')

async function generateImage(prompt, filename) {
  const client = new McpClient()
  // Connect to your running MCP server
  await client.connect(yourTransport)
  
  const result = await client.tools.call('generate-image', {
    prompt,
    filename
  })
  
  return result
}

Example response 示例响应:

{
  "content": [
    { "type": "text", "text": "Image successfully generated and uploaded to Cloudflare R2" },
    { "type": "image", "url": "https://your-domain.com/filename.jpg" }
  ]
}

Testing 测试

A test script is provided to verify the image generation and upload functionality.

提供了一个测试脚本,用于验证图片生成和上传功能。

Running the test 运行测试

node test.js

The test script will:

  1. Generate an image with a sample prompt
  2. Upload the image to Cloudflare R2
  3. Return the accessible URL

测试脚本将:

  1. 使用示例提示词生成图片
  2. 将图片上传到 Cloudflare R2
  3. 返回可访问的 URL

Example test output 测试输出示例:

Generating image with prompt: "a beautiful girl"
Filename: test-1234567890.jpg
Image generated and uploaded successfully!
Image URL: https://your-domain.com/test-1234567890.jpg

You can modify the prompt in test.js to test different image generation scenarios.

您可以在 test.js 中修改提示词来测试不同的图片生成场景。

Cursor MCP Configuration Cursor MCP配置

There are two ways to configure the MCP server in Cursor:

在Cursor中配置MCP服务器有两种方式:

Method 1: Complete Configuration 完整配置方式

Create a file at ~/.cursor/mcp.json with all environment variables:

在 ~/.cursor/mcp.json 创建完整配置文件,包含所有环境变量:

{
  "mcpServers": {
    "replicate-flux": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\path\\to\\mcp-replicate-flux\\index.js"],
      "description": "使用Replicate的FLUX模型生成图片并存储到Cloudflare R2的MCP服务器",
      "env": {
        "REPLICATE_API_TOKEN": "your_replicate_token",
        "STORAGE_ENDPOINT": "your_r2_endpoint",
        "STORAGE_ACCESS_KEY": "your_r2_access_key",
        "STORAGE_SECRET_KEY": "your_r2_secret_key",
        "STORAGE_BUCKET": "your_bucket_name",
        "STORAGE_DOMAIN": "your_domain"
      }
    }
  }
}

Method 2: Minimal Configuration 最小配置方式

If you prefer to manage environment variables separately (using system environment variables or .env file), you can use a minimal configuration:

如果你想单独管理环境变量(使用系统环境变量或.env文件),可以使用最小配置:

{
  "mcpServers": {
    "replicate-flux": {
      "command": "node",
      "args": ["C:\\Users\\YourUsername\\path\\to\\mcp-replicate-flux\\index.js"]
    }
  }
}

When using the minimal configuration, make sure your environment variables are properly set up either in:

  • System environment variables
  • .env file in the project directory
  • Cloud platform's environment variables (for deployed servers)

使用最小配置时,请确保你的环境变量正确设置在以下位置之一:

  • 系统环境变量
  • 项目目录中的 .env 文件
  • 云平台的环境变量(对于已部署的服务器)

Notes 注意事项

  • The description field is optional in both methods

  • Environment variables in the configuration file take precedence over system environment variables

  • After changing the configuration, restart Cursor to apply the changes

  • description 描述字段在两种方式中都是可选的

  • 配置文件中的环境变量优先级高于系统环境变量

  • 更改配置后,需要重启Cursor以应用更改

Project Structure 项目结构

mcp-replicate-flux/
├── .env                  # Environment variables
├── index.js             # MCP server entry point
├── generateImage.js      # Image generation and R2 upload logic
├── test.js              # Test script
└── README.md            # Project documentation

Troubleshooting 故障排除

Common Issues 常见问题

  1. Image generation fails: Check your Replicate API token and quota

  2. R2 upload fails: Verify your R2 credentials and bucket permissions

  3. Cannot access generated images: Ensure your R2 bucket has proper CORS configuration

  4. 图片生成失败:检查您的 Replicate API 令牌和配额

  5. R2 上传失败:验证您的 R2 凭证和存储桶权限

  6. 无法访问生成的图片:确保您的 R2 存储桶具有正确的 CORS 配置

MCP Protocol 协议说明

The Model Context Protocol (MCP) is a standard for AI model interaction that enables interoperability between different AI systems. This server implements an MCP tool that can be used with any MCP-compatible client.

模型上下文协议(MCP)是一种 AI 模型交互标准,可实现不同 AI 系统之间的互操作性。此服务器实现了一个 MCP 工具,可与任何兼容 MCP 的客户端一起使用。

For more information about MCP, visit: https://mcp.freeaigen.com/

References 参考链接

License 许可证

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for MCP server for image generation with Replicate FLUX from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/mcp-replicate-flux)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related media design MCP Servers

Alternative and complementary servers in the same category

View all in media design →

A Rust CAD application with an MCP server for creating, inspecting and rendering drawings, either headlessly or through a connection to the desktop app.

8K
Media & Design
Liquid Composer
liquid-composer•frontedu

Liquid Composer is a browser-based Liquid Glass icon design tool that offers a local MCP server for agent-driven icon workflows.

69
Media & Design

agent-media makes short drama series and other short vertical videos from Claude, ChatGPT or Codex through one MCP connection, with OAuth sign-in and no API keys.

1
Media & Design