Flux Image MCP Server
Flux 图像 MCP 服务器
该 MCP 服务器使用 Replicate 上的 Flux Schnell 模型提供图像生成功能。
安装
全局安装 MCP SDK:
npm install -g @modelcontextprotocol/sdk@latest将此存储库克隆到您的 MCP 服务器目录:
cd ~/Documents/Cline/MCP
git clone https://github.com/yourusername/flux-img-mcp.git
cd flux-img-mcp
npm install构建服务器:
npm run build将服务器配置添加到您的 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
配置
服务器需要以下环境变量:
REPLICATE_API_TOKEN:您的 Replicate API 令牌。您可以从Replicate 帐户设置中获取此令牌。
用法
一旦安装并配置完毕,服务器将提供以下工具:
生成图像
根据文本提示,使用 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:任何错误消息(如果失败)
发展
要对服务器进行更改:
修改
src/index.ts中的源代码重建服务器:
npm run build重新启动 MCP 服务器以使更改生效
错误处理
该服务器包括针对以下方面的全面错误处理:
缺少 API 令牌
参数无效
API 请求失败
网络问题
安全
切勿将您的复制 API 令牌提交到版本控制
始终通过环境变量提供令牌
服务器在发出 API 请求之前验证所有输入参数
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
Generate images, videos, music & lip sync with 200+ AI models (Flux, Veo 3, Kling, Suno)
Create images and videos from prompts, with options for image mixing, reference images, and start/…
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
AI image, video & music generation. Flux, Veo 3.1, Suno V5. Free tier included.
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP for Replicate Flux Model. Generating images by prompts74,157 npm106MIT
- AlicenseNot gradedqualityDmaintenanceA server that enables generating images through the Replicate API by calling the Flux Schnell model via the Model Context Protocol (MCP).2MIT
- AlicenseBqualityFmaintenanceProvides image generation capabilities for Claude using the Replicate Flux model, allowing users to create images from text prompts with customizable parameters like aspect ratio and output format.151MIT
- AlicenseBqualityDmaintenanceExposes Replicate's FLUX image generation models to Claude, enabling text-to-image generation, image variations, inpainting, and edge-guided creation with 6 different FLUX models.21MIT