Mcp Server Motherduck
io.github.motherduckdb由 GitHub 帳號 motherduckdb 發布v1.1.0更新於 Oct 24, 2026
SQL analytics and data engineering for AI Assistants and IDEs
概覽
本機 MCP 伺服器,將 AI 助理連接到 DuckDB 與 MotherDuck,讓它能執行分析型 SQL、瀏覽目錄並切換資料庫。
- 可以做什麼
- 對 DuckDB 或 MotherDuck 執行 SQL 查詢,啟用後可包含讀寫語句,結果以 JSON 回傳,預設受列數與字元數上限限制。瀏覽資料庫目錄,列出資料庫、資料表與檢視表,以及某個資料表或檢視表的欄位。在啟用切換旗標時,將目前資料庫連線切換到其他本機檔案、S3 路徑或 MotherDuck 資料庫。可跨本機與遠端資料庫查詢,並透過本機檔案系統匯入或匯出資料。
- 適用情境
- 當助理需要用 DuckDB 的 SQL 引擎分析資料、處理本機 DuckDB 檔案、記憶體資料庫或 MotherDuck,或在 IDE 與聊天用戶端中執行資料工程查詢時使用。這是本機版本;另有託管的 MotherDuck 遠端伺服器可免安裝使用。
- 執行需求
- 以 Python 套件形式透過 uvx 在本機執行,需先安裝 uv。以參數指定資料庫路徑:記憶體、絕對路徑的本機檔案、s3:// 位址或 MotherDuck 的 md:。MotherDuck 需要權杖,可透過 motherduck_token 或 MOTHERDUCK_TOKEN 變數或權杖參數提供;S3 存取需要 AWS_ACCESS_KEY_ID、AWS_SECRET_ACCESS_KEY,可選 AWS_SESSION_TOKEN、AWS_DEFAULT_REGION 與 AWS_ENDPOINT。DuckDB 使用 HOME 存放擴充套件與設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Mcp Server Motherduck,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
[MotherDuck / DuckDB Local MCP Server]
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
Quick Start
Prerequisites: Install uv via pip install uv or brew install uv
Connecting to In-Memory DuckDB (Dev Mode)
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
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
See Command Line Parameters for more options, Securing for Production for deployment guidance, and Troubleshooting if you encounter issues.
Client Setup
Any MCP-compatible client can use this server. Add the JSON configuration from Quick Start to your client's MCP config file. Consult your client's documentation for the config file location.
Claude Code CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Codex CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Gemini CLI commands
In-Memory DuckDB (Dev Mode):
Local DuckDB (Read-Only):
MotherDuck (Read-Write):
Kiro manual JSON config
Add the following to your Kiro MCP config file (~/.kiro/settings/mcp.json for global, or .kiro/settings/mcp.json for project-scoped). See the Kiro MCP documentation for more details.
In-Memory DuckDB (Dev Mode):
MotherDuck (Read-Write):
Tools
*Requires --allow-switch-databases flag
All tools return JSON. Results are limited to 1024 rows / 50,000 chars by default (configurable via --max-rows, --max-chars).
Securing for Production
When giving third parties access to a self-hosted MCP server, read-only mode alone is not sufficient — it still allows access to the local filesystem, changing DuckDB settings, and other potentially sensitive operations.
For production deployments with third-party access, we recommend MotherDuck Remote MCP — zero-setup, read-write capable, and hosted by MotherDuck.
Self-hosting MotherDuck MCP: Fork this repo and customize as needed. Use a service account with read-scaling tokens and enable SaaS mode to restrict local file access.
Self-hosting DuckDB MCP: Use --init-sql to apply security settings. See the Securing DuckDB guide for available options.
Docker
Build and run the server with Streamable HTTP on port 8000 (defaults to an in-memory DuckDB):
Connect to MotherDuck by passing a token and overriding the command:
The MCP endpoint is available at http://localhost:8000/mcp. CLI flags and env vars from below still apply.
Command Line Parameters
Environment Variables
Troubleshooting
spawn uvx ENOENT: Specify full path touvx(runwhich uvxto find it)- File locked: Make sure
--ephemeral-connectionsis turned on (default: true) and that you're not connected in read-write mode
Resources
- MotherDuck MCP Documentation
- Close the Loop: Faster Data Pipelines with MCP, DuckDB & AI (Blog)
- Faster Data Pipelines with MCP and DuckDB (YouTube)
Development
To run from source:
Release Process
- Run the
Release New VersionGitHub Action - Enter version in
MAJOR.MINOR.PATCHformat - The workflow bumps version, publishes to PyPI/MCP registry, and creates the GitHub release with MCPB package
License
MIT License - see LICENSE file.
mcp-name: io.github.motherduckdb/mcp-server-motherduck
來源:README.md,提交 41acb58
工具
0版本歷史
2- v1.1.0最新Oct 7, 2026
- v1.0.8Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分