# Image CDN for Grok Build — AuraImage (https://auraimage.ai/grok-build)

Add AuraImage to Grok Build with a project-scoped .grok/config.toml block. ${VAR} expansion keeps your key out of the file, and grok mcp doctor tells you whether it worked.

## Add AuraImage to Grok Build

### Project — `.grok/config.toml`

> Like Codex this file is TOML, but the env vars get their own `[mcp_servers.auraimage.env]` table and Grok expands `${VAR}` (and `${VAR:-default}`) in `url`, `command`, `args`, `env`, and `headers`. `grok mcp add --scope project` writes this file in the current directory; when Grok loads, a project server replaces a user-level one of the same name entirely.

```toml
[mcp_servers.auraimage]
command = "npx"
args = ["-y", "@auraimage/mcp-server@latest"]
enabled = true
startup_timeout_sec = 30

[mcp_servers.auraimage.env]
AURA_SECRET_KEY = "${AURA_SECRET_KEY}"
```

Or from the terminal:

```bash
grok mcp add --scope project auraimage -- npx -y @auraimage/mcp-server@latest
```

Verified against https://docs.x.ai/build/features/mcp-servers on 2026-08-09.

## Optimize images with Grok Build

- "Audit the images in this repo only — I keep the server scoped to this project." → `audit_lcp`
- "Move every image in src/assets to AuraImage and keep the original filenames. If it stalls halfway, stop and I will run grok mcp doctor." → `migrate_assets`
- "Write alt text for the pricing and checkout pages, and flag any I should redo by hand." → `generate_alt`
- "Build the hero a responsive <picture> at 480, 960, and 1920 — if the server is still cold, raise startup_timeout_sec rather than dropping a size." → `generate_responsive_tag`
- "Preview logo-wide.png as a square avatar and as a wide OG card, using the server from this checkout rather than the user-level one it replaced." → `smart_crop_preview`

## Project conventions

`.grok/rules/` — `AGENTS.md` at the repo root is the primary convention and Grok Build reads it, alongside every `*.md` in a `.grok/rules/` directory. Use `.grok/rules/` when you want Grok-specific guidance that other agents will not pick up. Rules load from the root down to the working directory, with deeper files winning on conflicts.

## FAQ

### Grok Build and Codex both use TOML. Are the files interchangeable?

No. Both use `[mcp_servers.<name>]`, but Grok Build reads a project-scoped `.grok/config.toml` and takes env vars as a nested `[mcp_servers.auraimage.env]` table with `${VAR}` expansion. Codex reads one global `~/.codex/config.toml` and takes an `env_vars` array of names. Copying either into the other will not load.

### How do I check the server actually connected?

Run `grok mcp doctor`, which the docs call the first stop for diagnosing configuration and connectivity. The snippet spells `startup_timeout_sec` out at 30, which is already the default — it is there so you can raise it in place if the first `npx` download runs long, rather than having to discover the field exists.

## 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
