# Connect Codex

> Add the Wavegrain MCP server to the Codex CLI with an access key in an environment variable.

> Index of these docs: https://wavegrain.com/developers/llms.txt

1. Make an access key in Settings, under Connect an AI agent, and save it as `WAVEGRAIN_MCP_TOKEN`.
2. Add this to `~/.codex/config.toml`:

```toml
[mcp_servers.wavegrain]
url = "https://wavegrain.com/api/mcp"
bearer_token_env_var = "WAVEGRAIN_MCP_TOKEN"
```

3. Start Codex and ask: "Which Wavegrain tools do you have?"

Codex sends the key from `WAVEGRAIN_MCP_TOKEN` as a bearer token on every request.
