DB2TOON MCP logo

DB2TOON MCP

Extracts read-only schemas from supported databases or SQL dumps and returns compact, human-readable TOON for MCP clients.

Install DB2TOON MCP

Run the project’s own setup commands, in order.

Setup steps from the project

DB2TOON MCP installs with its own steps rather than a config we can generate, so these are copied as-is. Follow them in order and run the commands in a terminal. Source: github.com

  1. 1. Install
    git clone https://github.com/kamil5b/db2toon.git
    
  2. 2. Install
    cd db2toon
    
  3. 3. Install
    CGO_ENABLED=0 go build -o output/db2toon-mcp ./cmd/db2toon-mcp
    
  4. 4. Start the server
    ./output/db2toon-mcp
    

Overview

DB2TOON MCP exposes read-only database schema extraction through the `db2toon.extract_schema` MCP tool. It connects to PostgreSQL, SQLite, DuckDB, MySQL/MariaDB, CockroachDB, SQL Server, or Oracle, or parses a plain-text SQL dump without executing it. Results use the compact, human-readable TOON format and can include tables, relationships, indexes, comments, routines, triggers, and bounded example rows. Reach for it when an agent needs database structure for documentation, design analysis, or visualization without write access.

Use cases

  • Inspect a live database schema from an MCP-compatible coding client
  • Parse a SQL dump into a compact TOON design document
  • Generate agent-readable relationship and index metadata
  • Review bounded table examples without granting write access

Key features

  • Read-only MCP schema extraction
  • Live database and offline SQL dump input
  • TOON output with relationships and metadata
  • Multi-dialect database support
  • Optional example-row sampling
  • Schema, table, view, and field filtering

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

14/14 checks healthy over the last 78d

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars5Stargazers on the source repository.
Last commit1mo agoMost recent push to the default branch.
Directory activity2 viewsConfig copies, upvotes, and views on AllMCPs.

How DB2TOON MCP works

What DB2TOON MCP does

DB2TOON MCP turns database structure into TOON, a compact schema definition format intended to remain readable to both developers and language models. Its MCP interface is focused on inspection: the exposed db2toon.extract_schema tool reads metadata and returns the encoded result without providing database mutation operations.

The extractor can process live connections for PostgreSQL, SQLite, DuckDB, MySQL, MariaDB, CockroachDB, Microsoft SQL Server, and Oracle. It can also parse plain-text SQL dumps for those dialects. Extracted information may include tables, columns, data types, primary and foreign keys, indexes, comments, views, routines, triggers, sequences, enums, extensions, and other supported vendor-specific objects.

How it works

Call db2toon.extract_schema with a required dialect and exactly one source: db for a connection URL or local database path, or dump for a SQL dump path. Optional extraction controls are supplied through an options object. The output is TOON text containing database metadata and schema definitions, with foreign keys represented as inline references or multi-column relationships.

Dump input is parsed offline and is never executed. The parser can retain bounded INSERT examples and, for supported dialects, preserve routine or trigger declarations as statement text. Live extraction derives the database name from the connection, while dump extraction uses the dump filename.

The operation uses a default 30-second timeout and caps responses at 4 MiB. Lower limits can be supplied through the extraction options. Connection strings are excluded from tool errors and results.

Setup and configuration

Build the MCP-compatible stdio binary from the repository with Go:

bash
CGO_ENABLED=0 go build -o output/db2toon-mcp ./cmd/db2toon
./output/db2toon-mcp

Pre-built binaries are available for supported Linux, macOS, and Windows platforms on the project's releases page. The project builds without CGO for those platforms; DuckDB database access requires libduckdb at runtime.

A request must select one dialect: postgres, sqlite, duckdb, mysql, mariadb, cockroachdb, mssql, sqlserver, or oracle. It must also provide either db or dump, but not both. Schema selection and extraction behavior are controlled in the options object, including timeout, output size, examples, schema filters, view inclusion, partitioned-table inclusion, and table or field exclusions.

Tools and capabilities

  • Extract live schemas from eight database families and compatible dialect names.
  • Parse SQL dumps without connecting to or executing against a database.
  • Normalize supported type names and map foreign-key relationships.
  • Preserve indexes, comments, views, routines, triggers, sequences, and supported vendor objects.
  • Add bounded example rows, with deterministic ordering and seeded selection available for PostgreSQL.
  • Select one or multiple schemas and exclude tables or sensitive example fields.
  • Return compact TOON suitable for MCP-based documentation and schema analysis.

Limitations and notes

The MCP interface is read-only. Example sampling defaults to zero rows; when enabled, SQLite and DuckDB use a simple LIMIT query, while PostgreSQL supports ordered, reproducible selection with a seed. SQLite does not expose catalog comments, so those comments cannot be preserved.

Dump parsing supports common schema declarations, constraints, indexes, comments, and bounded inserts, but unsupported vendor declarations are ignored rather than executed. Complex PL/SQL and T-SQL bodies are preserved only as available statement text. The response-size limit of 4 MiB may require lower-scope extraction or exclusions for large schemas.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about DB2TOON MCP

DB2TOON MCP is an MCP server that connects to PostgreSQL, SQLite, DuckDB, MySQL/MariaDB, CockroachDB, SQL Server, and Oracle, or parses SQL dumps offline. Its main tool, `db2toon.extract_schema`, returns read-only database structure as compact TOON, including tables, relationships, indexes, supported objects, and optional examples.

Build the stdio binary with `CGO_ENABLED=0 go build -o output/db2toon-mcp ./cmd/db2toon`, then run `./output/db2toon-mcp`. Pre-built binaries are also available from the project's releases page for supported Linux, macOS, and Windows platforms.

DB2TOON MCP supports PostgreSQL, SQLite, DuckDB, MySQL, MariaDB, CockroachDB, Microsoft SQL Server, and Oracle. The tool accepts the dialect names `postgres`, `sqlite`, `duckdb`, `mysql`, `mariadb`, `cockroachdb`, `mssql`, `sqlserver`, and `oracle`.

Yes. Provide a plain-text SQL dump through the `dump` argument instead of `db`; the contents are parsed offline and never executed. The tool can extract common schema objects and bounded `INSERT` examples, while unsupported declarations are ignored.

No. The MCP interface is read-only and exposes schema extraction rather than database mutation. Live connections are used to inspect metadata and optional examples, while dump mode performs offline parsing.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewDB2TOON MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/db2toon-mcp?style=directory)](https://allmcps.com/mcp/db2toon-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/db2toon-mcp"><img src="https://allmcps.com/api/badge/db2toon-mcp?style=directory" alt="DB2TOON MCP on AllMCPs" /></a>