How to Add Flux MCP to Claude Code for Image Generation

When you are working inside Claude Code, switching to a browser just to generate or edit an image breaks the flow. The Flux MCP setup lets Claude Code call a remote image-generation tool from the same terminal session, so you can keep the surrounding project context in place while producing visual assets.
What you can do
The Flux MCP guide describes a Claude Code integration for image generation and image editing through Ace Data Cloud. Once configured, Claude Code can call Flux from natural language prompts instead of making you leave the editor.
- Use
flux_generate_imagefor text-to-image generation. - Use
flux_edit_imagefor editing an existing image. - Start with fast draft exploration using Flux Dev.
- Move to Flux Pro when you want more detail and resolution.
- Use Flux Kontext when you need to change an existing image without regenerating everything.
The key idea is not that MCP replaces Claude Code. It adds a callable tool surface to the coding session, so Claude Code can help with assets that sit next to your code: README illustrations, developer blog covers, release visuals, or small image edits.
How it works
Claude Code supports MCP servers. In this setup, you add a remote server named flux and point it to https://flux.mcp.acedata.cloud/mcp. Authentication is passed through an HTTP header:
Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY
The guide calls out one small but important detail: the -H option must be uppercase. Lowercase -h is interpreted as help. That is the kind of issue that can make an otherwise-correct setup look broken.
You also choose a configuration scope. Claude Code writes the setting differently depending on whether you use local, user, or project.
Choose the right configuration scope
For a quick test, use -s local. The configuration is bound to the current project directory and written into the local Claude configuration with the current path.
claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
-H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
-s local
If you expect to use Flux from many repositories, use -s user. That makes the server available across projects opened in Claude Code.
claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
-H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
-s user
For a team project, use -s project. The guide notes that this writes to .mcp.json in the project root. That can be useful for a private repository, but do not commit a real token to a public repository. Prefer a placeholder or have each teammate add their own local credential.
claude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \
-H "Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY" \
-s project
When Claude Code first reads a project-level configuration, it may show Pending approval. That is a normal trust step for project configuration.
Verify the connection before prompting
After adding the server, verify the handshake from the terminal:
claude mcp list
If the Flux entry shows ✓ Connected, the connection is working. If not, check three things before changing anything else: the token, the service URL, and the scope you used. The source guide also warns against relying on fixed tool counts from older client versions; use the current connection status instead.
Use Flux from Claude Code
Once the server is connected, return to your Claude Code session and ask for the image task in plain language. For early exploration, start with a few visual directions:
Use flux-dev to quickly generate 3 different styles of developer blog cover images, trying flat, realistic, and abstract styles
When one direction looks right, ask for a more polished pass:
Use flux-pro to regenerate the second image, increasing details and resolution
For editing, the documented workflow uses flux_edit_image to modify an existing visual instead of starting over:
Edit this poster image, changing the date in the bottom right corner from 2024 to 2025
That pattern is especially useful when the image is already approved except for one detail: a date, label, small copy change, or localized asset.
A practical workflow for builders
A simple builder-friendly workflow looks like this:
- Add Flux MCP locally in a test repository with
-s local. - Run
claude mcp listand confirm✓ Connected. - Generate several rough image directions with Flux Dev.
- Regenerate the chosen direction with Flux Pro.
- Use Kontext-style editing through
flux_edit_imagewhen you need a targeted change. - If the workflow becomes part of your daily setup, re-add it with
-s user; if it belongs to a private team repo, consider-s projectwith token hygiene.
The main thing is to keep secrets private. The documentation recommends showing only masked examples such as YOUR_ACEDATACLOUD_API_KEY and not posting the full token in repositories, issues, screenshots, or chat records.
Wrap-up
Flux MCP is a small setup step with a practical payoff: image generation and targeted image editing become part of the same Claude Code session where you are already writing and reviewing code. If you want the exact source commands and the current service URL, read the full Claude Code with Flux MCP guide.
Comments
Post a Comment