# Connect Codex

> Add the Whatsable MCP server to Codex with the Codex CLI, then sign in.

On Whatsable, you need to be an owner or an admin, on every plan except Bulk Message. See [What you need](/mcp#what-you-need).

Codex stores MCP servers in `~/.codex/config.toml`. The commands below are the Codex CLI's remote-server commands: `codex mcp add --url` writes a `[mcp_servers.whatsable]` table, and `codex mcp login` starts sign-in.

## Add the server

**Add the remote server**

In a terminal:

```bash
codex mcp add whatsable --url https://api.whatsable.app/mcp
```

Codex writes this to `~/.codex/config.toml`. A project file, `.codex/config.toml`, applies only to a trusted project.

```toml
[mcp_servers.whatsable]
url = "https://api.whatsable.app/mcp"
```

**Sign in**

```bash
codex mcp login whatsable
```

Your browser opens Whatsable. Sign in, choose the organization, choose what Codex can do and which numbers it can use, then **Approve**. [Access and connections](/mcp/manage-access#what-you-approve) shows each page.

Ask Codex what it can do with Whatsable. The tools are listed in [MCP tools](/mcp/tools).

## Use an API key instead

Create a key under **API keys** in the sidebar. Codex reads the key from an environment variable and sends it as `Authorization: Bearer`. The config stores the variable name, not the key.

```bash
codex mcp add whatsable --url https://api.whatsable.app/mcp --bearer-token-env-var WHATSABLE_API_KEY
```

```toml
[mcp_servers.whatsable]
url = "https://api.whatsable.app/mcp"
bearer_token_env_var = "WHATSABLE_API_KEY"
```

Set `WHATSABLE_API_KEY` in the shell that starts Codex. The key needs to be on Pro or Agency, or during the 14-day trial. See [API keys](/features/api-keys).

## Remove it

```bash
codex mcp remove whatsable
```

Then revoke the connection in Whatsable, under **API keys** in the sidebar, then **Connected AI apps**. See [Revoke a connection](/mcp/manage-access#revoke-a-connection).