LEARN HOW TO PREPARE YOUR DATA WAREHOUSE FOR AGENTIC AI WORKLOADSRegister for the webinar

Skip to main content

Talk to Your Data with AI

The MotherDuck MCP Server lets you analyze your data using natural language. Connect your favorite AI assistant—Claude, ChatGPT, Cursor, or others—and start asking questions about your databases without writing SQL.

In this guide, you'll set up the MCP server in Claude Desktop, verify the connection, and run your first AI-powered data analysis in under 5 minutes.

What you'll learn

  • Install and configure the MotherDuck MCP Server in Claude Desktop
  • Verify the connection and permissions
  • List your databases
  • Ask analytical questions about your data

Prerequisites

Using a different AI client?

This guide uses Claude Desktop, but the MCP Server works with ChatGPT, Cursor, Claude Code, and other MCP-compatible clients. See the MCP Server setup page for instructions for your preferred client.

Step 1: Add the MCP Server to Claude Desktop

Open Claude Desktop settings and add the MotherDuck MCP Server:

  1. Open Claude DesktopSettingsConnectors
  2. Click Browse Connectors and search for "MotherDuck"
  3. Click Add to install the MotherDuck connector
  4. A browser window opens—authenticate with your MotherDuck account

Step 2: Verify tools and permissions

After adding the connector, confirm Claude has access to the MotherDuck tools:

  1. Open Claude DesktopSettingsConnectors
  2. Select MotherDuck and click on Configure

You should see tools like query, list_databases, and ask_docs_question available.

Each tool has a permission setting that controls how Claude can use it:

PermissionBehavior
Always allowClaude uses the tool automatically without asking. Faster iteration when errors occur, but no human confirmation before each action.
Needs approvalClaude asks for your confirmation before each tool use. Gives you visibility into every action.
BlockedClaude cannot use this tool.
tip

Since the MCP Server only provides read-only access to your databases, setting tools to "Always allow" is safe and enables faster back-and-forth when Claude needs to retry or refine queries if errors occur.

Step 3: List your databases

Test the connection by asking Claude to list your databases:

Try this prompt:

List all my databases on MotherDuck.

Claude will use the MCP tools to connect to MotherDuck and return your database list.

Step 4: Analyze your data

Now let's run an actual analysis. If you don't have data yet, you can attach the sample Hacker News database:

Attach the sample database:

Attach this db 'md:_share/hacker_news/de11a0e3-9d68-48d2-ac44-40e07a1d496b' give me some analytics.

The hacker_news database contains Hacker News stories, comments, and metadata from 2016 to 2025. You'll see that even with a minimal prompt, you get great results for a first data exploration. For more tips on effective prompting and workflow patterns, check out the MCP Workflows Guide.


Sample databases

The hacker_news database is one of several sample datasets available. You can also attach it manually with SQL:

ATTACH 'md:_share/hacker_news/de11a0e3-9d68-48d2-ac44-40e07a1d496b' AS hacker_news;

See Sample Data & Queries for more datasets to explore.

What's happening under the hood

When you ask Claude a question about your data:

  1. Schema exploration: Claude examines your database structure to understand available tables and columns
  2. Query generation: Based on your question, Claude writes DuckDB SQL
  3. Query execution: The MCP Server runs the query on MotherDuck
  4. Results interpretation: Claude explains the results in natural language

You can also inspect which SQL query the MCP executed by expanding the tool call in the conversation:

Inspecting the query executed by MCP

Next steps

You're now ready to analyze your data with AI. Here are some ways to go deeper:

  • MCP Server Setup — Setup for Claude, ChatGPT, Cursor, and other clients
  • MCP Workflows — Tips and patterns for effective AI-powered analysis
  • Sample Datasets — Explore sample data including Hacker News, NYC 311, and more