Codex
Image CDN for Codex
Codex reads TOML, not JSON — four lines in ~/.codex/config.toml and your images are handled.
$0 forever 20 GB bandwidth 3 GB storage hard stop at quota — never a surprise bill. Compare plans
Add AuraImage to Codex
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.
[mcp_servers.auraimage]
command = "npx"
args = ["-y", "@auraimage/mcp-server@latest"]
env_vars = ["AURA_SECRET_KEY"]Or from the terminal
codex mcp add auraimage -- npx -y @auraimage/mcp-server@latestVerified against the vendor docs on 2026-08-09.
Optimize images with Codex
Each prompt is paired with the MCP tool it fires.
- 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
Read package.json→ Next.js 15.4 · App Router · TypeScript · pnpm 9
Grep <img|background-image→ 14 <img> tags · 6 res.cloudinary.com URLs
Glob public/**/*.{png,jpg}→ 23 local images · 18.7 MB total
Read .gitignore→ .env.local ignored · no AURA_* keys anywhere
Read vercel.json→ hosting: Vercel → env file convention .env.local
Discovery — acme-storefront Framework Next.js 15 (App Router, TypeScript, pnpm) Images 14 <img> tags · 23 files in /public · 6 Cloudinary URLs Secrets no AURA_* keys · .env.local gitignored Backend route handlers — can sign upload tokens Hosting Vercel Plan 1. Credentials & env → auraimage-api-key 2. Register MCP server → .mcp.json 3. Install SDK → pnpm add @auraimage/sdk 4. Components → <AuraImage /> + <AuraUploader /> 5. Token route → app/api/aura/sign/route.ts
Fetch auraimage.ai/v1/sign — validate key→ valid · project acme-storefront · key name "prod"
Write .env.local→ +2 keys · values masked in the log
Edit .mcp.json→ merged "auraimage" server · existing servers untouched
Bash pnpm add @auraimage/sdk→ + @auraimage/sdk 1.4.2▸
Packages: +1 + @auraimage/sdk 1.4.2 Done in 1.8s
Bash npx shadcn@latest add https://auraimage.ai/registry/image.json→ components/aura/image.tsx
Bash npx shadcn@latest add https://auraimage.ai/registry/uploader.json→ components/aura/uploader.tsx
Created app/api/aura/sign/route.ts — the <AuraUploader /> default endpoint, no extra wiring(+11 −0)▸
import { AuraImage } from '@auraimage/sdk';
const aura = new AuraImage({
secretKey: process.env.AURA_SECRET_KEY!,
projectName: process.env.NEXT_PUBLIC_AURA_PROJECT_NAME!
});
export async function POST() {
const signature = await aura.signUpload({ maxSize: '5mb', allowedTypes: ['image/*'] });
return Response.json({ signature });
}AuraImage installed — 6 writes, 0 failures Wrote .env.local +2 keys (masked) .mcp.json auraimage MCP server package.json @auraimage/sdk 1.4.2 components/aura/ image.tsx · uploader.tsx app/api/aura/sign/ route.ts (+11 lines) Next 1. Restart your agent to load the MCP server 2. audit_lcp — scan for unoptimized images 3. migrate_assets — 23 local + 6 Cloudinary images detected 4. auraimage-react — <AuraImage /> patterns Docs: https://auraimage.ai/docs
A Cloudinary alternative your agent can wire up itself
| Capability | Cloudinary / Imgix | AuraImage with Codex |
|---|---|---|
| Pricing model | Metered per GB and per transform | Flat monthly price |
| Egress | Billed | $0 |
| AVIF | Opt-in configuration | Served by default |
| BlurHash placeholders | Build it yourself | Bundled |
| Component | SDK import | Lands in your repo, yours to edit |
| Install | Manual wiring | One MCP config, then a prompt |
Teach Codex your image conventions
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.
AGENTS.mdVerified against the vendor docs on 2026-08-09.
Questions, answered
The things developers ask before they ship. If something is missing, just email us.
Install it in your side project. Pay when you ship.
$0 forever 20 GB bandwidth 3 GB storage hard stop at quota — never a surprise bill. Compare plans