通用数据库MCP服务器

通用数据库MCP服务器

连接MySQL、PostgreSQL、SQL Server等数据库的通用数据库MCP服务器。

快速入门

Docker安装

支持PostgreSQL示例:

docker run --rm --init \
   --name dbhub \
   --publish 8080:8080 \
   bytebase/dbhub \
   --transport sse \
   --port 8080 \
   --dsn "postgres://user:password@localhost:5432/dbname?sslmode=disable"

NPM安装

支持PostgreSQL示例:

npx @bytebase/dbhub --transport sse --port 8080 --dsn "postgres://user:password@localhost:5432/dbname"

配置数据库连接

可以通过命令行参数、环境变量或环境文件配置DSN。

运行模式

  • 只读模式:添加 --readonly 参数限制为只读操作。
  • Demo模式:使用 --demo 参数加载示例数据库。

支持的传输方式

  • stdio(默认):适合本地工具集成。
  • sse:适合浏览器客户端。