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 44 tools.

Tools
44
What they doRead · write · destructive
24 · 17 · 324 read17 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_flight_guide',
    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
    Read-only DuckDB SQL query to execute.
    databasestring
    Database name to query.
    dive_idstring
    Dive UUID for query attribution.
  • 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
    Flight identifier.
    versioninteger
    1-indexed version number; omit for 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
    Flight identifier (UUID).
    run_numberintegerrequired
    Sequential run number, as returned by list_flight_runs.
    max_bytesinteger
    Optional max bytes of logs to return; the response is truncated to fit and the truncation is reported via truncated: true.
  • motherduckmcp_get_guideLoad a guide by uuid.Read-only

    Get Guide

    Load a guide by uuid. Guides are curated markdown documents about this organization's data (metric definitions, conventions, pitfalls). Find a guide's uuid with list_guides or via get_query_guide, get_dive_guide, or get_flight_guide.

    Inputs

    uuidstringrequired
    The guide's UUID, as returned by list_guides or a previous mutation.
    versioninteger
    Version number to read; defaults to the current version.
  • motherduckmcp_get_query_guideCall this before writing SQL to answer a data question.Read-only

    Get Query Guide

    Call this before writing SQL to answer a data question. Returns this organization's query guidance: what guides exist (curated markdown documents about the data), how to navigate them, and an overview of the available guide topics.

    Inputs

    This tool takes no inputs.