# Codex

> Register IndexZero with the Codex CLI.

Source: https://docs.indexzero.site/agents/codex



Codex supports remote MCP servers over Streamable HTTP and manages them with `codex mcp`.

<Steps>
  <Step>
    ### Add the server [#add-the-server]

    ```bash
    codex mcp add indexzero --url https://app.indexzero.site/mcp
    ```

    This writes the server into Codex's `config.toml`. The equivalent by hand:

    ```toml title="~/.codex/config.toml"
    [mcp_servers.indexzero]
    url = "https://app.indexzero.site/mcp"
    ```
  </Step>

  <Step>
    ### Authenticate [#authenticate]

    ```bash
    codex mcp login indexzero
    ```

    A browser window opens on app.indexzero.site; approve the connection. If your Codex build does not offer a login command, it will prompt on first use.
  </Step>

  <Step>
    ### Confirm [#confirm]

    ```bash
    codex mcp list
    ```

    IndexZero should show as connected. In a session, ask Codex to list your IndexZero projects.
  </Step>
</Steps>

## Using an API key instead [#using-an-api-key-instead]

For a non-interactive setup, create an [API key](/agents/api-keys) and pass it as a header:

```toml title="~/.codex/config.toml"
[mcp_servers.indexzero]
url = "https://app.indexzero.site/mcp"
http_headers = { "x-api-key" = "iz_your_key_here" }
```

Codex versions differ in the exact header option name; `codex mcp add --help` shows the one your build accepts.
