Skip to main content
Glama
ckz
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": []
    }
  }
}

Related MCP server: Flux Schnell MCP Server

配置

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

用法

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

生成图像

根据文本提示,使用 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 请求之前验证所有输入参数

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • AI image, video & music generation. Flux, Veo 3.1, Suno V5. Free tier included.

  • Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.

  • LLM chat, text summarization and AI image generation

View all MCP Connectors

Latest Blog Posts

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