Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to the MotherDuck MCP server

Vendor MCP
Open markdown

The MotherDuck MCP connector routes your AI agent's tool calls to MotherDuck's own MCP server through Scalekit. Each user signs in to MotherDuck once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 50 tools.

Tools
50
What they doRead · write · destructive
27 · 20 · 327 read20 write3 destructive
Users sign in with
OAuth app
Scalekit's or your own

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the MotherDuck MCP connection

    In AgentKit > Connections, create a MotherDuck MCP connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for MotherDuck MCP server, so you don't need to register an OAuth app.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'motherduckmcp'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize MotherDuck MCP:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'motherduckmcp_get_connection_info',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • motherduckmcp_ask_docs_questionQuery official DuckDB and MotherDuck documentation to answer questions about SQL syntax, features, and best practices.Read-only

    Ask Docs Question

    Query official DuckDB and MotherDuck documentation to answer questions about SQL syntax, features, and best practices.

    Inputs

    questionstringrequired
    Question about DuckDB or MotherDuck.
  • motherduckmcp_dive_queryExecute a read-only DuckDB SQL query on behalf of a Dive, attributed to the specified Dive UUID.Read-only

    Dive Query

    Execute a read-only DuckDB SQL query on behalf of a Dive, attributed to the specified Dive UUID. Used by the Dive viewer for query execution.

    Inputs

    sqlstringrequired
    SQL query to execute
    databasestring
    Database name to query
    dive_idstring
    Dive UUID for fallback query attribution
  • motherduckmcp_get_connection_infoShow the MotherDuck user and organization this connection is signed in as: the user's name and email, and the organization's name and web app URL.Read-only

    Get Connection Info

    Show the MotherDuck user and organization this connection is signed in as: the user's name and email, and the organization's name and web app URL. A user can belong to several organizations, and every tool call runs in this one. Call this when the user asks which account or organization they are connected to, or when data, dives or flights they expect are missing.

    Inputs

    This tool takes no inputs.

  • motherduckmcp_get_dive_guideRetrieve comprehensive instructions for creating MotherDuck Dives (interactive React data apps), tailored to the calling AI client.Read-only

    Get Dive Guide

    Retrieve comprehensive instructions for creating MotherDuck Dives (interactive React data apps), tailored to the calling AI client.

    Inputs

    clientstringrequired
    AI platform making the request.one of claudechatgptclaude_coworkclaude_codeother
  • motherduckmcp_get_flightFetch a Flight's metadata and version snapshot by UUID, including source code, requirements, config, secret names, and token name.Read-only

    Get Flight

    Fetch a Flight's metadata and version snapshot by UUID, including source code, requirements, config, secret names, and token name.

    Inputs

    idstringrequired
    The flight UUID
    content_limitinteger
    Optional maximum number of content characters to return in this call. Values above the server-defined maximum are clamped to that maximum. Default and line-range reads stop at a complete line when possible; exceptionally long lines may be partial.
    content_offsetinteger
    Optional 0-indexed character offset into the content. Use next_content_offset from a truncated response to continue through very long or generated lines.
    end_lineinteger
    Optional 1-indexed last content line to return (inclusive). Requires start_line.
    searchstring
    Optional case-insensitive literal text to search for in the content. Returns matching lines with line numbers; cannot be combined with content_offset, start_line, or end_line.
    start_lineinteger
    Optional 1-indexed first content line to return. Use with end_line to read a focused range after a truncated response.
    versioninteger
    Optional 1-indexed version number. Omit to get the current version.
  • motherduckmcp_get_flight_guideRetrieve the authoritative guide for working with MotherDuck Flights (anatomy, config vs.Read-only

    Get Flight Guide

    Retrieve the authoritative guide for working with MotherDuck Flights (anatomy, config vs. secrets, scheduling, run lifecycle, common failures). Call this first before using other Flight tools.

    Inputs

    This tool takes no inputs.

  • motherduckmcp_get_flight_logsFetch the plain-text logs (stdout + stderr) of a Flight run plus the matching Run record (status, exit_code, timing).Read-only

    Get Flight Run Logs

    Fetch the plain-text logs (stdout + stderr) of a Flight run plus the matching Run record (status, exit_code, timing). Logs may be large; pass max_bytes to cap the response size — the response will be the tail when truncated.

    Inputs

    idstringrequired
    The flight UUID
    run_numberintegerrequired
    Sequential run number
    limitinteger
    Max log lines to return (default: 200)default 200
    max_bytesinteger
    Optional max bytes of logs to return; the response is truncated to fit, keeping the end `order` reads from.default 50000
    offsetinteger
    Number of lines to skip, counted from the end `order` reads from
    orderstring
    'asc' reads from the first log line, 'desc' from the last (default: 'desc')one of ascdescdefault desc
  • motherduckmcp_get_flight_runFetch a single run of a flight by its sequential run number (from run_flight or list_flight_runs).Read-only

    Get Flight Run

    Fetch a single run of a flight by its sequential run number (from run_flight or list_flight_runs). Returns its status (PENDING/RUNNING/SUCCEEDED/FAILED/CANCELLED), timing metadata, and the effective `config` the run executed with. Use this to poll a run's status.

    Inputs

    idstringrequired
    The flight UUID
    run_numberintegerrequired
    Sequential run number to fetch