Use Medux MCP in Codex
Add the Medux-hosted remote MCP server to OpenAI Codex (CLI and IDE extension), verify it, and call Medux media tools from your prompts.
How to start
Sign in and get your Medux API key. It looks like sk-medux-... — copy it once and store it safely.
Add the server to Codex. Codex reads MCP servers from ~/.codex/config.toml (create the file if it does not exist). The endpoint is the same for every Medux tool, and the CLI and IDE extension share this file.
# ~/.codex/config.toml
[mcp_servers.medux]
url = "https://mcp.medux.io/api/mcp/v1"
http_headers = { "Authorization" = "Bearer sk-medux-..." }The key is stored in plain text in this file, so keep config.toml private and never commit it to git.
Restart Codex, then verify the connection. The medux server should be listed and enabled. Inside a Codex session, /mcp shows the connected servers and their medux_* tools.
codex mcp listUse it from a prompt. Start Codex in the folder that holds your files and mention Medux so Codex picks the right tool, for example: "Use Medux to generate a 1024x1024 image of a red fox in watercolor style."
Use Medux to generate a 1024x1024 image of a red fox in watercolor style.How a call works: Codex chooses a medux_* tool and fills in its parameters. For a local file it first calls medux_file_create_upload_url, uploads the file to the returned upload_url with an HTTP PUT (using the returned content_type), then passes the file_id to the tool. Most tools run as async tasks, so Codex polls medux_task_query with the task_id until the result URL is ready.
To find the exact tool for a capability, open Playground, switch to For AI Agents, and read the MCP tab for its mcp_tool_id.
What this means
- 401 Unauthorized: the key is missing or wrong. Re-copy it and keep the Bearer prefix.
- No medux_* tools listed: restart Codex, check config.toml for typos, and update Codex to a recent release (remote HTTP MCP servers need one).
- Local-file upload fails: upload URLs expire. Ask Codex to request a new one and send the exact content_type it returns.
- Insufficient credits: top up or upgrade on the Pricing page. MCP calls use the same credits as the public API.