# Connect MotherDuck to your AI client

> Connect MotherDuck to Bonnard through an access token, the first step to querying it from Claude, ChatGPT or another AI client.

Updated: 2026-10-12

To chart MotherDuck data in Claude, ChatGPT or another AI client, connect it here, then create an app on it.
Bonnard reads MotherDuck through an access token, so your apps query only the databases attached to the token's account.

[Video: Connecting MotherDuck: the Data page, the MotherDuck form, Test & connect, the tenancy choice, and Connection saved]

## Requirements

- The Admin role in your Bonnard workspace.
- A MotherDuck account, such as a service account, with the databases apps should query attached to its workspace.

## 1. Create an access token

Bonnard connects with this token. Agents can query every database attached to its account.

1. In MotherDuck, open **Settings**. For a service account, open it under **Service Accounts**.
2. Select **Create token**, enter a name, and choose the token type from the table below.
3. Copy the token.

Table: MotherDuck token types

| Token type | Choose it when |
| --- | --- |
| **Read Scaling** | Your MotherDuck plan is Business or Enterprise. The token can only read, and queries run in parallel on the account's read-scaling pool. Results can lag the latest writes by a few minutes. This token cannot attach databases, so attach them first with a Read/Write token. |
| **Read/Write** | Your plan has no read scaling. Every query runs on the account's one Duckling. Bonnard runs read-only queries either way. |

## 2. Add the connection

1. In the console at `app.bonnard.ai`, select **Data**, then **MotherDuck**.
   [Image: The Data page with MotherDuck under Databases]
2. Enter a **Connection name** and the details from the table below.
   [Image: The MotherDuck connection form]
3. Select **Test & connect**. Bonnard connects with the token and reads the tables in **Database**.

Table: MotherDuck connection fields

| Field | Enter |
| --- | --- |
| **Connection name** | A name for this database in Bonnard, such as `Production`. |
| **Connection** | Keep `motherduck`. |
| **Database** | The database to read. Empty means `my_db`. If each tenant (the customer a caller belongs to) has its own database, enter one of them. |
| **MotherDuck token** | The token from step 1. |
| **SaaS safe mode** | Keep `on`. It stops queries from reading local files or loading extensions. |

## 3. Choose the tenancy

Choose how callers see the data, then select **Save & continue**.

Table: Tenancy options

| Option | Use it when |
| --- | --- |
| **No tenancy** | Every caller should see the same data. |
| **Database per tenant** | Each tenant's tables sit in their own database, named by a pattern such as `customer_{tenant}`. Queries go to the caller's database, but can name any database the token reaches. |

[Image: The tenancy step for MotherDuck]

**Connection saved** shows the number of tables discovered.

[Image: Connection saved, with the tables discovered]

## Troubleshooting

- `DuckDB local-file mode is not available on the hosted service. Use MotherDuck, or self-host Bonnard.` Set
  **Connection** to `motherduck`.
- `Query exceeded the 30s time limit.` MotherDuck did not return the table list in time. Select **Test & connect**
  again.
- `Connected, but introspect failed: <message>` The token cannot read the table list. Fix what the message names.
- No tables are discovered. Check **Database**: a database the account has not attached shows no tables and no error.
- A table is missing. Check that it is in **Database**, then select **Re-introspect** on the database's **Tables**
  tab.
- Any other error is MotherDuck's own message. Check the field it names, then select **Test & connect** again.

## Charts in your AI client

[Create an app](https://bonnard.ai/docs/apps/create-an-app.md) on this database, so AI clients such as Claude and ChatGPT can query it and draw charts.
