Database

io.github.rog0x由 GitHub 帳號 rog0x 發布v1.0.1更新於 Oct 24, 2026

SQL formatting, schema visualization, migration generation

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,為助理提供 SQL 文字工具:格式化、白話解釋、結構分析、查詢建構與遷移產生。

可以做什麼
  • 格式化並美化 MySQL、PostgreSQL 與 SQLite 的 SQL 查詢
  • 以白話逐步解釋查詢,列出資料表、欄位、條件並提供最佳化建議
  • 解析 CREATE TABLE 語句,擷取資料表、欄位、限制、外鍵與索引,並產生 Mermaid 格式的 ER 圖
  • 依自然語言描述建構 SQL,支援日期篩選、彙總、聯結、排序與分頁
  • 比對新舊兩版結構,產生正向與回滾的 ALTER TABLE 遷移語句
適用情境
適合以文字方式處理 SQL 的情境:整理查詢、理解陌生 SQL、梳理資料表結構、依描述草擬查詢,或在兩個結構版本之間產生遷移語句,且不需連線真實資料庫。
執行需求
以本機 Node.js 程序執行,從 npm 套件安裝;README 說明需安裝相依套件、建置,並在桌面用戶端設定中指向建置後的進入點檔案。未宣告需要資料庫連線、帳號、API 金鑰或環境變數。
安裝前請注意
僅分析 SQL 文字,不連線資料庫,產生的查詢與遷移只是建議,套用到真實資料前應人工複核。僅限桌面用戶端,不支援網頁端執行。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Database,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

mcp-database-tools

MCP server providing SQL and database tools for AI agents. All analysis is performed on SQL text — no actual database connection required.

Tools

sql_format

Format and prettify SQL queries with proper indentation, uppercased keywords, and aligned columns. Supports MySQL, PostgreSQL, and SQLite syntax.

sql_explain

Take a SQL query and explain what it does in plain English, step by step. Identifies query type, tables, columns, conditions, and provides optimization tips.

schema_analyze

Parse CREATE TABLE statements to extract tables, columns, types, constraints, foreign keys, and indexes. Generates an ER diagram in Mermaid format.

query_build

Build SQL queries from natural language descriptions. Supports common patterns like filtering by date, aggregation, joins, ordering, and pagination.

migration_generate

Compare two schemas (old vs new CREATE TABLE statements) and generate ALTER TABLE migration statements. Produces both up (forward) and down (rollback) migrations.

Installation

bash
npm installnpm run build

Usage

With Claude Desktop

Add to your Claude Desktop config (claude_desktop_config.json):

json
{  "mcpServers": {    "database-tools": {      "command": "node",      "args": ["path/to/mcp-database-tools/dist/index.js"]    }  }}

Standalone

bash
npm start

Development

bash
npm run build    # Compile TypeScriptnpm start        # Run the server

License

MIT

來源:README.md,提交 1d00864

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分