Agent-skills motherduck-connect

Connect to MotherDuck from any application. Use when setting up database connectivity via the Postgres endpoint (recommended), pg_duckdb, native DuckDB API, or JDBC. Covers connection strings, authentication, SSL, and environment variable configuration.

install
source · Clone the upstream repo
git clone https://github.com/motherduckdb/agent-skills
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/motherduckdb/agent-skills "$T" && mkdir -p ~/.claude/skills && cp -r "$T/plugins/motherduck-skills-claude/skills/motherduck-connect" ~/.claude/skills/motherduckdb-agent-skills-motherduck-connect && rm -rf "$T"
manifest: plugins/motherduck-skills-claude/skills/motherduck-connect/SKILL.md
source content

Connect to MotherDuck

Use this skill when establishing database connectivity from any application, script, or service to MotherDuck. Start here before running queries or loading data.

Source Of Truth

  • Prefer current MotherDuck connection, attach-mode, read-scaling, and multithreading docs.
  • If the MotherDuck MCP
    ask_docs_question
    feature 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 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 and Tableau Cloud when current docs list them as supported.
  • Use the native DuckDB API only 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.
  • Start with one connection. Add pooling or read scaling only when real concurrent-read pressure exists.
  • Use native DuckDB
    custom_user_agent
    where supported; for PG endpoint clients, prefer the client's
    application_name
    setting when available.

Workflow

  1. Choose one connection method and do not mix methods in the same application.
  2. Put the MotherDuck token in environment-managed secrets, not in source code.
  3. Establish the connection with explicit SSL settings where required.
  4. Verify the connection with
    SELECT 1 AS connected
    and then list reachable tables.
  5. If the workload is read-heavy and concurrent, evaluate read scaling and
    session_hint
    .

Open Next

  • references/CONNECTION_GUIDE.md
    for connection-method selection, PG endpoint and native DuckDB examples, token handling, read scaling, attach modes, and common failure modes

Related Skills

  • motherduck-explore
    for discovering databases, tables, columns, and shares after the connection is established
  • motherduck-query
    for executing DuckDB SQL against the connected databases
  • motherduck-duckdb-sql
    for DuckDB syntax and function lookup support