Skip to main content
Glama

Flux Image MCP Server

by ckz

Flux 图像 MCP 服务器

该 MCP 服务器使用 Replicate 上的 Flux Schnell 模型提供图像生成功能。

安装

  1. 全局安装 MCP SDK:
npm install -g @modelcontextprotocol/sdk@latest
  1. 将此存储库克隆到您的 MCP 服务器目录:
cd ~/Documents/Cline/MCP git clone https://github.com/yourusername/flux-img-mcp.git cd flux-img-mcp npm install
  1. 构建服务器:
npm run build
  1. 将服务器配置添加到您的 MCP 设置文件(全局或工作区):
{ "mcpServers": { "flux-img": { "command": "node", "args": ["/path/to/flux-img-mcp/build/index.js"], "env": { "REPLICATE_API_TOKEN": "your-replicate-api-token" }, "disabled": false, "alwaysAllow": [] } } }

配置

服务器需要以下环境变量:

用法

一旦安装并配置完毕,服务器将提供以下工具:

生成图像

根据文本提示,使用 Flux Schnell 模型生成图像。

参数:

  • prompt (字符串,必需):所需图像的文本描述

使用示例:

<use_mcp_tool> <server_name>flux-img</server_name> <tool_name>generate_image</tool_name> <arguments> { "prompt": "A beautiful sunset over mountains" } </arguments> </use_mcp_tool>

该工具将返回包含以下内容的 JSON 响应:

  • status :生成请求的状态
  • output :生成图像的 URL(如果成功)
  • error :任何错误消息(如果失败)

发展

要对服务器进行更改:

  1. 修改src/index.ts中的源代码
  2. 重建服务器: npm run build
  3. 重新启动 MCP 服务器以使更改生效

错误处理

该服务器包括针对以下方面的全面错误处理:

  • 缺少 API 令牌
  • 参数无效
  • API 请求失败
  • 网络问题

安全

  • 切勿将您的复制 API 令牌提交到版本控制
  • 始终通过环境变量提供令牌
  • 服务器在发出 API 请求之前验证所有输入参数
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

使用 Replicate 上的 Flux Schnell 模型提供图像生成功能,允许用户根据文本提示创建图像。

  1. 安装
    1. 配置
      1. 用法
        1. 生成图像
      2. 发展
        1. 错误处理
          1. 安全

            Related MCP Servers

            • A
              security
              F
              license
              A
              quality
              Enables users to generate images from text prompts using Replicate's model, with configurable parameters and full MCP protocol compliance.
              Last updated -
              1
              126
              TypeScript
            • 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
              15
              Python
              MIT License
              • Apple
            • A
              security
              F
              license
              A
              quality
              A Model Context Protocol server that generates images using Replicate's FLUX model and stores them in Cloudflare R2, allowing users to create images through simple prompts and retrieve accessible URLs.
              Last updated -
              1
              10
            • -
              security
              A
              license
              -
              quality
              A server that enables generating images through the Replicate API by calling the Flux Schnell model via the Model Context Protocol (MCP).
              Last updated -
              3
              JavaScript
              MIT License

            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/ckz/flux-img-mcp'

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