Integrating Codex CLI with Flux MCP

📘 Complete Guide: Use Ace Data Cloud MCP in Codex CLI →

A top-tier open-source image model from Black Forest Labs, with outstanding photorealistic style and Kontext editing capabilities. After connecting it to Codex CLI through MCP, you can invoke it directly in conversations, without switching windows or copying and pasting.

Get an API Token

Log in to the application list, open the General Application, and click the copy button to the right of API KEY. See the complete guide for detailed steps.

Get an Ace Data Cloud API Key

Configuration

Edit the configuration: ~/.codex/config.toml

[mcp_servers.flux]
url = "https://flux.mcp.acedata.cloud/mcp"
type = "http"

http_headers = { "Authorization" = "Bearer 你的Token" }

After saving, the tools will load automatically when the next codex session starts.

Usage Examples

Use Flux to generate a cyberpunk-style city nightscape, with neon lights, a rainy night, and wet streets

Change this image (link xxx) to a watercolor painting style

Generate a 1024x1024 product hero image: headphones with a black metallic finish floating against a white background

Tools

Tool Description
flux_generate_image Text-to-image generation (Flux pro / dev / ultra)
flux_edit_image Edit an existing image according to a prompt (using flux-kontext-pro / max models)