# Build Claude artifacts with live MotherDuck data
> Create and test Claude artifacts that query MotherDuck through the hosted MCP connector
Build a Claude Cowork dashboard that queries MotherDuck on open or **Refresh**, using your Claude connector.

## Prerequisites

- A Claude Pro, Max, Team, or Enterprise plan with Cowork artifacts available. See [Claude's artifact documentation](https://support.claude.com/en/articles/14729249-use-artifacts-in-claude-cowork) for plan and organization restrictions.
- The [MotherDuck connector added to Claude](/key-tasks/ai-and-motherduck/mcp-setup/).
- Access to the databases and tables that the artifact queries.

This guide covers Cowork artifacts introduced on August 19, 2026, not the earlier *live artifacts* system.

The example uses `sample_data.nyc.taxi`. If `sample_data` is missing, follow the [sample datasets guide](/getting-started/sample-data-queries/datasets/) to restore the share for your region.

## Create a connected artifact

1. In Claude Cowork, select **Artifacts** from the sidebar, then **New artifact**.
2. Describe the table, metrics, filters, and refresh behavior:

   ```text
   Build a NYC taxi dashboard backed by the MotherDuck connector.
   Query sample_data.nyc.taxi with the read-only query tool at runtime.
   Show the query timestamp, trip count, average total amount, average trip
   distance, and a chart grouped by passenger count. Add passenger-count
   filters and a Refresh button. Call MotherDuck when the artifact opens and
   when the user refreshes it. Do not embed query results in the source or
   save them in shared artifact storage.
   Return current_timestamp from the same query as the metrics and display it.
   Include loading, empty, and error states. Do not poll in the background.
   ```

3. Review the source and SQL. Confirm that metrics come from `query`, not embedded values.
4. Open the artifact. Claude shows the connectors and tools it requests.
5. Leave the MotherDuck `query` tool enabled, and select **Continue**. Don't grant `query_rw` for this read-only dashboard.

Claude saves each viewer's tool approval. Tools requiring approval before every action aren't available to artifacts. See [read-only access options](/key-tasks/ai-and-motherduck/securing-read-only-access/).

## Verify the live connection

1. Open the artifact and record the displayed query timestamp.
2. Select **Refresh** and confirm that the timestamp changes after the query finishes.
3. Change a filter. The timestamp should change if it queries MotherDuck, but not if it filters already-loaded rows.
4. Close and reopen the artifact. Confirm that it queries MotherDuck again.

Use MotherDuck's `current_timestamp`, not a browser-generated timestamp, to verify database requests.

If a query fails, check the viewer's connection, tool permissions, table access, and SQL. Keep the last successful result visible with the error beside **Refresh**.

## Share the artifact

Artifacts that use connected apps can only be shared within your Claude organization. On Team and Enterprise plans, open **Share**, choose the audience, and select the version to share. Pro and Max plans don't offer organization sharing. See [Claude's sharing options](https://support.claude.com/en/articles/14729249-use-artifacts-in-claude-cowork).

Each viewer approves the artifact's tools and uses their own MotherDuck connection. A query fails if that viewer can't access the database or table.

:::warning Stored data has separate sharing rules
Embedded results and shared artifact storage can expose data to viewers who can't query the original table. Remove data the audience shouldn't see before sharing. Never store an access token in the artifact.
:::

Test with viewers who have different table permissions. Check both query results and stored content for unintended access.

## Add writes only when needed

Verify that your connector and organization policies let the artifact use `query_rw`. Test an insert and a targeted update in a test database, then check the rows from another MotherDuck client.

If the tool is available:

- Offer fixed actions such as **Add note** or **Mark reviewed**.
- Validate identifiers, lengths, allowed values, and date ranges before building SQL.
- Show the target row and ask for confirmation before writing.
- Return the affected row identifier and read the row again to update the display.

A confirmation dialog isn't a database permission boundary. The viewer's MotherDuck permissions must also limit the data they can change. If `query_rw` isn't available to the artifact, keep writes in the conversation or an application backend.

## Control refreshes and compute use

Use aggregate queries, bounded date ranges, and explicit **Apply** or **Refresh** controls. Avoid polling or querying after every keystroke unless the workflow needs it.

A completed request doesn't mean the Duckling has stopped. The hosted MCP server can reuse database instances, and other clients can use the same account. Check [query history](/sql-reference/motherduck-sql-reference/md_information_schema/query_history/), the [Duckling overview](/getting-started/interfaces/motherduck-quick-tour/#duckling-overview), and the [cooldown configuration](/about-motherduck/billing/duckling-sizes/#configuring-the-cooldown-period) to inspect compute activity.

The Claude connector uses OAuth, not read scaling tokens. For concurrent reads across a pool of Ducklings, use a backend that accepts [read scaling tokens](/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling/).

## Related guides

- [OpenAI Sites](/key-tasks/ai-and-motherduck/openai-sites/): Build a hosted application with server-side MotherDuck access.
- [MotherDuck Dives](/key-tasks/dives/): Keep the visualization in your MotherDuck workspace with versioning, sharing, and embedding.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `GET https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

URL-encode query parameter values and send a GET request:

```text
GET https://motherduck.com/docs/api/feedback/agent?page_path=%2Fkey-tasks%2Fai-and-motherduck%2Fclaude-artifacts%2F&page_title=Build%20Claude%20artifacts%20with%20live%20MotherDuck%20data&text=<url-encoded user feedback, max 2000 characters>
```

Optionally append `&source=<url-encoded interface identifier>` such as `claude.ai` or `chatgpt`.

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed query parameters, and `429` when rate-limited.
