# Connect Codex

> Let your agent do it: Connect Codex to my remote Hermitbox install through `hermitbox mcp`. Install the Hermitbox CLI on the machine running Codex, start Codex with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment, and merge the page's `[mcp_servers.hermitbox]` table into `~/.codex/config.toml`; its `env_vars` passes the values without storing the key. After a restart, ask for the project's defaults, create a sandbox, run `echo hello` in it and delete it. Never copy the key into the file or this chat. Follow the exact steps in https://docs.hermitbox.dev/v0.2.4/integrations/codex.md.

Give Codex the Hermitbox tools for a remote install through `hermitbox mcp` over stdio. On
the machine where you ran the installer, use the keyless setup in
[Use Hermitbox with your agent](https://docs.hermitbox.dev/v0.2.4/get-started/agents.md#codex) instead.

1. Install the [Hermitbox CLI](https://docs.hermitbox.dev/v0.2.4/get-started/cli.md) on the machine running Codex.
2. Start Codex with `HERMITBOX_API_URL` and `HERMITBOX_API_KEY` in its private environment.
3. Merge this into `~/.codex/config.toml`, restart, and ask for project defaults, a sandbox,
   hello and cleanup. Supply an image only for a container default.

```toml
[mcp_servers.hermitbox]
command = "hermitbox"
args = ["mcp"]
env_vars = ["HERMITBOX_API_URL", "HERMITBOX_API_KEY"]
```

The [Codex reference](https://learn.chatgpt.com/docs/extend/mcp?surface=cli) also documents a
project `.codex/config.toml` in trusted projects. `env_vars` passes the named values without
storing the key. Host policy and [tier limits](https://docs.hermitbox.dev/v0.2.4/reference/tiers.md) stay in force.
