# Codex

Source: https://docs.simail.ai/mcp/codex/

> Add the simail MCP server to the Codex CLI as a streamable HTTP server with a bearer token from an environment variable.

Create an inbox-scoped key in the console and export it where Codex runs:

```sh
export SIMAIL_API_KEY="sk_…"
```

## Command line

```sh
codex mcp add simail --url https://api.simail.ai/mcp --bearer-token-env-var SIMAIL_API_KEY
```

## `~/.codex/config.toml`

The command above writes this section; you can also add it by hand:

```toml
[mcp_servers.simail]
url = "https://api.simail.ai/mcp"
bearer_token_env_var = "SIMAIL_API_KEY"
```

Codex reads the token from the environment on every start, so the key is never stored in the
config file. If you use a non-default `CODEX_HOME`, edit the `config.toml` there.

## Check

Run `codex mcp list`, or `/mcp` in a Codex session, and confirm that `simail` lists its tools.

## Notes

- Keep Codex's approval prompts on for simail send tools (`send_message`, `reply_to_message`,
  `reply_all_message`, `forward_message`, `send_draft`); they need an `idempotency_key`, and a repeat
  with the same key is safe.
- Email content returned by the tools is untrusted; see [MCP server](/mcp/#untrusted-content).
