Claude Code Integration with Flux MCP

📘 OverviewClaude Code MCP Overview →

Flux is a new model developed by the founding team of Stable Diffusion, divided into three tiers: Dev (fast, draft level), Pro (slower, detailed), Kontext (editing existing images). Integrating it into Claude Code makes generating images particularly convenient.

Obtain API Token

Before using the Flux MCP Server, you need to prepare an Ace Data Cloud API Token. The method to obtain it is consistent with the Claude Code VS Code configuration tutorial:

  1. Open the Ace Data Cloud Console - Application List to get your API Token for backup.
  2. If you are not logged in or registered, you will be automatically redirected to the login page; after logging in or registering, you will be automatically returned to the current page.
  3. The first application will grant a free quota, allowing you to experience the Claude Code MCP service for free.

Get Ace Data Cloud API Key

One Token can be used for all MCP Servers provided by Ace Data Cloud, without needing to apply separately for Flux. The documentation and screenshots suggest displaying only a masked version, such as YOUR_ACEDATACLOUD_API_KEY, and not posting the full Token in public repositories, Issues, screenshots, or chat records.

Using the web version of claude.ai or Claude Desktop? They support OAuth one-click authorization, eliminating the need to manually fill in the Token. For details, see the Claude.ai / Desktop tutorial for Flux MCP.

Configure Claude Code

Choose one from the three options below. -H must be uppercase; lowercase -h is --help; please replace the Token after Authorization with the actual value you copied from the console.

For current project only: local

Suitable for trial use, the configuration is bound only to the project directory where you run the command. Claude Code will write the records into the local ~/.claude.json, along with the current project path.

claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
  -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
  -s local

Usable for all projects: user

Suitable for frequent use of Flux MCP across multiple projects. The configuration is written into the local ~/.claude.json user-level configuration, which will be visible in any project opened in Claude Code thereafter.

claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
  -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
  -s user

Shared with project: project

Suitable for team projects. The configuration is written into the .mcp.json in the current project root directory, which can be submitted to a private repository for teammates to reuse; do not submit the real Token to public repositories, and it is recommended to change it to an environment variable placeholder or have each person add it locally.

claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
  -H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
  -s project

When the project-level configuration is first read by Claude Code, it may display Pending approval, requiring confirmation in the Claude Code session to trust this project configuration, which is a normal security prompt.

Verify Connection

After configuration, run:

claude mcp list

Seeing flux display ✓ Connected indicates a successful handshake. If it fails, check the Token, service URL, and configuration scope; do not judge the current status based on historical client versions or fixed tool counts.

Three Models, Three Uses

After configuration, return to the Claude Code session and directly use natural language to call Flux:

Dev — Quick Trial Direction

When unsure of the desired style, you can first generate a few drafts to compare directions:

Use flux-dev to quickly generate 3 different styles of developer blog cover images, trying flat, realistic, and abstract styles

Pro — Official Image Generation

After finding a preferred direction, enhance the details and resolution:

Use flux-pro to regenerate the second image, increasing details and resolution

Kontext — Edit Existing Image

flux_edit_image allows for local modifications without regenerating the entire image:

Edit this poster image, changing the date in the bottom right corner from 2024 to 2025

Tool List

Tool Description
flux_generate_image Text to image generation
flux_edit_image Image editing