MM

motherduckdb/mcp-server-motherduck

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

536 stars 90 forks 品質 91 トレンド 41MIT

DuckDBとMotherDuckのローカルMCPサーバー

概要

AIアシスタントやIDE向けのSQL分析とデータエンジニアリング。 DuckDBの強力な分析SQLエンジンを使ってAIアシスタントをデータに接続します。ローカルDuckDBファイル、インメモリデータベース、S3ホストデータベース、MotherDuckへの接続をサポートします。SQLの読み書きクエリ実行、データベースカタログの閲覧、異なるデータベース接続の切り替えがリアルタイムで可能です。 📝 - : サーバーはデフォルトで読み取り専用モードで動作します。書き込みアクセスを有効にするために --read-write を追加してください。本番環境の保護を参照してください。- : --db-path デフォルトが md: から :memory: に変更されました。MotherDuck 用に明示的に --db-path md: を追加します。- : 読み取り専用モードの MotherDuck 接続には読み取りスケーリングトークンが必要です。通常のトークンは --read-write が必要です。 : pipでuvをインストールするか、brewでuvをインストールしてください ガードレールなしで完全な柔軟性を持ち、読み書きアクセスや実行時に任意のデータベース(ローカルファイル、S3、MotherDuck)に切り替えられる機能。 特定のDuckDBファイルに読み取り専用モードで接続します。

概要(AI 翻訳)

DuckDB / MotherDuckローカルMCPサーバー

AIアシスタントやIDE向けのSQL分析とデータエンジニアリング。


DuckDBの強力な分析SQLエンジンを使ってAIアシスタントをデータに接続します。ローカルDuckDBファイル、インメモリデータベース、S3ホストデータベース、MotherDuckへの接続をサポートします。SQLの読み書きクエリ実行、データベースカタログの閲覧、異なるデータベース接続の切り替えがリアルタイムで可能です。

MotherDuck用の完全管理型リモートMCPサーバーをお探しですか? → MotherDuckリモートMCPのドキュメントへ行く

リモートとローカルMCP

リモートMCP ローカルMCP(このリポジトリ)
ホスティングホストはMotherDuck ローカル/セルフホスト
セットアップゼロセットアップ ローカルインストールが必要
アクセス読み書き対応 読み書き対応
ローカルファイルシステム - ローカルおよびリモートデータベース間でのクエリ、ローカルファイルシステムへのデータの取り込み/エクスポート

クイックスタート

前提条件:uvをpip install uvまたは[[T2]経由でインストールしてください]

メモリ内のDuckDBへの接続(開発者モード)

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

DuckDB / MotherDuck Local MCP Server

SQL analytics and data engineering for AI Assistants and IDEs.


Connect AI assistants to your data using DuckDB’s powerful analytical SQL engine. Supports connecting to local DuckDB files, in-memory databases, S3-hosted databases, and MotherDuck. Allows executing SQL read- and write-queries, browsing database catalogs, and switching between different database connections on-the-fly.

Looking for a fully-managed remote MCP server for MotherDuck? → Go to the MotherDuck Remote MCP docs

Remote vs Local MCP

Remote MCP Local MCP (this repo)
Hosting Hosted by MotherDuck Runs locally/self-hosted
Setup Zero-setup Requires local installation
Access Read-write supported Read-write supported
Local filesystem - Query across local and remote databases, ingest data from / export data to local filesystem

Quick Start

Prerequisites: Install uv via pip install uv or brew install uv

Connecting to In-Memory DuckDB (Dev Mode)

{
  "mcpServers": {
    "DuckDB (in-memory, r/w)": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "--db-path", ":memory:", "--read-write", "--allow-switch-databases"]
    }
  }
}

Full flexibility with no guardrails — read-write access and the ability to switch to any database (local files, S3, or MotherDuck) at runtime.

Connecting to a Local DuckDB File in Read-Only Mode

{
  "mcpServers": {
    "DuckDB (read-only)": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "--db-path", "/absolute/path/to/your.duckdb"]
    }
  }
}

Connects to a specific DuckDB file in read-only mode. Won’t hold on to the file lock, so convenient to use alongside a write connection to the same DuckDB file. You can also connect to remote DuckDB files on S3 using s3://bucket/path.duckdb — see Environment Variables for S3 authentication. If you’re considering third-party access to the MCP, see Securing for Production.

Connecting to MotherDuck in Read-Write Mode

{
  "mcpServers": {
    "MotherDuck (local, r/w)": {
      "command": "uvx",
      "args": ["mcp-server-motherduck", "--db-path", "md:", "--read-write"],
      "env": {
        "motherduck_token": ""
      }
    }
  }
}

See Command Line Parameters for more options, Securing for Production for deployment guidance, and Troubleshooting if you encounter issues.

Client Setup

| Client | Config Location | One-Click Install |

GitHub で README 全文を見る

インストール

uvx mcp-server-motherduck --db-path :memory: --read-write --allow-switch-databases
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "DuckDB (in-memory, r/w)": { "command": "uvx", "args": ["mcp-server-motherduck", "--db-path", ":memory:", "--read-write", "--allow-switch-databases"] } } }