article
README
🚀 母亲鸭MCP服务器中文文档
本项目提供了母亲鸭MCP服务器的安装、配置、使用等相关说明,帮助用户快速搭建并使用该服务器。
🚀 快速开始
安装与配置
使用Claude Desktop
- 若尚未安装Claude Desktop,可从claude.ai/download下载并安装。
- 打开Claude Desktop的配置文件:
- 首次使用时,可在Claude Desktop应用程序中操作:选择“设置”,进入“开发者”选项卡,点击“编辑配置”按钮。
- 在
claude_desktop_config.json文件中添加如下配置:
{
"mcpServers": {
"mcp-server-motherduck": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:",
"--motherduck-token",
"<YOUR_MOTHERDUCK_TOKEN_HERE>"
]
}
}
}
⚠️ 重要提示
- 请将
<YOUR_MOTHERDUCK_TOKEN_HERE>替换为您的实际MotherDuck令牌。- 可根据需要设置
--home-dir参数(例如:--home-dir /Users/your_username)。
使用VS Code
您可以在.vscode/mcp.json文件中添加以下配置,也可将此内容直接复制到工作区的mcp.json文件中:
{
"inputs": [
{
"type": "promptString",
"id": "motherduck_token",
"description": "MotherDuck令牌",
"password": true
}
],
"servers": {
"motherduck": {
"command": "uvx",
"args": [
"mcp-server-motherduck",
"--db-path",
"md:",
"--motherduck-token",
"${input:motherduck_token}"
]
}
}
}
💻 使用示例
示例查询
配置完成后,您可以让Claude执行以下操作:
- “创建新的数据库和表在MotherDuck中”
- “从本地CSV文件查询数据”
- “将本地DuckDB数据库中的数据与MotherDuck中的表格连接”
- “分析存储在Amazon S3中的数据”
测试方法
默认MotherDuck数据库
要连接到默认的MotherDuck数据库,需要使用--motherduck-token参数指定令牌:
uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>
指定MotherDuck数据库
uvx mcp-server-motherduck --db-path md:your_database_name --motherduck-token <your_motherduck_token>
本地DuckDB数据库
uvx mcp-server-motherduck --db-path /path/to/your/local.db
内存数据库
uvx mcp-server-motherduck --db-path :memory:
💡 使用建议
如果未指定数据库路径但设置了
motherduck_token环境变量,服务器将自动连接到默认的MotherDuck数据库(md:)。
🔧 技术细节
运行在SSE模式
要以SSE模式运行服务器,请使用supergateway工具:
npx -y supergateway --stdio "uvx mcp-server-motherduck --db-path md: --motherduck-token <your_motherduck_token>"
故障排除
注意事项:
- 确保已正确安装所有依赖项。
- 检查命令语法是否正确。
- 如遇到
spawn uvx ENOENT错误,请确认uvx工具已正确安装并位于系统路径中。
📄 许可证
本项目遵循MIT许可证。更多信息请参考MIT License。
扫码联系在线客服