本项目是一个用于从 CSV 和 Excel 文件更新数据库的模型上下文协议(Model Context Protocol)服务器,能够帮助用户便捷地将文件数据更新到数据库中,支持多种文件格式和数据库类型。
update_database
:可使用 CSV/Excel 文件更新数据库。
create_note
:用于创建和管理笔记(用于文档记录)。
使用 update_database
工具时,需传入如下参数:
{
"filePath": "/path/to/your/file.csv",
"databaseType": "PostgreSQL",
"connectionString": "postgresql://user:pass@localhost:5432/db",
"tableName": "target_table"
}
要在 Claude Desktop 上使用,请添加服务器配置:
~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"database-updater": {
"command": "/path/to/database-updater/build/index.js"
}
}
}
以下是使用 update_database
工具更新数据库的示例:
{
"filePath": "/path/to/your/file.csv",
"databaseType": "PostgreSQL",
"connectionString": "postgresql://user:pass@localhost:5432/db",
"tableName": "target_table"
}
npm install
npm run build
npm run watch
由于 MCP 服务器通过 stdio 通信,调试可能具有挑战性。我们推荐使用 MCP Inspector:
npm run inspector
Inspector 将提供一个访问浏览器调试工具的 URL,方便进行调试工作。