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.



