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

# MotherDuck Integration

> Connect Annie to MotherDuck for cloud analytics queries with DuckDB.

# MotherDuck Integration

MotherDuck integration enables Annie to query your cloud analytics data using DuckDB SQL, explore database schemas, and correlate analytics findings with infrastructure events during incident investigations.

## Setup Guide

1. Go to the [Anyshift integrations page](https://app.anyshift.io/integrations)
2. Navigate to the **Analytics** section
3. Click **Connect MotherDuck**
4. Enter a **Name** for your token (e.g., "Production MotherDuck")
5. Provide your **MotherDuck API Token**
6. Click **Save MotherDuck token**

Anyshift validates the token against MotherDuck's API on save. If validation fails, check that your token is correct and has not expired.

### MotherDuck API Token

1. Sign in to [app.motherduck.com](https://app.motherduck.com)
2. Go to **Settings** > **Access Tokens**
3. Create a new access token (read-only is sufficient for Annie)
4. Copy the token and paste it into the Anyshift integration form

## How It Works

Once connected, Annie can query your MotherDuck databases during investigations and chat sessions. Annie's AI agent can:

* **List and explore databases** — discover available databases, tables, columns, and shares
* **Run SQL queries** — execute read-only DuckDB SQL against your cloud data
* **Search the catalog** — fuzzy-search across databases, tables, and columns to find relevant data
* **Discover external connections** — identify configured S3 buckets, Azure storage, and other data sources accessible through MotherDuck

## Data Annie Can Access

Annie queries your MotherDuck account using DuckDB SQL. This includes:

* **MotherDuck databases** — your own databases and shared datasets
* **Attached storage** — S3 buckets, Azure Blob Storage, or GCS buckets connected via DuckDB secrets
* **Sample data** — MotherDuck's shared sample datasets (NYC taxi, Hacker News, etc.)

Annie uses read-only queries by default and always applies `LIMIT` clauses to avoid returning excessive data.

## Security

* Your MotherDuck token is encrypted at rest using AWS KMS
* The token is never exposed to the AI agent — it is resolved at request time by the agent gateway
* Annie uses read-only queries and cannot modify or delete data

## Troubleshooting

### "Invalid MotherDuck Token"

* Verify your token at [app.motherduck.com](https://app.motherduck.com) > Settings > Access Tokens
* Ensure the token has not expired or been revoked
* Read-scaling tokens and access tokens are both supported

### "MotherDuck MCP unreachable"

* MotherDuck's MCP endpoint may be temporarily unavailable
* Check [MotherDuck status](https://status.motherduck.com) for outages
* Retry after a few minutes

### Annie doesn't use MotherDuck tools

* Verify the integration shows **Active** status on the integrations page
