# Curcuma — Codex setup

## Mint a free token

```bash
curl -fsS -X POST https://curcuma.sud.fyi/api/mcp/install-token
```

## Codex `config.toml`

Add (or replace the managed block) under `${CODEX_HOME:-$HOME/.codex}/config.toml`:

```toml
# >>> curcuma (managed — do not edit inside) >>>
[mcp_servers.curcuma]
url = "https://curcuma.sud.fyi/mcp"
http_headers = { Authorization = "Bearer YOUR_TOKEN" }
# <<< curcuma <<<
```

If your Codex version uses `mcp-remote` instead of native HTTP:

```toml
[mcp_servers.curcuma]
command = "npx"
args = [
  "-y",
  "mcp-remote",
  "https://curcuma.sud.fyi/mcp",
  "--header",
  "Authorization: Bearer YOUR_TOKEN",
  "--transport",
  "http-first"
]
```

Persist the token in an ignored local path (e.g. `~/.curcuma-mcp/config`) rather than committing it.

## Router block (optional but recommended)

Append the Curcuma router into `${CODEX_HOME:-$HOME/.codex}/AGENTS.md`:

```bash
file="${CODEX_HOME:-$HOME/.codex}/AGENTS.md"
grep -q CURCUMA:ROUTER:BEGIN "$file" 2>/dev/null || {
  printf '\n\n' >> "$file"
  curl -fsSL https://curcuma.sud.fyi/.well-known/agent-skills/curcuma/ROUTER.md >> "$file"
}
```

## One-command install

```bash
curl -fsSL https://curcuma.sud.fyi/install.sh | bash
```

## Verify

List tools — expect `search_emails` and `get_email_summary`. Then:

> Design a welcome email for my product using Curcuma references.

## Agent handoff

`https://curcuma.sud.fyi/agent/<token>`
