Skip to main content

MotherDuck CLI: query, pipelines, dashboards for your agents and CI

2026/09/16

TL;DR: Mehdi Ouazza introduces the MotherDuck CLI: one install to query data, publish Python pipelines, and host dashboards from the terminal. He hands Claude Code a single prompt and watches it install the CLI, spin up a free temporary org, and analyze a 3.87M-row Hacker News dataset end to end, then explains when the CLI beats the MCP server and when it doesn't.

Why build a CLI when the MCP already exists

MotherDuck already reaches agents through web UI connectors and a remote MCP server. The CLI adds a third path, and it's not only for AI. It works the same way whether a coding agent calls it, a GitHub Action runs it, or someone types it into a Makefile. The practical difference from MCP comes down to round-trips. Editing a Dive over MCP means the agent reads the remote hosted file, edits it, and sends it back on every iteration. Locally, the agent can just cat the file. Fewer tokens, fewer network hops, faster iteration.

Zero setup, one prompt

Mehdi's demo needs nothing installed ahead of time. A coding agent gets one prompt, installs the CLI, and runs motherduck new to spin up a free temporary org (claimable later via a URL) before analyzing a public dataset. In a second live run, a fresh Claude Code session takes the same prompt from scratch, hits a reserved-keyword SQL error, retries automatically using the CLI's own error output, and comes back with actual findings: Hacker News story volume held flat at 23,000–27,000 stories a month over the sampled window.

What's under the CLI

The CLI wraps MotherDuck's full surface: DuckDB compute, Flights for Python pipelines, Dives for dashboards, and Guides for org-specific context. Guides ship with the binary, so an agent calling --help on any command gets built-in documentation without needing the MCP or the docs site. Every command supports JSON output, which makes results and logs easy for an agent to parse.

Using it without any agent at all

The CLI also replaces multi-step DuckDB setup in CI. A GitHub Action or Makefile that used to install a DuckDB client, check version compatibility, and ATTACH 'md:' manually can now run a single motherduck flights push step. No AI involved.

FAQS

The MotherDuck CLI is a command-line tool that installs a MotherDuck-compatible version of the DuckDB CLI alongside MotherDuck's own CLI for querying, managing pipelines, and hosting dashboards from the terminal. You install it with a single curl script. If you already have a compatible DuckDB version, pass a flag to skip that part of the install.

Depends on where you're working. The MCP server makes more sense inside a chat interface or when an agent needs to talk to MotherDuck through natural language. The CLI makes more sense in a coding agent's local shell, a GitHub Action, or a Makefile — particularly when you want fewer round-trips. Editing a Dive locally, for example, lets the agent read the file directly rather than fetching it from a remote server on every iteration.

No. Running motherduck new creates a free temporary organization with no signup. You can claim it later by visiting the URL it generates. motherduck.com/try gives you the same zero-setup experience from a browser if you don't want to install anything locally.

Yes. The CLI works the same way in a GitHub Action or Makefile as it does in an agent's shell. A workflow that previously installed a DuckDB client, verified version compatibility, and manually attached to MotherDuck can collapse into a single CLI install step plus a command like motherduck flights push. No AI involved.

Guides are MotherDuck's context layer — org-specific rules and definitions (like a preferred visual style for dashboards) stored in your MotherDuck organization. The CLI also ships built-in help for every command directly in the binary, so an agent can call --help to get guidance without reaching out to the MCP server or the documentation site.

Related Videos