{"slug": "how-to-generate-and-edit-images-from-claude-code-with-flux-mcp", "title": "How to Generate and Edit Images from Claude Code with Flux MCP", "summary": "A developer documented a workflow for adding Flux MCP to Claude Code, enabling image generation and editing directly from the terminal via two tools, flux_generate_image and flux_edit_image, exposed over an HTTP transport server at flux.mcp.acedata.cloud. The setup uses the claude mcp add command with a Bearer token header and supports local, user, and project scopes, with the author warning that project scope writes configuration into .mcp.json and tokens should not be committed to public repositories.", "body_md": "A lot of developer work needs small but polished visuals: a cover for a technical post, an illustration for a docs page, or a corrected poster where only one detail changed. The annoying part is that image work often pulls you out of the terminal, even when the rest of the task is already happening in Claude Code.\n\nFlux MCP is a practical way to keep that visual step inside the same coding workflow. You configure one MCP server, verify it once, and then ask Claude Code to generate or edit images with natural language.\n\nThe Flux MCP setup documented by Ace Data Cloud gives Claude Code two image tools:\n\n| Tool | What it does | \n|---|---|\n| `flux_generate_image` | Text-to-image generation | \n| `flux_edit_image` | Image editing | \n\nThe same document describes three Flux model directions you can use from Claude Code:\n\nThat maps well to real builder work. You can quickly try a few blog-cover directions, choose one, regenerate it with more detail, and later fix a small piece of text or layout in an existing image.\n\nFlux MCP is added to Claude Code as an HTTP transport server:\n\n```\nhttps://flux.mcp.acedata.cloud/mcp\n```\n\nAuthentication is passed through a header:\n\n```\nAuthorization: Bearer YOUR_ACEDATACLOUD_API_KEY\n```\n\nA local project setup looks like this:\n\n```\nclaude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \\\n  -H \"Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY\" \\\n  -s local\n```\n\nNotice the uppercase `-H`. In Claude Code, lowercase `-h` means help, so a tiny flag typo can make the command behave very differently from what you intended.\n\nThe documented scopes are:\n\n`local`: bound to the current project directory;` user`: visible across projects on your machine;` project`: written into `.mcp.json` for the current project.\nFor most experiments, I would start with `local`. It gives you a low-risk way to test the workflow in one repository before deciding whether it belongs in your global Claude Code setup.\n\nFrom the project where you want to use image generation, run:\n\n```\nclaude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \\\n  -H \"Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY\" \\\n  -s local\n```\n\nIf you expect to use Flux across many projects, switch only the scope:\n\n```\nclaude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \\\n  -H \"Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY\" \\\n  -s user\n```\n\nFor a team project, you can use project scope:\n\n```\nclaude mcp add flux --transport http https://flux.mcp.acedata.cloud/mcp \\\n  -H \"Authorization: Bearer YOUR_ACEDATACLOUD_API_KEY\" \\\n  -s project\n```\n\nBe careful with that last option. Project scope writes configuration into `.mcp.json` in the project root. The config may be useful for a private team repo, but the real token should not be committed to public repositories, issues, screenshots, or chat logs. Use placeholders or have each person add their own token locally.\n\nWhen Claude Code reads a project-level config for the first time, it may show `Pending approval`. That is a normal trust prompt, not necessarily a Flux problem.\n\nBefore asking for images, check the server status:\n\n```\nclaude mcp list\n```\n\nYou want `flux` to show `✓ Connected`.\n\nIf it fails, check the three most boring things first:\n\n`Authorization: Bearer`,`/mcp`,\nThis is faster than debugging prompts or assuming a model issue. If the MCP handshake is not connected, Claude Code cannot call the tools reliably.\n\nWhen the visual direction is unclear, start with fast drafts. The source document gives this example:\n\n```\nUse flux-dev to quickly generate 3 different styles of developer blog cover images, trying flat, realistic, and abstract styles\n```\n\nThat is a good pattern because it asks for comparison, not perfection. In a real docs workflow, I would add context from the file I am editing:\n\n```\nUse flux-dev to generate 3 cover directions for this tutorial page. Keep the style technical, dark, and minimal. Try flat, realistic, and abstract variants.\n```\n\nOnce you see the directions, pick the strongest one instead of trying to force the first image to be perfect.\n\nAfter a draft works, regenerate the chosen direction with more detail. The documented example is:\n\n```\nUse flux-pro to regenerate the second image, increasing details and resolution\n```\n\nThis two-step approach is useful because it separates taste decisions from final rendering. You do not spend effort polishing an image direction that might be wrong for the post, README, or landing page.\n\nFlux MCP is not only for new images. The documented `flux_edit_image` workflow supports local edits to an existing image. The example is:\n\n```\nEdit this poster image, changing the date in the bottom right corner from 2024 to 2025\n```\n\nFor developer content, this can be more useful than full regeneration. You might need to update a date, remove stale text, or adjust a small visual detail without changing the whole composition.\n\nHere is the workflow I would use for a real tutorial or release note:\n\n`flux_generate_image` with Dev-style exploration for 2–3 directions.`flux_edit_image` instead of starting over.\nThe value is not that every visual becomes automatic. The value is that the image task stays close to the code, copy, and context that created the need for the image in the first place.\n\nStart with `local`, verify with `claude mcp list`, and keep tokens private. Use Dev for exploration, Pro for the final version, and Kontext when an existing image only needs a targeted edit.\n\nThe full setup notes are in the [official Ace Data Cloud Flux MCP document](https://platform.acedata.cloud/documents/claude-code-mcp-flux).", "url": "https://wpnews.pro/news/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp", "canonical_source": "https://dev.to/germey/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp-1hl3", "published_at": "2026-10-01 01:09:00+00:00", "updated_at": "2026-10-01 01:16:37.316151+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "agent-protocols", "developer-tools", "generative-ai"], "entities": ["Claude Code", "Flux MCP", "Ace Data Cloud", "flux_generate_image", "flux_edit_image", "flux-dev", "Anthropic"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp", "markdown": "https://wpnews.pro/news/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp.md", "text": "https://wpnews.pro/news/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp.txt", "jsonld": "https://wpnews.pro/news/how-to-generate-and-edit-images-from-claude-code-with-flux-mcp.jsonld"}}