Use Medux MCP in Command Code
Add the Medux-hosted remote MCP server to Command Code with one command, verify it, and call Medux media tools from the terminal agent.
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 with one command (put all flags before the server name). By default it is saved for you in the current project; add --scope project to share it through .mcp.json, or --scope user for every project.
cmd mcp add --transport http --header "Authorization: Bearer sk-medux-..." medux https://mcp.medux.io/api/mcp/v1For a shared .mcp.json, use the ${MEDUX_API_KEY} form so the real key never lands in git. Command Code resolves the variable at runtime.
Verify the connection. cmd mcp get medux shows the saved URL and header, cmd mcp list shows every server, and /mcp inside a session shows the connection status and tool count.
cmd mcp get meduxUse it from a prompt. Start Command Code in the folder that holds your files and mention Medux so it picks the right tool.
Use Medux to generate a 1024x1024 image of a red fox in watercolor style.How a call works: Command Code 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 it 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
- Server will not connect: run cmd mcp get medux to check the URL, then look at the error shown by /mcp. It can take a few seconds to start.
- To start over: cmd mcp remove medux, then add it again.
- 401 Unauthorized: the key is wrong. Re-add the server with the Bearer prefix.
- Local-file upload fails: upload URLs expire. Ask the agent 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.