---
title: "MotherDuck CLI vs MCP: When to Use Each | MotherDuck"
description: "One CLI to query MotherDuck, publish Python pipelines, and host dashboards from the terminal. See when it beats the MCP server, and when it doesn't."
canonical: "https://motherduck.com/videos/motherduck-cli-vs-mcp/"
---

[BACK TO VIDEOS](/videos/)

[Stream](/videos/?category=Stream#videos-and-webinars-library)[MotherDuck Features](/videos/?category=MotherDuck%20Features#videos-and-webinars-library)[AI, ML and LLMs](/videos/?category=AI,%20ML%20and%20LLMs#videos-and-webinars-library)[Data Pipelines](/videos/?category=Data%20Pipelines#videos-and-webinars-library)

# 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](/product/dives/) 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](/product/mcp-server/) full surface: DuckDB compute, [Flights](/product/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.

TABLE OF CONTENTS

- Why build a CLI when the MCP already exists
- Zero setup, one prompt
- What's under the CLI
- Using it without any agent at all

Start using MotherDuck now!

[Try 7 Days Free](https://auth.motherduck.com/authorize?app_source=web&response_type=code&client_id=bza3KWQpxRAFlTlRFXUo29AOg9xD7zcp&redirect_uri=https%3A%2F%2Fapp.motherduck.com%2F&state=STATE&auth_flow=signup&screen_hint=signup&ext-ph_distinct_id=fbee07fb-1c04-4129-b1a4-988f6a079a1f)

## FAQS

### What is the MotherDuck CLI and how do I install it?

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.

### Should I use the MotherDuck CLI or the MCP server?

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.

### Do I need a MotherDuck account to try the CLI?

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.

### Can the MotherDuck CLI be used in CI/CD without an AI agent involved?

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.

### What are Guides in the MotherDuck CLI?

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

[47:43](/videos/spark-iceberg-motherduck-pipeline/)[2026-09-10](/videos/spark-iceberg-motherduck-pipeline/)

### [Data takes Flight: Transforming Data with Spark and MotherDuck via Iceberg](/videos/spark-iceberg-motherduck-pipeline/)

See a live cross-engine pipeline: Spark transcribes audio and writes to Iceberg, then MotherDuck attaches that catalog directly as a queryable database.

Stream

Data Pipelines

dbt

Ecosystem

[58:27](/videos/ducklake-time-travel-schema-evolution/)[2026-09-03](/videos/ducklake-time-travel-schema-evolution/)

### [Time Travel & Schema Evolution: DuckLake Handles Change](/videos/ducklake-time-travel-schema-evolution/)

Learn how DuckLake time travel, schema evolution, and the change feed work: query any snapshot, undo bad writes, and evolve tables without rewrites.

Stream

SQL

Ecosystem

[60:29](/videos/ai-agents-semantic-layer/)[2026-08-26](/videos/ai-agents-semantic-layer/)

### [Do AI Agents Need a Semantic Layer?](/videos/ai-agents-semantic-layer/)

Do AI agents need a semantic layer? Evals comparing plain-text context with a Malloy semantic layer show where each wins, and what it costs.

Stream

AI, ML and LLMs

BI & Visualization

SQL

[View all](/videos/)