mcp-schema-designer
v1.1.4Design database schemas from natural language, validate SQL, generate migrations and types
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
design_schema
Design a database schema from a natural language description. Generates CREATE TABLE SQL (PostgreSQL), index recommendations, and a text-based ERD. Optionally accepts explicit table definitions to validate and enhance.
| Parameter | Type | Description |
|---|---|---|
description * | string | Natural language description of the data model (e.g. 'an e-commerce platform with products, orders, and user reviews') |
tables | array | Optional: provide explicit table definitions to validate and enhance instead of generating from description |
validate_schema
Validate SQL CREATE TABLE statements for best practices. Checks for missing primary keys, unnamed constraints, missing FK indexes, data type issues (e.g. TIMESTAMP vs TIMESTAMPTZ), naming conventions (snake_case, plural tables), and N+1 query risks.
| Parameter | Type | Description |
|---|---|---|
sql * | string | SQL CREATE TABLE statements (PostgreSQL dialect) to validate |
migrate_schema
Generate migration SQL by diffing a "from" schema against a "to" schema. Produces ALTER TABLE statements in safe dependency order, rollback SQL, and warnings for destructive changes (column drops, type changes).
| Parameter | Type | Description |
|---|---|---|
from_sql * | string | Current database schema as SQL CREATE TABLE statements |
to_sql * | string | Target database schema as SQL CREATE TABLE statements |
generate_types
Generate typed code from SQL CREATE TABLE statements. Supports three output formats: TypeScript interfaces, Zod validation schemas, or JSON Schema definitions.
| Parameter | Type | Description |
|---|---|---|
format * | string | Output format: 'typescript' for interfaces, 'zod' for Zod schemas, 'json-schema' for JSON Schema |
sql * | string | SQL CREATE TABLE statements (PostgreSQL dialect) to generate types from |
optimize_queries
Analyze a SQL query against a schema and suggest performance improvements. Identifies missing indexes, recommends query rewrites, and provides EXPLAIN plan interpretation hints.
| Parameter | Type | Description |
|---|---|---|
query * | string | The SQL query to optimize |
schema * | string | Schema context as SQL CREATE TABLE statements, so the tool can identify missing indexes and table structure |