Skip to main content

A MCP server for MotherDuck and local DuckDB

Project description

mcp-server-motherduck MCP server

A MCP server for MotherDuck and local DuckDB

Components

Resources

Prompts

The server implements one prompt:

  • duckdb-motherduck-initial-prompt: A prompt to initialize a connection to duckdb or motherduck and start working with it

Tools

The server implements three tools:

  • initialize-connection: Create a connection to either a local DuckDB or MotherDuck and retrieve available databases
    • Takes "type" (DuckDB or MotherDuck) as input
  • read-schemas: Get table schemas from a specific DuckDB/MotherDuck database
    • Takes "database_name" as required string arguments
  • execute-query: Execute a query on the MotherDuck (DuckDB) database
    • Takes "query" as required string arguments

Configuration Claude Desktop

Add the snippet below to your Claude Desktop config and make sure to set the HOME var to your home folder (needed by DuckDB).

When using MotherDuck, you also need to set a MotherDuck token env var.

On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

Servers Configuration

"mcpServers": {
  "mcp-server-motherduck": {
    "command": "uvx",
    "args": [
      "mcp-server-motherduck"
    ],
    "env": {
      "motherduck_token": "",
      "HOME": ""
    }
  }
}

Development

Building and Publishing

To prepare the package for distribution:

  1. Sync dependencies and update lockfile:
uv sync
  1. Build package distributions:
uv build

This will create source and wheel distributions in the dist/ directory.

  1. Publish to PyPI:
uv publish

Note: You'll need to set PyPI credentials via environment variables or command flags:

  • Token: --token or UV_PUBLISH_TOKEN
  • Or username/password: --username/UV_PUBLISH_USERNAME and --password/UV_PUBLISH_PASSWORD

Debugging

Development/Unpublished Servers Configuration ``` "mcpServers": { "mcp-server-motherduck": { "command": "uv", "args": [ "--directory", "/Users//mcp-server/mcp-server-motherduck", "run", "mcp-server-motherduck" ] } } ```

Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.

You can launch the MCP Inspector via npm with this command:

npx @modelcontextprotocol/inspector uv --directory /Users/<username>/mcp-server/mcp-server-motherduck run mcp-server-motherduck

Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_motherduck-0.2.1.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_motherduck-0.2.1-py3-none-any.whl (26.4 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_motherduck-0.2.1.tar.gz.

File metadata

File hashes

Hashes for mcp_server_motherduck-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9f3181b5ac1add4d0665d5642a41deaab70b4f663749764ba5276f55a43763e8
MD5 f2f53822c07e10a2057b6c5f738c9735
BLAKE2b-256 5a2456d745aacdec73107d0a896b0497d5a3f2a87b42cec21c455f2f25392b18

See more details on using hashes here.

File details

Details for the file mcp_server_motherduck-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_motherduck-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c861aba33d6fb22e50c5fc2620a43d023a8d28e9706bb45ab7e5118a0b5932f
MD5 d384483fe27f6274e01ec85114e9bfa9
BLAKE2b-256 403343ac1dc8b15330fabe156f42837d5deff9cb5bec951ddfe34d50434a5bf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page