MotherDuck
Let agents query your MotherDuck databases with DuckDB.
Connect it with: API key. MotherDuck's own documentation: https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/authenticating-to-motherduck/.
What agents can do
Connect MotherDuck so the agents working your tasks can reach it. With it connected, they can:
- Query your MotherDuck databases with DuckDB SQL from the task's environment, for example to answer a data question.
- Join a MotherDuck table with a local CSV or Parquet file the agent produced.
- List databases and tables and read their schemas before writing a query.
- Load a result set into a MotherDuck table for others to use.
Before you start
- A MotherDuck account and a database in it.
- DuckDB available where the agent runs (the duckdb Python package or the duckdb command line); the agent connects with md:DATABASE_NAME and the token in the motherduck_token environment variable.
- A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.
Connect with MotherDuck
Jaah connects to MotherDuck with an API key, not with a sign-in button.
Connect with an API key
Find each value first:
- Access token: In the MotherDuck app, select your organization name (bottom of the left sidebar) > Settings > Integrations > Access Tokens > Create token; pick Read/Write (or Read Scaling for read-only work), then copy the token (it is shown once).
- Database (optional): The database agents open by default, as listed in the MotherDuck app's left sidebar; blank opens your default database.
Then add it to Jaah:
- In Jaah, open Secrets, select New, and pick the MotherDuck card.
- Name the secret and choose who can use it.
- Fill in Access token, Database.
- Select Save. Jaah tests the secret straight away (see Test the connection).
Jaah encrypts what you type and never shows it again — not to you, and not to an admin.
Use your own OAuth app
Not used: Jaah connects to MotherDuck with an API key, not through an OAuth app.
Test the connection
Select Test on the secret. Jaah checks that each value has the right shape, but does not call MotherDuck: the result reads Format checked — MotherDuck was not called. The first real check is when an agent uses it.
Who can use it
Every secret has an owner, and the owner decides who can use it:
- Personal — only your own tasks can use it. This is the default.
- Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
- Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.
More on owners and access: How secrets work.
Use it in an agent session
An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:
org/<name>for an organization secret,projects/<project>/<name>for one attached to a project,me/<name>for your personal one.
A key connection hands the agent its fields: token, database.
Tell the agent in your task description which secret to use, for example “use the MotherDuck secret org/motherduck”.
Manage, rotate or disconnect
Everything is on the secret's page under Secrets:
- Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at MotherDuck once the test passes. Steps: Replace or delete a secret.
- Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at MotherDuck's side too, revoke or delete the key at MotherDuck.
Limitations
- Jaah cannot call MotherDuck to test: it speaks DuckDB's own protocol and Jaah adds no database drivers. Test checks only the token's shape. The first real check is the agent's first query.
- A Read Scaling token can only read. Use a Read/Write token if agents must write.
- A token acts as the user who created it, with all of that user's databases. MotherDuck has no per-database token.
- Agents can do only what the connected MotherDuck account allows.
Troubleshooting
Test says the access token is not in the format MotherDuck uses
Copy the whole token from Create token, with no quotes, spaces or the motherduck_token= prefix.
The agent's query fails with 'Invalid token' or 'Unauthorized'
The token was revoked or has expired. Create a new one under Settings > Integrations > Access Tokens and select Replace on the secret.
The agent's write fails with 'read-only'
The token is a Read Scaling token. Create a Read/Write token instead.
Still stuck? Select Test and read the result: it names the first value that is missing or not in the shape MotherDuck uses. It does not call MotherDuck, so MotherDuck's own errors show only in the agent's session.
FAQ
Do I need DuckDB installed?
The agent's environment needs DuckDB. Most agents install the duckdb Python package themselves when the task asks for it.
Why does Test say MotherDuck was not called?
MotherDuck has no simple web endpoint to check a token, and Jaah does not run database drivers. So Test checks the shape only.
Can Jaah or an admin see the key or token?
No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.
Can I connect more than one MotherDuck account?
Yes. Add one secret per account, each with its own name, and tell the agent which one to use.