# OpenAI Codex CLI {#openai-codex-cli}


[Codex CLI](https://github.com/openai/codex) is OpenAI's terminal-based coding agent. Connect it to Nitrosend over remote MCP for every public Nitrosend tool.



> [!IMPORTANT]
> This guide is for the Codex CLI. Using Codex in the ChatGPT desktop app? Nitrosend is in ChatGPT's plugin directory; see the [ChatGPT guide](https://docs.nitrosend.com/integrations/chatgpt.md).




## Setup {#setup}


Codex CLI supports Nitrosend as a remote HTTP MCP server.


### 1. Add the MCP server {#1-add-the-mcp-server}


```bash
codex mcp add nitrosend --url https://api.nitrosend.com/mcp
```


### 2. Sign in with OAuth {#2-sign-in-with-oauth}


```bash
codex mcp login nitrosend
```

Codex opens the Nitrosend sign-in flow in your browser. Log in or create a free account.


### 3. Use Nitrosend from Codex {#3-use-nitrosend-from-codex}


```bash
codex "Check my Nitrosend account status"
codex "Create a welcome email flow for new subscribers"
codex "Send our newsletter to the active subscribers list"
```



> [!IMPORTANT]
> No API key is required for the standard Codex MCP setup.




## Automation without OAuth {#automation-without-oauth}


For scripts and CI, use an API key instead of the sign-in: Codex CLI supports `--bearer-token-env-var` with a Nitrosend API key, or call the [REST API](https://docs.nitrosend.com/integrations/rest-api.md) directly. Create keys under **Settings > API Keys** in the Nitrosend dashboard ([app.nitrosend.com/my/settings/api-keys](https://app.nitrosend.com/my/settings/api-keys)).
