> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bily.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect Codex to Bily

> Add Bily to Codex, sign in securely, and discover your first scoped operation.

This quickstart uses Bily Connect, the recommended sign-in path. It keeps credentials out of client configuration and uses the signed-in user's current organization and store memberships.

<Steps>
  <Step title="Open MCP settings">
    Sign in to [Bily](https://app.bily.ai), then open **Settings > MCP**.

    The selected store matters only if you later create a fallback key. Bily Connect uses the signed-in user's current memberships.
  </Step>

  <Step title="Add Bily to Codex">
    Add this block to `~/.codex/config.toml`:

    ```toml theme={null}
    [mcp_servers.bily]
    url = "https://api-dispatcher.bily.ai/mcp"
    default_tools_approval_mode = "prompt"
    tool_timeout_sec = 120
    ```

    Do not add an access key to this configuration.
  </Step>

  <Step title="Sign in to Bily">
    Restart or reload Codex. When it asks to connect Bily, sign in and approve MCP access.

    Bily Connect uses the `mcp_access` scope. Bily checks the signed-in user's organization and store memberships for every operation.
  </Step>

  <Step title="Confirm your identity and stores">
    Ask the client:

    ```text theme={null}
    Use Bily to show my authenticated identity, organizations, and accessible stores.
    Search for the right operations first. Do not make changes.
    ```

    Codex should call `search`, then use `execute` with `bily.context()` for one-call discovery.
  </Step>

  <Step title="Preview a store operation">
    Continue with a read-only request:

    ```text theme={null}
    For store.example.com, find the Bily operation for a revenue trend comparison.
    Explain its required dates and verification guidance before executing it.
    ```
  </Step>
</Steps>

<Warning>
  Keep approval mode set to `prompt`. One `execute` call can contain several helper calls. Review the complete function before you approve it.
</Warning>

If your client cannot complete Bily Connect, use the [store-scoped access key fallback](/mcp/authentication#access-key-fallback).
