In my experience, the longest part of a data project was pulling the data from all over the place into one place.
I've heard horror stories of migrations that took years.
Now it takes a couple of prompts.
MotherDuck Flights is a serverless Python runtime that can pull data from anywhere, transform it, and even take action on it.
But you don't need to write any Python!
An agent combined with the MotherDuck Remote MCP Server can script full data pipelines for anyone in your organization, regardless of how technical they are.
That same MCP server can also visualize your data with MotherDuck Dives for a truly end to end experience.
Connect to it in a couple of clicks without any installation.
Then, find a source dataset, pull it, transform it, visualize it, and export it all without leaving your agent chat window or your terminal.
Other tools have layers upon layers of configuration, but we mean it when we say it only takes seconds.
We'll look at some Flights from our "Flight Plans" templates so you can see what's possible, ranging from ingesting data from Postgres, to syncing data with Google Sheets, to sending Slack alerts.
Taking off on your first Flight
You'll be up and running faster than an airline safety briefing!
First let's get set up.
- Make a MotherDuck account
- We have a 7 day free trial!
- Connect your agent to the MotherDuck Remote MCP
- Nothing to install: just sign in to our connector in Claude, ChatGPT, or any agent that speaks MCP
- You're all set! Ask your agent to build a Flight
Welcome aboard!
When we developed Flights, we wanted them to be amazing at 2 key things: ease of use and flexibility.
Easy for humans and agents
Anyone can fly this plane.
Hopping on your first Flight takes just a few minutes, then as little as a single prompt after that.
That means the subject matter experts at your company can analyze their data, regardless of where they sit in the organization.
There are other aspects of the architecture of Flights that help make things easy.
Flights are serverless, just like MotherDuck's SQL runtime, so they spin up only when your agents need them.
You only pay for the exact seconds they are running.
To use them, you bring your own agent, so they fit right in with your existing workflow.
That also means you can reuse the subscription you are likely already paying for.
The runtime is sandboxed (also just like MotherDuck's SQL compute) so you can let your agent run freely on your behalf.
Maximum flexibility
Feel free to move about the cabin...
The hardest data problems don't fit neatly into a predefined set of boxes.
To do data engineering well requires a flexible toolset.
In Flights, you can install any Python package you want.
Is there a package on PyPI from a 35 GitHub star repo that does exactly what you need?
Or maybe you need LiteLLM to send prompts to an LLM provider?
Just add the library to your requirements.txt.
There's no restrictive "approved list" since each Flight is a nicely isolated sandbox.
If you prefer transformations in Python over SQL, say for pulling apart some deeply nested and not quite consistent JSON (ask me how I know...), you can import your dataframe library of choice.
Any DuckDB extension, either core or community, is available to you as well.
There are over 200 extensions, ranging from readers for domain specific file formats in astronomy to parsing markdown to powerful statistical functions.
They can be very effective for loading data into MotherDuck since they use DuckDB's memory-efficient engine.
Flights can request data from all over the internet.
Load operational data from your transactional systems like Postgres or pull customer data from your CRM.
Even extract data out of your pre-existing data warehouse.
You can use MotherDuck Secrets to securely authenticate to any of your company's systems.
Adventurous prompters can even install Linux packages or run shell commands to kick off scripts in any language.
All this flexibility can be a little overwhelming at first, even with agents to help.
Sometimes the first brush stroke on a blank canvas is the hardest part!
To help keep things easy, we can lean on Flight Plans: templates for common operations that you and your agent can use as inspiration.
Get inspired with Flight Plans
In the MotherDuck Docs we're building up a wide variety of example Flight Plans, but taking a different approach for the agentic era we're in.
While these templates work out of the box, we predict that you and your agent will want to customize extensively.
Our MCP is aware of these templates and will search for them on your behalf automatically.
You will already benefit from them without even knowing it!
We also include questions that your agent will need to answer to tailor the solution to your use case.
If you're exploring manually (we used to call that reading the docs!), each Flight Plan has a prompt at the top you can share with your agent to bring the template into context.
The full Python script and requirements.txt file are also available.
Ingest from Postgres

Pulling data from Postgres into MotherDuck in a Flight is straightforward. Just configure which schemas or tables you want to replicate, securely store your Postgres credentials in a MotherDuck Secret, and your data will be synced over.
We use the DuckDB Postgres extension to pull from Postgres to the DuckDB Python library running in the Flight and then use MotherDuck's Dual Execution to send the data from DuckDB to MotherDuck, which gives us some nice benefits.
This approach works on any Postgres table regardless of how big it is.
The data is never fully materialized in memory - it is streamed over chunk by chunk and loaded into MotherDuck piece by piece as well.
But you don't have to define any chunking scheme or set any parameters!
DuckDB automatically parallelizes at a very granular level to move the data over quickly and easily.
This Flight follows data engineering best practices to make sure that each table load is atomic (meaning you can never have partially loaded data) and idempotent (so you can retry it any time).
Loads are retried on failure in case of a network hiccup and helpful logging provides good visibility.
While building these templates, I've found that adding retries and logging is just an extra sentence each in my prompt.
Following best practices has never been so easy!
If you have some data in Postgres and your analytical queries are slow, you can be testing on MotherDuck in minutes.

Flights are also helpful for transforming your data once it already lives within MotherDuck.
The "Run SQL Transformations in Order" Flight enables you to do SQL query orchestration on a schedule and avoid adding another tool to your stack until your business gets much more complex.
It takes a set of CREATE TABLE AS (CTAS) or CREATE VIEW AS statements, analyzes them, and runs them in dependency order (in a DAG).
If queries are independent, they can run in parallel up to a maximum pool size.
It uses the powerful industry-standard Python library SQLGlot to parse both the name of the new table or view and the datasets it depends on upstream.
Data engineering best practices like retries and skipping downstream models if a model fails are built in as well.
To adapt it to your use case, you or your agent just need to replace the SQL statements at the top of the Python script with your own, choose a database to write to, and pick how parallel you would like things to be.
Since SQL statements would be pretty long and ugly to include in a config, editing the Python script directly is the way to customize this template to your use case.
Google Sheets syncing

Push the output of your MotherDuck analytics into any downstream system with a Flight.
This concept has gone by many names over time from business process automation to reverse ETL, but the current name for this pattern is data activation.
Once you have conducted an analysis in MotherDuck, you want to take action on it by pushing it into the systems where other business tasks are done.
In many cases, those tasks are executed in spreadsheets.
As a recovering spreadsheet guru, I think spreadsheets are a tremendous net positive by themselves, but particularly helpful if they can be integrated within the data platform rather than living outside of it.
The "Sync Google Sheets and MotherDuck" Flight can pull from Google Sheets into MotherDuck or push MotherDuck query results into Sheets.
It is powered by the GSheets DuckDB community extension.
Just set up a Google service account (Claude was able to do this on my behalf!) and specify which tables to import and the queries to export.
Now you can cross out that "export to csv" request off your todo list!
Slack alerts
Timely alerts are powerful for system monitoring but also for monitoring your business overall.
Did returns spike?
Is order volume outpacing supplier deliveries?
Maybe your agentic chat system is using more tokens than expected...
This is a pattern that Flights unlock - push time sensitive analysis into whatever system you use to monitor business health.
One system in particular is where a lot of collaboration gets done: Slack.
Decisions are made there and it is a great way to broadcast information to everyone who needs to know.
In this Flight Plan, you can configure an alert on stale tables to be sent to Slack.
The alert is just triggered by running a SQL query and comparing the result to a threshold, so it is a very flexible pattern.
If you want to fully embrace this, you could even implement control charts to only send alerts when there is a strong signal.
The sky's the limit
Flights are an AI-native serverless compute sandbox that lives within your data warehouse.
It is built for everyone on your team, from the most expert data engineer to the domain experts in your business or your executive team.
They are really effective for core data engineering workflows like ingestion and transformation, but their flexibilty unlocks broader use cases like data activation, alerting, machine learning, or agentic harnesses.
As we like to say, anything is just one prompt away.
Give Flights a try with a MotherDuck free trial!