> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveintelligence.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> Add Hive to Codex CLI with mcp add and login.

## Add and authorize

```bash theme={null}
codex mcp add hive --url https://mcp.hiveintelligence.xyz/mcp
codex mcp login hive
```

The login step opens a browser. Approve the connection there and Codex stores the
credential.

If `codex mcp add` rejects `--url`, your Codex build predates remote HTTP MCP support. Run
`codex update` and try again.

## Verify

```bash theme={null}
codex mcp list
```

`hive` should appear as connected. Then start a session and ask for live data.

<Note>
  `codex mcp login` needs an interactive terminal.
</Note>

## Headless use

Codex keeps its MCP servers in `~/.codex/config.toml` under `mcp_servers`. Where no browser is
available, point Codex at an environment variable rather than writing a key to disk:

```toml theme={null}
[mcp_servers.hive]
url = "https://mcp.hiveintelligence.xyz/mcp"
bearer_token_env_var = "HIVE_API_KEY"
```

If you need the key inline instead, use `http_headers`:

```toml theme={null}
[mcp_servers.hive]
url = "https://mcp.hiveintelligence.xyz/mcp"
http_headers = { Authorization = "Bearer YOUR_HIVE_API_KEY" }
```

See [authentication](/authentication) for where to get a key.
