How to integrate MotherDuck MCP with Atomic Agent

Connect Atomic Agent to MotherDuck MCP. Explore schemas in motherduck databases, query flight data in motherduck, and more using natural language, with authentication handled for you.

MotherDuck MCP logoMotherDuck MCP
Dcr Oauth

MotherDuck MCP is MotherDuck's official hosted server for database access and management. It provides a secure bridge to MotherDuck data, schemas, and database operations.

45 Tools

Introduction

Atomic Agent is an open-source AI agent that runs on your machine and supports local models through llama.cpp. Connect it to 1,700+ apps through Composio, including MotherDuck.

This guide uses Atomic Agent's built-in Composio integration. You need Atomic Agent v0.5.6 or later, your own Composio API key, and a MotherDuck account. See the Atomic Agent documentation for installation instructions.

Also integrate MotherDuck MCP with

How Atomic Agent connects to MotherDuck

Atomic Agent connects to Composio's Tool Router over Streamable HTTP MCP. It discovers the tools needed for your request, and Composio handles account authentication.

Execution and account-connection tools follow Atomic Agent's configured approval policy. Review any approval prompt before allowing an action on your connected account.

Connect MotherDuck to Atomic Agent

  1. Sign up or sign in to the Composio dashboard. Copy your API key.
  2. In Atomic Agent, open the Integrations tab and select Composio. Select API key, press e, paste the key, and press Enter. The tools become available immediately, without a restart.
  3. Ask Atomic Agent to do something in MotherDuck. It searches Composio for the right tool.
  4. On first use, open the sign-in link returned in the chat. Connect your MotherDuck account, then return to Atomic Agent to continue.

Headless setup

Add the following line to ~/.atomic-agent/.env, replacing YOUR_COMPOSIO_API_KEY with your key. Start Atomic Agent after saving the file.

bash
COMPOSIO_API_KEY=YOUR_COMPOSIO_API_KEY

What is the MotherDuck MCP server, and what's possible with it?

The MotherDuck MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your MotherDuck account. It provides structured and secure access to your databases, schemas, tables, views, and curated data guidance, so your agent can explore data, run SQL queries, manage scheduled Python jobs, and create or share data dives on your behalf.

  • Database and schema exploration: Have your agent list databases, tables, views, columns, macros, and shares, or search the catalog to find the data you need.
  • Data analysis and SQL: Instruct your agent to consult your organization’s query guidance, run read-only DuckDB queries, and execute SQL that changes data, schemas, or connection state.
  • Scheduled data jobs: Let the agent create, edit, run, monitor, and cancel MotherDuck flights, then retrieve their run history, logs, and versions.
  • Interactive data dives: Direct your agent to create, read, edit, share, and delete dives that present MotherDuck data through JSX and React components.
  • Data documentation and access: Have your agent create, update, browse, and delete markdown guides, then set whether each guide is private or visible to the organization.

Use MotherDuck from Atomic Agent

With your account connected, ask Atomic Agent to work with MotherDuck in natural language. You can connect more apps through the same Composio integration as you need them.

Visit the Atomic Agent website or inspect the Atomic Agent source code.

Troubleshooting

Why is my API key rejected?

Copy the key directly from the Composio dashboard. Atomic Agent requires ASCII characters because it sends the key in an HTTP header. Remove any extra characters introduced when copying.

Why are Composio tools unavailable after saving a key?

Check that you use Atomic Agent v0.5.6 or later and that Composio is enabled in your configuration. A "composio": { "enabled": false } setting disables the integration while keeping the saved key on disk.

Does Composio have a free plan?

The Hobby plan includes 100,000 tool calls per month. Composio-managed OAuth apps have a lower included allowance. See Composio pricing for the current limits that apply to your connection.

TOOLS

Supported Tools

Every MotherDuck MCP action and event your agent gets out of the box.

Ask docs question

Ask a question about DuckDB or MotherDuck.

Cancel flight run

Cancel an in-flight run of a flight.

Create flight

Create a new MotherDuck flight.

