
Database
io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.1更新于 Oct 24, 2026
SQL formatting, schema visualization, migration generation
概览
本地 MCP 服务器,为助手提供 SQL 文本工具:格式化、通俗解释、结构分析、查询构建与迁移生成。
- 可以做什么
- 格式化并美化 MySQL、PostgreSQL 和 SQLite 的 SQL 查询
- 用通俗语言逐步解释查询,列出表、列、条件并给出优化建议
- 解析 CREATE TABLE 语句,提取表、列、约束、外键和索引,并生成 Mermaid 格式的 ER 图
- 根据自然语言描述构建 SQL,支持日期过滤、聚合、连接、排序和分页
- 比较新旧两版结构,生成正向与回滚的 ALTER TABLE 迁移语句
- 适用场景
- 适合以文本方式处理 SQL 的场景:整理查询、理解陌生 SQL、梳理表结构、按描述起草查询,或在两个结构版本之间生成迁移语句,且无需连接真实数据库。
- 运行要求
- 以本地 Node.js 进程运行,从 npm 包安装;README 说明需安装依赖、构建,并在桌面客户端配置中指向构建后的入口文件。未声明需要数据库连接、账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Database,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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
Usage
With Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
Standalone
Development
License
MIT
来源:README.md,提交 1d00864
工具
0版本历史
1- v1.0.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分