AI integrations
How to connect EmailTemplate to Codex CLI over MCP
Codex CLI supports MCP servers over streamable HTTP. The safe path is reading the token from an environment variable, so the key never lands in `~/.codex/config.toml`.
Steps
-
Create your API key
Create an API key at https://dash.emailtemplate.theboomer.dev/dashboard/api-keys. The key is shown once and starts with `et_`.
-
Export the key
Codex reads the bearer from an environment variable. Add the line to your shell or secret manager.
export EMAILTEMPLATE_API_KEY="et_your_key" -
Register the server
`--url` selects streamable HTTP and `--bearer-token-env-var` names the variable holding the key.
codex mcp add emailtemplate --url https://mcp.emailtemplate.theboomer.dev/mcp \ --bearer-token-env-var EMAILTEMPLATE_API_KEY -
Verify
The list shows the server, and asking for templates returns your account’s.
codex mcp list
Frequently asked questions
- Why not paste the key into config.toml?
- Because that file ends up in backups and screenshots. With --bearer-token-env-var the secret stays in the environment and the config only stores the variable name.
- Does it work in the Codex IDE?
- Yes, the IDE reads the same Codex configuration.