Imagifly Developer docs
Agents

Codex

Add the Imagifly MCP server to OpenAI Codex CLI.

Codex

Codex is OpenAI's coding agent. It works in your terminal through Codex CLI, or in a cloud sandbox that can write code, run commands and open pull requests. Connecting Imagifly gives it image and video generation alongside its coding tools.

Add the server

Export your key as IMAGIFLY_API_KEY.
Register the server with the Codex CLI.
Restart the session and check /mcp.
export IMAGIFLY_API_KEY="imf_your_key_here"

codex mcp add imagifly \
  --url https://imagifly.net/api/mcp \
  --bearer-token-env-var IMAGIFLY_API_KEY

Codex reads the token from the environment variable at connect time, so the key never appears in ~/.codex/config.toml.

Config file

The CLI writes this entry to ~/.codex/config.toml:

[mcp_servers.imagifly]
url = "https://imagifly.net/api/mcp"
bearer_token_env_var = "IMAGIFLY_API_KEY"
enabled = true
startup_timeout_sec = 20
FieldPurpose
urlRemote MCP endpoint.
bearer_token_env_varEnvironment variable holding the bearer token.
enabledSet false to keep the entry but disable it.
startup_timeout_secHow long Codex waits for the server during startup; the default is 10.
http_headers / env_http_headersStatic headers, or headers read from environment variables.

Codex has no `--header` flag

Use bearer_token_env_var for the API key. If you need additional headers, add them as http_headers in config.toml.

Verify

codex mcp list

Inside a session, /mcp shows each server and its tools. A working Imagifly entry lists the six generation tools.

Try it

Use imagifly to list the video models, then generate a 5 second clip of fog rolling over a pine forest.

The agent calls list_video_models, picks a model with a supported 5-second duration, calls generate_video, then polls get_video_generation.

On this page