# Connect Fiest to Codex

Source: https://docs.fiest.io/mcp/codex

The Codex app, Codex CLI, and Codex IDE extension share MCP configuration when
they run on the same Codex host.

## 1. Copy and run this command [#1-copy-and-run-this-command]

Use **Production** for a live Fiest account. Use **Sandbox** only when Fiest has
invited you to test with isolated sample data. The sandbox currently uses the
temporary `mcp-dev.fiest.io` hostname.

### Production

```bash
codex mcp add fiest --url https://mcp.fiest.io/mcp
```

### Sandbox

```bash
codex mcp add fiest-sandbox --url https://mcp-dev.fiest.io/mcp
```

You can also add the selected server in the Codex app from Settings → MCP
servers → Add. Choose Streamable HTTP and copy the address shown above.

## 2. Approve access in Fiest [#2-approve-access-in-fiest]

Restart Codex if the new server does not appear immediately. Open the MCP
server list, select Fiest, and choose **Authenticate**. Codex opens the Fiest
authorization flow in your browser.

You can start the same flow from your terminal. Use the command for the
environment you added:

### Production

```bash
codex mcp login fiest
```

### Sandbox

```bash
codex mcp login fiest-sandbox
```

Codex requests the scopes advertised by the Fiest MCP server. Sign in if needed,
choose one restaurant or review an organization connection, then approve the
requested access shown by Fiest.

<Callout type="info" title="No credentials to configure">
  Do not add an API token, client secret, or one-time code. Authentication
  happens on the official Fiest page opened by Codex.
</Callout>

## 3. Check that it worked [#3-check-that-it-worked]

Ask Codex:

```text
Use Fiest to show the restaurant context I authorized.
```

You are connected when Codex calls `get_restaurant_context` and shows the
restaurant or organization you approved.

## Manage the connection [#manage-the-connection]

### Production

```bash
codex mcp list
codex mcp get fiest
codex mcp remove fiest
```

### Sandbox

```bash
codex mcp list
codex mcp get fiest-sandbox
codex mcp remove fiest-sandbox
```

You can also inspect authentication and available tools from the Codex MCP
server screen or `/mcp`.

## Troubleshooting [#troubleshooting]

* **Server needs authentication:** open the MCP server screen and authenticate,
  or rerun the matching login command above.
* **Authentication expired:** authenticate again. Fiest keeps tokens bound to
  the exact MCP resource instead of accepting a less secure unbound refresh.
* **Server was just added:** restart Codex, then inspect `/mcp`.
* **Authorization was revoked in Fiest:** authenticate again.
* **Wrong restaurant:** revoke the grant in Fiest and reconnect with the
  intended restaurant.

See the [official Codex MCP documentation](https://learn.chatgpt.com/docs/extend/mcp)
for client-specific configuration.