Skip to main content
Glama
bigedev

BigeSQL

Official
by bigedev

BigeSQL — 开源多数据库管理工具 & MCP Server

一站式数据库管理工具 + AI MCP Server,支持 MySQL/MariaDB、PostgreSQL、SQLite、达梦 DM8

既是 VS Code 插件(图形化界面),也是 MCP Server(AI 助手可通过协议直接访问数据库),支持 stdio 和 HTTP 双模式。


✨ 功能特性

特性

说明

🗄️ 多数据库支持

MySQL / MariaDB / PostgreSQL / SQLite / 达梦 DM8

🎨 图形界面

VS Code 侧边栏管理连接,Webview SQL 编辑器

🤖 MCP 协议

支持 stdio + HTTP 双模式

🔌 连接管理

添加/编辑/删除/测试数据库连接

📋 表浏览器

树形展示表、视图、列结构

⌨️ SQL 编辑器

语法高亮、执行查询、结果表格展示

🚦 服务管理

扩展内一键启动/停止 MCP Server,状态栏指示

🔒 安全

密码不硬编码,支持 .gitignore 排除

Related MCP server: SQLite MCP Server

支持的数据库

数据库

驱动

方式

MySQL / MariaDB

mysql2

TCP 直连

PostgreSQL

pg

TCP 直连

SQLite

better-sqlite3

本地文件

达梦 DM8

dmdb(官方驱动)

TCP 直连,无需 ODBC


🚀 快速开始

安装

cd bige-sql
npm install
npm run compile

配置数据库连接

编辑 connections.json 添加您的数据库连接:

{
  "connections": {
    "my-mysql": {
      "type": "mysql",
      "host": "192.168.1.100",
      "port": 3306,
      "user": "root",
      "password": "your_password",
      "database": "mydb"
    },
    "my-postgres": {
      "type": "postgresql",
      "host": "127.0.0.1",
      "port": 5432,
      "user": "postgres",
      "password": "",
      "database": "mydb"
    },
    "my-sqlite": {
      "type": "sqlite",
      "path": "/data/mydb.db"
    },
    "my-dameng": {
      "type": "dameng",
      "host": "192.168.1.23",
      "port": 5236,
      "user": "SYSDBA",
      "password": "SYSDBA"
    }
  }
}

⚠️ 注意: connections.json 已加入 .gitignore,避免误提交凭据到 Git。


🎯 使用方式一:VS Code 插件(图形界面)

安装插件

在 VS Code 中按 F5 启动调试,或从 .vsix 安装。

使用界面

  1. 侧边栏 — 点击活动栏的 🗄️ BigeSQL 图标

  2. 添加连接 — 点击侧边栏顶部的 + 按钮,填写表单

  3. 浏览表 — 展开连接节点,查看表和列结构

  4. 执行查询 — 右键连接或表,选择 打开 SQL 查询编辑器

  5. MCP Server — 点击底部状态栏 BigeSQL MCP 启动,运行中可点击停止

  6. 快捷键 — 在 SQL 编辑器中按 Cmd+Enter / Ctrl+Enter 执行

命令列表

命令

说明

BigeSQL: 添加数据库连接

打开添加连接表单

BigeSQL: 打开 SQL 查询编辑器

打开 SQL 编辑器

BigeSQL: 刷新连接列表

从文件重新加载连接

BigeSQL: 测试连接

测试连接是否正常

BigeSQL: 编辑连接

修改连接配置

BigeSQL: 删除连接

删除数据库连接

BigeSQL: Start MCP Server

启动 MCP 服务

BigeSQL: Stop MCP Server

停止 MCP 服务


🤖 使用方式二:MCP Server(AI 助手)

让 AI 助手(GitHub Copilot、Claude 等)通过 MCP 协议直接访问您的数据库。

方式 A:VS Code 扩展管理(推荐)

安装扩展后,通过以下任一方式启动:

  • 状态栏 — 点击底部 BigeSQL MCP 图标

  • 命令面板 — 执行 BigeSQL: Start MCP Server

启动后自动运行 HTTP 模式,状态栏显示 BigeSQL MCP • 运行中,点击可停止。

方式 B:配置 VS Code MCP(stdio)

在项目 .vscode/mcp.json 中添加:

{
  "servers": {
    "bige-sql": {
      "type": "command",
      "command": "node",
      "args": ["/path/to/bige-sql/out/src/server.js"],
      "description": "BigeSQL 多数据库 MCP Server"
    }
  }
}

重启 VS Code 后,Copilot 即可自动识别并使用数据库工具。

方式 C:独立 HTTP 服务

# stdio + HTTP 双模式(默认端口 5237)
node out/src/server.js --http

# 仅 HTTP 模式
node out/src/server.js --http-only

# 自定义端口
node out/src/server.js --http --port 8080

HTTP 端点:http://127.0.0.1:5237/mcp

支持标准 MCP Streamable HTTP 传输,可与任意兼容的 MCP 客户端(其他 IDE、自定义 Agent 等)配合使用。

MCP 工具列表

工具

参数

说明

list-connections

列出所有已配置的连接

test-connection

connection (可选)

测试数据库连接

list-tables

connection (可选)

列出所有表和视图

describe-table

connection (可选), tableName (必填)

查看表结构

query

connection (可选), sql (必填)

执行 SELECT 查询

execute

connection (可选), sql (必填)

执行 INSERT/UPDATE/DELETE

list-databases

connection (可选)

列出所有数据库

所有工具的 connection 参数默认使用第一个配置的连接。


🏗️ 项目架构

bige-sql/
├── package.json                    # 依赖 & VS Code 扩展清单
├── tsconfig.json                   # TypeScript 编译配置(strict 模式)
├── connections.example.json        # 连接配置示例
├── LICENSE                         # MIT 许可证
├── src/
│   ├── extension.ts                # VS Code 插件入口
│   ├── server.ts                   # MCP Server(stdio + HTTP 双模式)
│   ├── dbTypes.ts                  # 数据库类型常量与工具函数
│   ├── connectionManager.ts        # 连接配置读写管理
│   ├── databaseService.ts          # 数据库查询引擎
│   ├── connectionTreeProvider.ts   # 侧边栏树视图
│   └── queryEditorProvider.ts      # SQL 编辑器 Webview
├── media/
│   ├── database.svg                # 活动栏图标
│   ├── addConnection.js            # 添加连接 Webview
│   └── icon.png                    # 扩展图标
└── out/                            # 编译输出(自动生成,已 gitignore)

🛠️ 开发

# 安装依赖
npm install

# 编译 TypeScript
npm run compile

# 监听模式
npm run watch

# 在 VS Code 中按 F5 启动调试

# 打包扩展
npx @vscode/vsce package

调试插件

  1. 在 VS Code 中打开本项目

  2. F5 或运行 Run Extension 调试配置

  3. 新窗口会加载扩展

  4. 点击活动栏的 BigeSQL 图标开始使用

调试 MCP Server

# 单独运行 MCP Server(stdio)
node out/src/server.js

# HTTP 模式
node out/src/server.js --http

使用 VS Code 的 Run MCP Server 调试配置可直接附加调试器。


📄 License

MIT

示例

在 VS Code Copilot Chat 中直接提问:

@bige-sql 查询 idcloud-mysql 中的 ac_user 表前10条记录
@bige-sql 列出 my-postgres 中所有表

路线图

  • MongoDB 支持

  • 连接池健康检查与自动重连

  • Web UI 连接管理器

  • 查询历史与书签

  • 数据导出 (CSV/JSON/Excel)

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bigedev/bige-sql'

If you have feedback or need assistance with the MCP directory API, please join our Discord server