---
title: Connect Codex
description: Add the looot MCP server to Codex CLI or the Codex app, sign in with the browser or a header token, and check it works.
sidebar:
  label: Codex
---

<ClientHeader id="codex" />

Codex reaches looot's catalog, balance and runs over MCP, from the CLI or the app.

Before you start you need a looot account. The runs you make spend the organization's balance, so
top up before your first paid run. See [Before your first run](/money#before-your-first-run).

:::note
Not tested by hand yet. Steps follow [the client's own docs](https://learn.chatgpt.com/docs/extend/mcp?surface=cli); if a menu has moved, that page wins.
:::

## Sign in with the browser

The server URL is `https://api.looot.ai/mcp`. Nothing to copy: you sign in on looot.ai, pick the organization to bill and click **Connect**.

**Add and sign in**

```bash
codex mcp add looot --url https://api.looot.ai/mcp
codex mcp login looot
```

**~/.codex/config.toml**

```toml
[mcp_servers.looot]
url = "https://api.looot.ai/mcp"
```

## Headless: a token in the header

Only for CI and machines with no browser. Create an agent token in [Settings](https://looot.ai/settings) and send it as `Authorization: Bearer <token>`. Never commit it.

**Headless: token inline in ~/.codex/config.toml**

```toml
[mcp_servers.looot]
url = "https://api.looot.ai/mcp"
http_headers = { "Authorization" = "Bearer <agent token from looot.ai Settings>" }
```

## Notes

- Codex has no bearer_token field. Use http_headers, or bearer_token_env_var only where the app inherits your shell's variables.

In the Codex app, open **Settings**, **MCP servers**, **Add server**, choose **Streamable HTTP**,
enter the URL, and restart. The IDE extension has the same form under the gear menu, **MCP
servers**. Both show an **Authenticate** button for looot.

For the header fallback in the Codex app: **Add server**, **Streamable HTTP**, the URL, then
under **Headers** add `Authorization` with the value `Bearer <your token>`. Leave **Bearer token
env var** empty.

:::warning
Avoid `bearer_token_env_var` in the Codex app: the app starts without your shell's variables, so
looot answers 401 and Codex drops its tools without an error. In a terminal-only setup where the
variable is always exported, `codex mcp add looot --url https://api.looot.ai/mcp
--bearer-token-env-var LOOOT_TOKEN` also works.
:::

## Check it works

Ask Codex to call [`balance`](/mcp-tools/balance) or [`catalog_overview`](/mcp-tools/catalog-overview). Both are free. A working connection answers
with your available balance, or the catalog's categories and job counts.

## What you see when you connect

The browser opens looot.ai and shows the consent page: which organization to bill, which scopes
to grant and how long to stay connected. See [The consent page](/connect#the-consent-page).

<Related />
