数据库更新器MCP服务器

数据库更新器MCP服务器

一个用于从CSV和Excel文件更新数据库的Model Context Protocol服务器。

快速入门

功能

  • 更新数据库:支持从CSV/Excel文件导入数据到PostgreSQL、MySQL、MongoDB或SQLite。
  • 创建笔记:记录数据库更新的重要信息。

使用方法

更新数据库

使用update_database工具,提供以下参数:

  • filePath: 文件路径(如/path/to/your/file.csv)
  • databaseType: 数据库类型(PostgreSQL、MySQL、MongoDB、SQLite)
  • connectionString: 数据库连接字符串
  • tableName: 目标表名

示例: { "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

配置Claude Desktop

在配置文件中添加服务器设置:

  • MacOS路径:~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows路径:%APPDATA%/Claude/claude_desktop_config.json

配置内容: { "mcpServers": { "database-updater": { "command": "/path/to/database-updater/build/index.js" } } }

调试

推荐使用MCP Inspector调试工具: npm run inspector 然后通过浏览器访问提供的URL进行调试。