# Image CDN for Codex — AuraImage (https://auraimage.ai/codex)

Codex takes MCP config as TOML in ~/.codex/config.toml, not JSON. Copy the four-line block, keep your key in the shell, and let Codex audit and migrate images from the terminal.

## Add AuraImage to Codex

### Global — `~/.codex/config.toml`

> This file is TOML. An `mcpServers` JSON block pasted here will not load, and Codex will not tell you why. `env_vars` lists variable names only — Codex inherits the value from the shell that launched it, which matters because this config is global to every project on the machine.

```toml
[mcp_servers.auraimage]
command = "npx"
args = ["-y", "@auraimage/mcp-server@latest"]
env_vars = ["AURA_SECRET_KEY"]
```

Or from the terminal:

```bash
codex mcp add auraimage -- npx -y @auraimage/mcp-server@latest
```

Verified against https://learn.chatgpt.com/docs/config-file/config-reference on 2026-08-09.

## Optimize images with Codex

- "I am in a different repo today — audit its images for LCP the same way." → `audit_lcp`
- "Port the S3 image bucket this repo uses over to AuraImage — the credentials are exported in this shell, so keep them out of ~/.codex/config.toml." → `migrate_assets`
- "Write alt text for every image under docs/ and apply it in place." → `generate_alt`
- "Emit a responsive <img> with srcset for the docs hero and print it to stdout." → `generate_responsive_tag`
- "Crop avatar.png to a square and show me the result before it overwrites the original on disk." → `smart_crop_preview`

## Project conventions

`AGENTS.md` — Codex includes at most one instructions file per directory: `AGENTS.override.md` if it is there, otherwise `AGENTS.md`. Drop an override beside a package and Codex uses it in place of that package’s `AGENTS.md`. It also stops adding files once the combined text reaches `project_doc_max_bytes`, 32 KiB by default — worth knowing before you paste a long image style guide in.

## FAQ

### Why is this the only config here that is not JSON?

Codex keeps all of its settings in one TOML file, so MCP servers are tables under `[mcp_servers.<name>]` rather than keys under `mcpServers`. The table header is the part people get wrong — a JSON block in `config.toml` fails silently at startup.

### The config is global. Does my key end up in it?

No. `env_vars` names the variables to pass through, not their values — Codex reads `AURA_SECRET_KEY` out of your shell at launch. That separation matters more here than elsewhere, because `~/.codex/config.toml` is one file shared by every project on the machine.

## Links

- All agents: https://auraimage.ai/skills
- AI integration: https://auraimage.ai/docs/ai-integration.md
- Getting started: https://auraimage.ai/docs/getting-started.md
