Set up or troubleshoot MotherDuck connections, the MotherDuck MCP server in AI clients, authentication, client runtimes, and read scaling.
Capabilities
Runtime Selection
Pick the connection method (above) and the runtime separately
Related Skills
Load related skills only for missing capabilities; reuse established…
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.0.51
Connect to MotherDuck
Source Of Truth
- Prefer current MotherDuck connection, attach-mode, read-scaling, and multithreading docs.
- If the MotherDuck MCP
ask_docs_questiontool is available, use it first for current connection behavior. - When it is unavailable, verify guidance against the public docs before making firm claims about connection strings, token types, or read-scaling behavior.
Default Posture
- Start with the PG endpoint (MotherDuck's Postgres-compatible endpoint) for backend applications, BI tools, and serverless runtimes that want PostgreSQL wire compatibility.
- For BI tools, treat the PG endpoint as the compatibility path for Power BI, Tableau Cloud, and Sigma (public beta, read-only, with a read-scaling token) when current docs list them as supported. For spreadsheet users, the MotherDuck for Excel add-in (preview) loads tables and PivotTables and can write ranges back without a driver.
- Use the native DuckDB API when you need local files, hybrid local/cloud execution, or direct DuckDB control.
- Use
md:workspace connections for multi-database exploration, bootstrap flows, and temporary validation environments. - Reuse an existing connection, connector, or environment-managed token when the user's context already provides one; do not ask for secrets that can be discovered from the active workspace. When only the MotherDuck MCP server is connected and a one-off local session needs credentials,
get_short_lived_tokenreturns a temporary token and endpoint details; pass it through the process environment and never write it to files, code, or logs. Deployed services still need a service-account token. - Start with one connection. Add pooling or read scaling only when real concurrent-read pressure exists.
- For services that should fail over instead of blocking while a Duckling starts, bound native
md:connects withconnection_timeout(md:my_db?connection_timeout=30s,MOTHERDUCK_CONNECTION_TIMEOUT, orSET motherduck_connection_timeout = '30s'before the firstATTACH 'md:'). It applies to DuckDB clients with the MotherDuck extension, not the PG endpoint or Wasm. Without it, only network retries are bounded. - To connect an AI client (Claude, Cursor, VS Code, Gemini CLI, ChatGPT, Codex) to MotherDuck, use the hosted MCP server at
https://api.motherduck.com/mcp; readreferences/MCP_SETUP.md. - Use native DuckDB
custom_user_agentwhere supported; for PG endpoint clients, prefer the client'sapplication_namesetting when available. The tag shows per query in the Duckling Overview, which makes it the quickest way to see which workload is using a Duckling.
Runtime Selection
Pick the connection method (above) and the runtime separately. The runtime is what actually executes queries: MotherDuck MCP, the MotherDuck CLI, a Python or Node process, or the DuckDB CLI.
For answer, review, or planning requests, inspect the available runtimes and recommend a path without installing anything. Install or configure a runtime only when the user asks to connect, build, or change the application.
Reuse the project’s language, dependencies, and working connection. Prefer MCP for chat-only exploration and the MotherDuck CLI for file-shaped Dive/Flight work or large output. For application code, use its existing runtime; choose a new runtime only when none is established.
Before installing a DuckDB client, check https://motherduck.com/docs/duckdb-versions.json and pin a MotherDuck-supported version. Keep an existing compatible pin unless the task requires an upgrade. See the runtime reference for installation examples.
As of December 2026 MotherDuck accepts DuckDB 1.4.x through 2.0.1 (the exact minimum varies by region), and new installs should take 2.0.1 for the current optimizations. DuckDB 2.0.0 cannot connect, and 1.3.x is no longer supported. The MotherDuck CLI needs 1.5.5 or later. The ranges move with each release, so read the live JSON rather than trusting these numbers.
Workflow
- Choose the connection path for the workload; keep ingestion and serving paths distinct when their needs differ.
- Put the MotherDuck token in environment-managed secrets, not in source code.
- Establish the connection with explicit SSL settings where required.
- Verify the connection with
SELECT 1 AS connectedand then list reachable tables. - If the workload is read-heavy and concurrent, evaluate read scaling and a stable
session_nameper end user.
References
- Read
references/MCP_SETUP.mdto add the MotherDuck MCP server to an AI client.
Read only the reference sections needed for the current task.
- Read
references/CONNECTION_GUIDE.mdfor connection-method selection, PG endpoint and native DuckDB examples, token handling, read scaling, attach modes, and common failure modes - Read
references/RUNTIME_SELECTION.mdfor the MCP-vs-Python-vs-Node-vs-CLI decision tree, detection commands, install snippets, and the DuckDB version-pinning workflow
Related Skills
Load related skills only for missing capabilities; reuse established context.
motherduck-explorefor discovering databases, tables, columns, and shares after the connection is establishedmotherduck-queryfor executing DuckDB SQL against the connected databasesmotherduck-duckdb-sqlfor DuckDB syntax and function lookup supportmotherduck-rest-apifor control-plane admin operations; those useMOTHERDUCK_ADMIN_TOKEN, which is never used for database connectionsmotherduck-clifor terminal queries and file-oriented Dive/Flight authoring
Explore more skills
Browse all- Motherduck Design DiveDesign or improve a MotherDuck Dive’s layout, responsive behavior, themes, filters, and visual accessibility.
- Motherduck Build Malleable DiveBuild a generative MotherDuck Dive where a Flight writes a daily briefing and question-to-page specs from a semantic…
- Motherduck Manage GuidesRead or maintain MotherDuck Guides for business definitions, join rules, and reusable warehouse conventions.
- Motherduck Model DataDesign or implement MotherDuck analytical schemas and transformation models, including grain, types, and…
- Motherduck ExploreFind and understand MotherDuck databases, tables, columns, shares, and sample data, including which tables hold a given…
- Motherduck Share DataCreate, consume, or manage MotherDuck data shares, including audience grants, table filters, and refresh policy.
Security
Reviews (0)
More from MotherDuck Agent Skills
View source →Frequently asked questions about motherduck-connect
What does the motherduck-connect skill do?
Set up or troubleshoot MotherDuck connections, the MotherDuck MCP server in AI clients, authentication, client runtimes, and read scaling. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the motherduck-connect skill?
Run `npx @skills-hub-ai/cli install motherduck-connect` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/motherduck-connect/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does motherduck-connect work with?
motherduck-connect runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the motherduck-connect skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use motherduck-connect after installing it?
In Claude Code, type `/motherduck-connect` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the motherduck-connect skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/motherduck-connect)<a href="https://skills-hub.ai/skills/motherduck-connect"><img src="https://skills-hub.ai/api/badges/skill/motherduck-connect" alt="Install on Skills Hub"></a>More options in the badge docs.