# Connect Codex

Use datacub in OpenAI's Codex: check your setup, add events in code, and ask about your numbers while you work.

## Connect

1. Paste both lines in your terminal.
2. The second opens your browser: sign in and press **Allow**.
3. Start Codex and ask.

```sh none
codex mcp add datacub --url https://datacub.to/mcp
codex mcp login datacub
```

The same commands are in [Settings, Connect and AI](https://datacub.to/en/settings?tab=integrations) under **Codex**.

## Good to know

- To install datacub in your code, ask: "Add datacub to this app." Codex calls `get_sdk_setup`, follows the steps, then checks with `get_integration_status`.
- To keep the connection read only, use `https://datacub.to/mcp?readonly=1` as the address.

## Try asking

- "Is datacub receiving events from this app? Use the datacub tools."
- "Add a checkout_completed event after payment succeeds, then check it arrives."
- "What happened to weekly active users after the last release?"

More in [Use cases](https://docs.datacub.to/mcp/use-cases.md).
