DB2TOON MCP
概览
作者提供的说明(英文原文)
Read-only SQL database and plain-text SQL dump schema extraction to compact TOON for MCP clients.
PopNx MCP 的三大支柱
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
- 用户评价i暂无评价评价功能将在后续阶段与账户功能一起开放
- 我们的基础检查i1 项中通过 1 项依据公开信息检查;尚未扫描代码
- 使用情况i非常新★ –
它能帮你做什么
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
- 连接方式: 在你的电脑上运行
- 传输方式: stdio
- 分类: 数据库与数据集
安装
选择你使用的 AI 应用,然后复制设置。
安装之前
- 基础检查:1 项中通过 1 项
- 在你的电脑上运行,拥有你的用户账户的权限(文件、网络、应用)。
- 注册中心没有列出需要填写的密钥。
你需要
- Docker已安装 Docker
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"db2toon": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/kamil5b/db2toon:v1.4.4"
]
}
}
}在终端中运行这条命令
claude mcp add db2toon -- docker run -i --rm ghcr.io/kamil5b/db2toon:v1.4.4或者自己复制设置
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"db2toon": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/kamil5b/db2toon:v1.4.4"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
或者自己复制设置
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"db2toon": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/kamil5b/db2toon:v1.4.4"
]
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它能做什么
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
基础检查i
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月8日
- ✓ 通过
作者与仓库一致
注册名称已通过 GitHub 账户 kamil5b 验证,该账户拥有此仓库
- … 尚未检查
仍在维护
我们还没有从 GitHub 读取这个仓库
- … 尚未检查
有许可证
我们还没有从 GitHub 读取这个仓库
- – 不适用
端点有响应
它在你的电脑上运行,没有互联网端点
- – 不适用
使用 OAuth 登录
在你的电脑上运行,改用本地设置
- … 尚未检查
工具描述中没有隐藏指令
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与“数据库与数据集”中的其他服务器比较i
- 星标数多于此分类中其他 1144 个服务器的 0%
- 发布到注册中心的时间比此分类中其他 1144 个服务器的 22% 更新
- 基础检查结果等于或优于此分类中其他 1144 个服务器的 100%
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
常见问题
DB2TOON MCP 安全吗?
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
它需要哪些密钥或代码?
注册中心没有列出必需的密钥,不过有些服务器会在首次使用时要求你登录。
它在我的电脑上运行还是在云端?
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
它还在维护吗?
GitHub 仓库最后更新于–,最新版本(1.4.4)于3个月前进入注册中心。
哪些应用可以使用它?
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Docker。
有什么可以替代它?
同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server
替代选择
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:↓ 每周下载量i★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
作者的 README
打开 README
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
db2toon
A CLI tool that converts database schemas into the Toon schema definition format.
Overview
db2toon connects to a database and extracts schema information (tables, columns, types, constraints, indexes, routines, triggers, and examples), then converts it into the human-readable Toon format for database design documentation and visualization. PostgreSQL, SQLite, DuckDB, MySQL/MariaDB, CockroachDB, Microsoft SQL Server, and Oracle are supported. pg2toon remains a PostgreSQL compatibility command.
Features
- Schema Extraction: Automatically extracts tables, columns, and metadata from PostgreSQL, SQLite, DuckDB, MySQL/MariaDB, CockroachDB, Microsoft SQL Server, and Oracle
- Type Normalization: Simplifies PostgreSQL types (e.g.,
character varying→varchar) - Relationship Mapping: Converts foreign key constraints to inline references or multi-column references
- Comment Preservation: Includes comments where the database exposes them; SQLite does not have catalog comments
- Index Documentation: Extracts and documents database indexes
- Database Objects: Preserves supported enums, types, sequences, synonyms, triggers, routines, extensions, materialized views, packages, and other vendor-specific objects in explicit TOON sections
- Cross-Platform: Builds without CGO for Linux, macOS, and Windows (amd64 and arm64)
- DBML Adapter: Converts DBML files (or standard input) into the same TOON format
- Local MCP: Read-only SQL database and plain-text SQL dump schema extraction to compact TOON for MCP clients.
Installation
From Source
git clone https://github.com/kamil5b/db2toon.git
cd db2toon CGO_ENABLED=0 go build -o output/db2toon ./cmd/db2toon CGO_ENABLED=0 go build -o output/pg2toon ./cmd/pg2toon CGO_ENABLED=0 go build -o output/dbml2toon ./cmd/dbml2toon
From Releases
Download pre-built binaries from the releases page for your platform.
Go package
The module also exposes a public Go API for callers that want the canonical schema model instead of invoking a command:
import (
"context" "os"
"github.com/kamil5b/db2toon" )
func extract() error { db, err := db2toon.Extract(context.Background(), db2toon.Request{ Dialect: "postgres", Dump: "./schema.sql", Options: db2toon.Options{ExampleSample: 2}, }) if err != nil { return err } return db2toon.Encode(os.Stdout, db) }
Set exactly one of Request.DB or Request.Dump. Dump contents are parsed offline and never executed. The public API returns *schema.Database, so callers may inspect or transform the model before encoding it.
Usage
LLM tool integration
Build and run the MCP-compatible stdio server:
CGO_ENABLED=0 go build -o output/db2toon-mcp ./cmd/db2toon-mcp
./output/db2toon-mcp
The server exposes db2toon.extract_schema. Its required argument is dialect (postgres, sqlite, duckdb, mysql, mariadb, cockroachdb, mssql, sqlserver, or oracle). Provide exactly one of db or dump; optional extraction settings are supplied in an options object. Dump files are parsed offline and never executed. The tool is read-only, uses a 30-second default timeout, and limits responses to 4 MiB. Set options.timeout and options.max_output_bytes to lower limits when needed. Connection strings are never included in tool errors or results.
Basic Usage
./db2toon postgres -db "postgresql://user:password@localhost/dbname"
SQLite database file
./db2toon sqlite -db ./schema.db
Plain-text SQL dump
./db2toon postgres -dump ./schema.sql ./db2toon sqlite -dump ./schema.sql ./db2toon mysql -dump ./schema.sql ./db2toon mssql -dump ./schema.sql ./db2toon oracle -dump ./schema.sql
DuckDB database file (requires libduckdb at runtime)
./db2toon duckdb -db ./analytics.duckdb
Microsoft SQL Server (defaults to dbo)
./db2toon mssql -db 'sqlserver://sa:password@localhost:1433?database=app&encrypt=disable'
Oracle Database; the current schema is used unless -schema/-schemas is set.
go-ora accepts an EZConnect-style URL.
./db2toon oracle -db 'oracle://app:password@localhost:1521/FREEPDB1'
Compatibility command; PostgreSQL is selected automatically.
./pg2toon -db "postgresql://user:password@localhost/dbname"
Convert DBML, either from a file or standard input.
./dbml2toon schema.dbml cat schema.dbml | ./dbml2toon -out schema.toon
Save to File
./db2toon postgres -db "postgresql://user:password@localhost/dbname" -out schema.toon
Include up to two sample rows per PostgreSQL table in the TOON output, using a stable ordering and a reproducible sample seed:
./db2toon postgres -db "postgresql://user:password@localhost/dbname" \
-example-sample=2 -example-sample-ordered=true -seed=42
The default -example-sample=0 omits @example sections.
SQLite and DuckDB also support -example-sample, but currently use a simple LIMIT query. -example-sample-ordered and -seed are currently effective only for PostgreSQL.
Select multiple schemas, include partitioned tables, and change the default 30-second operation timeout with:
./db2toon postgres -db "$DATABASE_URL" -schema audit
./db2toon postgres -db "$DATABASE_URL" -schemas public,audit -include-partitioned -timeout 1m
SQLite and DuckDB default to the main schema. SQL Server defaults to dbo.
Oracle defaults to the session's CURRENT_SCHEMA.
./db2toon sqlite -db ./schema.db -schema main ./db2toon duckdb -db ./analytics.duckdb -schema analytics ./db2toon oracle -db 'oracle://app:password@localhost:1521/FREEPDB1' -schema APP
Flags
-db string: Database connection URL or local database path; mutually exclusive with-dump-dump string: Plain-text SQL dump path; mutually exclusive with-dbdialect:postgres,sqlite,duckdb,mysql,mariadb,cockroachdb,mssql,sqlserver, ororaclefordb2toon;pg2toonalways uses PostgreSQL-out string: Output file path (optional, defaults to stdout)-schema string: A single schema to extract (defaults topublicfor PostgreSQL,mainfor SQLite/DuckDB,dbofor SQL Server, and the sessionCURRENT_SCHEMAfor Oracle)-schemas string: Comma-separated schemas to extract; cannot be combined with-schema-include-partitioned: Include PostgreSQL partitioned tables-include-views: Include supported views-exclude-tables string: Comma-separated tables to exclude entirely; acceptstableorschema.table-exclude-example-tables string: Comma-separated tables to exclude from@examplesampling-exclude-example-fields string: Comma-separated qualified fields to exclude from examples, such aspublic.users.password_hash-example-sample int: Number of sample rows to include per table (defaults to0)-example-sample-ordered: Select sample rows using deterministic ordering for PostgreSQL (defaults tofalse)-seed int: Seed for reproducible PostgreSQL sample selection (defaults to0; currently ignored by SQLite/DuckDB)-timeout duration: Connection and extraction timeout (defaults to30s)
Dump mode supports plain-text SQL exports for PostgreSQL, SQLite, DuckDB, MySQL/MariaDB, CockroachDB, SQL Server, and Oracle. Common tables, columns, constraints, indexes, comments, and bounded INSERT examples are parsed without executing the dump. PostgreSQL retains native enums, sequences, views, functions, procedures, and triggers, including dollar-quoted routine bodies. MySQL/MariaDB supports DELIMITER-based routine and trigger declarations. SQL Server and Oracle retain supported views, functions, procedures, triggers, sequences, types, synonyms, and selected vendor objects. Complex vendor-specific PL/SQL/ T-SQL bodies are preserved as available statement text; unsupported declarations are ignored rather than executed.
Output Format
The Toon format provides a clean, human-readable schema definition:
@database app {dialect=postgres}
[users]
User accounts table
id int {pk} email varchar {req} name varchar created_at timestamptz {req}
@indices idx_email: ON users USING btree (email)
@example[2]{id,email,name,created_at}: 1,alice@example.com,Alice,2026-01-10T09:00:00Z 2,bob@example.com,Bob,2026-01-11T10:30:00Z
[posts]
Blog posts
id int {pk} user_id int {req} -> users(id) title varchar {req} content text published_at timestamptz
[comments]
Post comments
id int {pk} post_id int {req} -> posts(id) user_id int {req} -> users(id) content text {req} created_at timestamptz {req}
Format Elements
@database name {dialect=dialect}: Source database metadata. Live connections derive the name from the connection string; dump mode uses the dump filename without its extension.[TableName]: Table definition# comment: Table or column commentsname type {tags}: Column definition with optional tags{pk}: Primary key{req}: Required (NOT NULL)- Multiple tags:
{pk,req} -> table(column): Foreign key reference (inline for single columns)@indices: Section for database indexes@enum: Enumerated type values@type: User-defined type metadata@sequence: Sequence configuration@synonym: Alternate object name@routine: Function or procedure metadata and definition where available@triggers: Table trigger metadata@objects: Vendor-specific schema objects, including Oracle materialized views, packages, partitioned tables, scheduler jobs, and database links@example[n]{columns}:: Up tonsampled rows from the table// comment: Inline column comment
Oracle coverage
Oracle extraction uses user-visible ALL_* catalog views, so the output is limited to objects the connected account can inspect. It supports tables, views, columns and comments, primary/unique/foreign-key/check constraints, independent indexes, triggers, standalone functions and procedures, user sequences, object types, synonyms, materialized views, packages/package bodies, partitioned-table markers, scheduler jobs, and database links. Oracle-generated identity sequences and system-generated NOT NULL checks are omitted because their information is already represented by the column model.
Package/type source bodies, materialized-view refresh settings, detailed partition definitions, grants/roles, VPD policies, tablespace/storage details, specialized spatial/domain index options, and Oracle SQL dump parsing are not yet represented in the canonical model.
Microsoft SQL Server coverage
Microsoft SQL Server extraction uses sys.* catalog views and defaults to the dbo schema unless -schema or -schemas is supplied. It supports tables and views, columns and MS_Description comments, defaults, identity/computed columns, primary/unique/foreign-key/check constraints, independent indexes, triggers, functions/procedures, alias/table types, sequences, synonyms, and sample rows. View definitions and vendor-specific schema objects are emitted in the TOON object sections where applicable.
SQL Server dump parsing is not supported. The current model also does not yet represent partition functions/schemes, filegroups, temporal or memory-optimized table settings, graph tables, full-text/spatial/XML index internals, permissions, extended properties other than descriptions, Agent jobs, or server-level objects.
Requirements
- Go 1.26.0 or later
- PostgreSQL 9.4+ (for JSON aggregation functions), SQLite, DuckDB, MySQL/MariaDB, CockroachDB, Microsoft SQL Server 2022+, or Oracle Database
- A valid database connection string or local database path
- DuckDB also requires a compatible
libduckdbshared library at runtime - Oracle uses the pure-Go
go-oradriver and does not
只显示了开头部分;其余内容请在仓库中阅读