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

# Codex setup

> Connect Codex CLI and the Codex IDE extension to Fortress MCP.

Use Codex when the agent runs through the Codex CLI or IDE extension. Codex shares MCP configuration between those surfaces.

## Generate the setup command

1. Open **Agents** in Fortress.
2. Create or rotate an agent.
3. Choose **Codex CLI** as the runtime.
4. Copy the generated command.

The generated command follows this shape:

```bash theme={"theme":"github-dark"}
export FORTRESS_TOKEN_<AGENT>='ft_<token>'
codex mcp add fortress-<agent> --url 'https://api.fortressproductivity.com/mcp?agent_id=<agent-id>' --bearer-token-env-var FORTRESS_TOKEN_<AGENT>
```

Codex reads the bearer token from the environment variable and sends it as the MCP `Authorization` header.

## Verify

Run:

```bash theme={"theme":"github-dark"}
codex mcp list
```

Then open Codex and ask it to read `fortress://workspace/overview`.

## Manual config

Codex can also read Streamable HTTP servers from `~/.codex/config.toml`:

```toml theme={"theme":"github-dark"}
[mcp_servers.fortress_agent]
url = "https://api.fortressproductivity.com/mcp?agent_id=<agent-id>"
bearer_token_env_var = "FORTRESS_TOKEN_AGENT"
```

See OpenAI's [Codex MCP documentation](https://developers.openai.com/codex/mcp).
