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

# Connect Codex

> Add the Copyfy MCP server to OpenAI Codex (CLI, IDE extension, and desktop app) with OAuth or an API key.

<Info>
  Steps checked against the Codex documentation on September 24, 2026. The Codex CLI, the IDE extension, and the desktop app share the same configuration, so adding Copyfy once makes it available everywhere.
</Info>

## Add Copyfy

<Tabs>
  <Tab title="OAuth (recommended)">
    <Steps>
      <Step title="Add the server">
        ```bash Terminal theme={null}
        codex mcp add copyfy --url https://app.copyfy.io/mcp
        ```

        Codex detects that Copyfy uses OAuth and opens your browser.
      </Step>

      <Step title="Sign in">
        Sign in to Copyfy and click **Allow access**. To sign in again later, run:

        ```bash Terminal theme={null}
        codex mcp login copyfy
        ```
      </Step>

      <Step title="Try it">
        Start `codex` and ask: *"Use Copyfy to find 10 winning products in the Pets niche for the US."*
      </Step>
    </Steps>
  </Tab>

  <Tab title="API key">
    Create an [API key](/authentication#create-a-key) and store it in the `COPYFY_API_KEY` environment variable, then run:

    ```bash Terminal theme={null}
    codex mcp add copyfy --url https://app.copyfy.io/mcp --bearer-token-env-var COPYFY_API_KEY
    ```

    Codex reads the key from the environment on each start and sends it as `Authorization: Bearer`.
  </Tab>
</Tabs>

## config.toml

`codex mcp add` writes to `~/.codex/config.toml`. You can also edit the file directly:

<CodeGroup>
  ```toml OAuth theme={null}
  [mcp_servers.copyfy]
  url = "https://app.copyfy.io/mcp"
  ```

  ```toml API key theme={null}
  [mcp_servers.copyfy]
  url = "https://app.copyfy.io/mcp"
  bearer_token_env_var = "COPYFY_API_KEY"
  ```
</CodeGroup>

Codex does not expand variables inside `config.toml`. Keep the key in the environment variable, never in the file.

## IDE extension and desktop app

Open the gear menu (IDE extension) or **Settings** (desktop app), go to **MCP servers**, click **Add server**, choose **Streamable HTTP**, and enter `https://app.copyfy.io/mcp`. Restart the extension if asked, then click **Authenticate**.

## Fallback

Copy the URL `https://app.copyfy.io/mcp` and add it under `[mcp_servers.copyfy]` in `~/.codex/config.toml` as shown above.

## Disconnect

Run `codex mcp remove copyfy`. To revoke access from the Copyfy side, click **Revoke** under **Connected apps** or revoke the key on the [Integrations page](https://app.copyfy.io/dashboard/api).

Having trouble? See [Troubleshooting](/troubleshooting).