Create guide

Create a new guide — a markdown document that agents read to answer this org's data questions correctly (metric definitions, join/filter conventions, pitfalls).

Delete dive

Delete a dive by ID.

Delete flight

Permanently delete a flight, its versions, schedule, and run history.

Delete guide

Soft-delete a guide while preserving its version history.

Dive query

Execute a read-only DuckDB query on behalf of a dive.

Edit dive content

Edit a dive's content by applying one or more text replacements, then save to MotherDuck.

Edit flight source

Edit a flight's source_code by applying one or more text replacements, then save as a new FlightVersion.

Edit guide content

Edit a guide's markdown body by applying one or more text replacements, then save as a new version.

Get dive guide

Load instructions for creating MotherDuck dives.

Get flight

Fetch a flight by UUID.

Get flight guide

Load instructions for authoring, scheduling, running, and troubleshooting MotherDuck flights.

Get flight logs

Fetch the plain-text logs (stdout + stderr) of a flight run plus the matching `Run` record (status, exit_code, timing).

Get flight run

Fetch a single run of a flight by its sequential run number (from list_flight_runs).

Get guide

Load a guide by uuid.

Get query guide

Call this before writing SQL to answer a data question.

Get short lived token

Returns a short-lived token and connection details for the MotherDuck database endpoint.

List columns

List all columns of a table or view with their types and comments.

List databases

List all databases in your MotherDuck account.

List dives

List all dives in MotherDuck.

List flight runs

List executions of a flight, newest first.

List flights

List MotherDuck flights.

List flight versions

List the immutable versions of a flight, newest first.

List guides

Browse this organization's curated guides — markdown documents that capture organization and personal context about the data in MotherDuck.

List macros

List all macros (table and scalar macros) in a MotherDuck database, with their schema and parameters.

List shares

List all database shares that have been shared with you.

List tables

List all tables and views in a MotherDuck database with comments.

List views

List all views in a MotherDuck database, with their schema, comment, and column count.

Log dive viewer event

Log a dive viewer event for analytics.

Mint dive state reference

Mint a server-stored reference for a `useDiveState` bag and return its id.

Query

Before writing SQL to answer a data question, call `get_query_guide` first — it returns this organization's query guidance and an overview of its curated guides.

Query rw

Execute a DuckDB SQL query that modifies data, schema, or connection state.

Read dive

Read a specific dive by ID, including its full JSX/React component code.

Run flight

Trigger an on-demand execution of a flight using its current version.

Save dive

Save a new dive to MotherDuck.

Search catalog

Search the catalog for databases, schemas, tables, columns, and shares using fuzzy matching.

Set guide access

Set a guide's visibility to 'user' (private to the owner) or 'organization' (visible to the whole org).

Share dive data

Share the data for a dive with your organization.

Update dive

Update an existing dive's title, description, or content.

Update flight

Update a flight.

Update guide

Append a new version to an existing guide, identified by `uuid`.

Update guide metadata

Change a guide's title, description, or topic without appending a content version.

View dive

Open and render a MotherDuck Dive as a live MCP app with interactive charts.

FAQ

Frequently asked questions

With a standalone MotherDuck MCP server, the agents and LLMs can only access a fixed set of MotherDuck tools tied to that server. However, with the Composio Tool Router, agents can dynamically load tools from MotherDuck and many other apps based on the task at hand, all through a single MCP endpoint.

Yes, you can. Atomic Agent fully supports MCP integration. You get structured tool calling, message history handling, and model orchestration while Tool Router takes care of discovering and serving the right MotherDuck tools.

Yes, absolutely. You can configure which MotherDuck scopes and actions are allowed when connecting your account to Composio. You can also bring your own OAuth credentials or API configuration so you keep full control over what the agent can do.

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your MotherDuck data and credentials are handled as safely as possible.

Start with MotherDuck MCP.It takes 30 seconds.

Managed auth, hosted MCP servers, and every MotherDuck MCP tool your agent needs.Free to start.

Start building