FluxMCP
FluxMCP
一个基于 Model Context Protocol (MCP) 的服务器,用于通过 AceDataCloud 平台使用 Flux 进行 AI 图像生成和编辑。
直接在 Claude、Cursor 或任何兼容 MCP 的客户端中,使用 Flux 模型(flux-dev、flux-pro、flux-kontext)生成和编辑惊艳的 AI 图像。
功能特性
图像生成 - 使用 6 种 Flux 模型从文本提示生成图像
图像编辑 - 使用上下文感知的 Flux Kontext 模型编辑现有图像
任务管理 - 跟踪异步生成任务并批量查询状态
模型指南 - 内置模型选择和提示词编写指导
双传输模式 - 支持 stdio(本地)和 HTTP(远程/云端)模式
Docker 就绪 - 容器化并附带 K8s 部署清单
安全 - Bearer 令牌认证,HTTP 模式下每个请求相互隔离
Related MCP server: DiffuGen
工具参考
工具 | 描述 |
| 使用 Flux 根据文本提示生成 AI 图像。 |
| 使用 Flux 根据文本提示编辑现有图像。 |
| 列出所有可用的 Flux 模型及其功能。 |
| 列出所有可用的 Flux 工具及其用例。 |
| 查询 Flux 图像生成任务的状态和结果。 |
| 一次查询多个 Flux 图像生成任务。 |
快速开始
1. 获取你的 API 令牌
在 AceDataCloud 平台 注册
前往 API 文档页面
点击 "获取" 获取你的 API 令牌
复制令牌供后续使用
2. 使用托管服务器(推荐)
AceDataCloud 托管了一个托管的 MCP 服务器 — 无需本地安装。
端点: https://flux.mcp.acedata.cloud/mcp
所有请求都需要 Bearer 令牌。使用第 1 步中的 API 令牌。
Claude.ai
直接在 Claude.ai 上通过 OAuth 连接 — 无需 API 令牌:
前往 Claude.ai 设置 → 集成 → 添加更多
输入服务器 URL:
https://flux.mcp.acedata.cloud/mcp完成 OAuth 登录流程
在对话中开始使用这些工具
Claude Desktop
添加到你的配置文件中(macOS 上为 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Cursor / Windsurf
添加到你的 MCP 配置中(.cursor/mcp.json 或 .windsurf/mcp.json):
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}VS Code (Copilot)
添加到你的 VS Code MCP 配置中(.vscode/mcp.json):
{
"servers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}或者为 VS Code 安装 Ace Data Cloud MCP 扩展,该扩展可通过一键设置注册托管的 MCP 服务器。
JetBrains IDEs
前往 设置 → 工具 → AI 助手 → 模型上下文协议 (MCP)
点击 添加 → HTTP
粘贴:
{
"mcpServers": {
"flux": {
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Claude Code
Claude Code 原生支持 MCP 服务器:
claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
-h "Authorization: Bearer YOUR_API_TOKEN"或者添加到项目的 .mcp.json 中:
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Cline
添加到 Cline 的 MCP 设置中(.cline/mcp_settings.json):
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Amazon Q Developer
添加到你的 MCP 配置中:
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Roo Code
添加到 Roo Code 的 MCP 设置中:
{
"mcpServers": {
"flux": {
"type": "streamable-http",
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}Continue.dev
添加到 .continue/config.yaml 中:
mcpServers:
- name: flux
type: streamable-http
url: https://flux.mcp.acedata.cloud/mcp
headers:
Authorization: "Bearer YOUR_API_TOKEN"Zed
添加到 Zed 的设置中(~/.config/zed/settings.json):
{
"language_models": {
"mcp_servers": {
"flux": {
"url": "https://flux.mcp.acedata.cloud/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_TOKEN"
}
}
}
}
}cURL 测试
# Health check (no auth required)
curl https://flux.mcp.acedata.cloud/health
# MCP initialize
curl -X POST https://flux.mcp.acedata.cloud/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'3. 或本地运行(备选)
如果你更愿意在自己的机器上运行服务器:
# Install from PyPI
pip install mcp-flux-pro
# or
uvx mcp-flux-pro
# Set your API token
export ACEDATACLOUD_API_TOKEN="your_token_here"
# Run (stdio mode for Claude Desktop / local clients)
mcp-flux-pro
# Run (HTTP mode for remote access)
mcp-flux-pro --transport http --port 8000Claude Desktop(本地)
{
"mcpServers": {
"flux": {
"command": "uvx",
"args": ["mcp-flux-pro"],
"env": {
"ACEDATACLOUD_API_TOKEN": "your_token_here"
}
}
}
}Docker(自托管)
docker pull ghcr.io/acedatacloud/mcp-flux-pro:latest
docker run -p 8000:8000 ghcr.io/acedatacloud/mcp-flux-pro:latest客户端使用自己的 Bearer 令牌连接 — 服务器从每个请求的 Authorization 头中提取令牌。
可用工具
工具 | 描述 |
| 使用模型选择从文本提示生成图像 |
| 使用文本指令编辑现有图像 |
| 查询单个生成任务的状态 |
| 一次查询多个任务状态 |
| 列出所有可用的 Flux 模型及其功能 |
| 显示所有工具和工作流示例 |
可用提示词
提示词 | 描述 |
| 选择正确工具和模型的指南 |
| 编写有效提示词的最佳实践 |
| 常见工作流模式和示例 |
支持的模型
模型 | 质量 | 速度 | 尺寸格式 | 最适合用途 |
| 良好 | 快速 | 像素(256-1440px) | 快速原型设计 |
| 高 | 中等 | 像素(256-1440px) | 生产环境使用 |
| 高 | 中等 | 宽高比 | 图像编辑 |
| 最高 | 较慢 | 宽高比 | 复杂编辑 |
| 高 | 快速 | 宽高比 | Flux 2 均衡质量 |
| 较高 | 中等 | 宽高比 | Flux 2 生产环境 |
| 最高 | 较慢 | 宽高比 | Flux 2 最高质量 |
| 良好 | 快速 | 宽高比 | Flux 2 高效输出 |
使用示例
生成图像
"Generate a photorealistic mountain landscape at golden hour"
→ flux_generate_image(prompt="...", model="flux-2-max", size="16:9")编辑图像
"Add sunglasses to the person in this photo"
→ flux_edit_image(prompt="Add sunglasses", image_url="https://...", size="1:1", model="flux-kontext-pro")检查任务状态
"What's the status of my generation?"
→ flux_get_task(task_id="...")环境变量
变量 | 必需 | 默认值 | 描述 |
| 是(stdio) | — | 来自 AceDataCloud 的 API 令牌 |
| 否 |
| API 基础 URL |
| 否 | — | OAuth 客户端 ID(托管模式) |
| 否 |
| 平台基础 URL |
| 否 |
| 请求超时时间(秒) |
| 否 |
| MCP 服务器名称 |
| 否 |
| 日志级别 |
开发
设置
git clone https://github.com/AceDataCloud/FluxMCP.git
cd FluxMCP
pip install -e ".[all]"
cp .env.example .env
# Edit .env with your API token代码检查与格式化
ruff check .
ruff format .
mypy core tools main.py测试
# Unit tests
pytest --cov=core --cov=tools
# Skip integration tests
pytest -m "not integration"
# With coverage report
pytest --cov=core --cov=tools --cov-report=htmlGit 钩子
git config core.hooksPath .githooksAPI 参考
此 MCP 服务器使用 AceDataCloud Flux API:
POST /flux/images — 生成或编辑图像
POST /flux/tasks — 查询任务状态(单个或批量)
完整 API 文档:platform.acedata.cloud
文档
许可证
MIT 许可证 — 详情请参阅 LICENSE。
链接
Available Tools
7 toolsflux_edit_imageAInspect
Edit an existing image using Flux with a text prompt.
This allows you to modify an existing image based on a text description.
The kontext models (flux-kontext-pro, flux-kontext-max) are specifically
designed for high-quality image editing and style transfer.
Use this when:
- You want to modify or transform an existing image
- You want to change specific elements in an image
- You want to apply style changes or artistic effects
- You want to add, remove, or replace objects in an image
For generating new images from scratch, use flux_generate_image instead.
Returns:
Task ID and edited image information including URLs.
Inputs: size (required), prompt (required), image_url (required), model, +1 more. Returns: result
flux_generate_imageAInspect
Generate AI images from a text prompt using Flux.
Flux is a family of fast, high-quality image generation models by Black Forest Labs.
Different models offer different tradeoffs between speed, quality, and capabilities.
Use this when:
- You want to create new images from a text description
- You need high-quality AI-generated artwork or photos
- You want fast image generation with good prompt following
For editing existing images, use flux_edit_image instead.
Returns:
Task ID and generated image information including URLs.
Inputs: size (required), prompt (required), count, model, +1 more. Returns: result
flux_generate_videoBInspect
Generate text/image/video-to-video or enhance an owned temporary draft. Poll flux_get_task.
Inputs: request (required). Returns: result
flux_get_taskAInspect
Query the status and result of a Flux image or video generation task.
Use this to check if a generation is complete and retrieve the resulting
image/video URLs and metadata.
Use this when:
- You want to check if an image generation has completed
- You need to retrieve image URLs from a previous generation
- You used async callback and want to check results later
- The initial generation returned a task_id without immediate results
Returns:
Task status and generation result including image URLs.
Inputs: task_id (required). Returns: result
flux_get_tasks_batchAInspect
Query multiple Flux image or video generation tasks at once.
Efficiently check the status of multiple tasks in a single request.
More efficient than calling flux_get_task multiple times.
Use this when:
- You have multiple pending generations to check
- You want to get status of several images at once
- You're tracking a batch of generations
Returns:
Status and result information for all queried tasks.
Inputs: task_ids (required). Returns: result
flux_list_actionsAInspect
List all available Flux tools and their use cases.
Reference guide for what each tool does and when to use it.
Returns:
Categorized list of all tools with descriptions.
Inputs: no named parameters. Returns: result
flux_list_modelsAInspect
List all available Flux models and their capabilities.
Reference guide for choosing the right Flux model for your use case.
Returns:
Detailed list of all Flux models with descriptions and recommendations.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
The core tools are clearly separated: generate vs edit vs video generation, and single-task vs batch task queries are explicitly distinguished. Minor overlap exists because flux_generate_video bundles several video workflows and flux_get_tasks_batch could be seen as an optimization of flux_get_task, but descriptions make the intended boundaries clear.
All tools follow a consistent flux_verb_noun snake_case pattern, such as flux_generate_image, flux_edit_image, flux_get_task, and flux_list_models. The convention is predictable throughout.
Seven tools is well-scoped for an image/video generation service. The set covers generation, editing, task polling, batch polling, and reference discovery without obvious padding.
The surface covers the main lifecycle: generate/edit media, generate video, poll tasks, batch poll, and discover models/actions. Minor gaps remain around cancellation or listing existing tasks, but core workflows appear supported.
Maintenance
Related MCP Connectors
Generate images, videos, music & lip sync with 200+ AI models (Flux, Veo 3, Kling, Suno)
AI image, video & music generation. Flux, Veo 3.1, Suno V5. Free tier included.
Generate, edit, and explore AI images. Flux, Imagen, LoRA identity swap, upscale, and more.
AI photo tools and 18 image models (GPT Image 2.6, Nano Banana, FLUX 3, more) over MCP. Pay per use.
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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.426MIT
- AlicenseNot gradedqualityDmaintenancePowerful image generation system leveraging multiple Stable Diffusion models (flux-schnell, flux-dev, sdxl, sd3, sd15) for creating high-quality AI-generated images with precise customization.19MIT
- AlicenseBqualityFmaintenanceEnables seamless integration with Fal.ai's 600+ image generation models including Flux and Stable Diffusion. Supports real-time streaming, workflow execution, and unified access to AI image generation through natural language.541 npmMIT
- AlicenseNot gradedqualityNot gradedmaintenanceEnables high-quality image generation with advanced text rendering and contextual understanding using FLUX.1 Kontext Max through the Replicate API. Supports text-to-image generation, image editing, multiple aspect ratios, and automatically downloads generated images locally.1-