🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

mcp-schema-designer

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mcp-schema-designer

MCP server for database schema design and SQL generation. Design schemas, validate them, generate migrations, produce typed outputs, and optimize queries.

latest
Source
npmnpm
Version
1.1.4
Version published
Maintainers
1
Created
Source

Schema Designer

MCP server for database schema design and SQL generation. Design schemas from natural language, validate them for best practices, generate migrations, produce typed outputs (TypeScript/Zod/JSON Schema), and optimize queries -- all targeting PostgreSQL.

Pure logic -- no database connection needed. It generates SQL, it does not run it.

Pricing

PlanPriceFeatures
Free trial$03 calls total (shared across all tools), no credit cardnpx -y mcp-schema-designer
Basic$10/modesign_schema, validate_schema, generate_typesBuy →
Pro$20/moAll Basic tools + migrate_schema, optimize_queriesBuy →

License keys are delivered to your email immediately after checkout. More info: aivp-mcp.vercel.app

Installation

Note: the npm package is mcp-schema-designer (the bare name schema-designer is a different, unrelated package).

No install step needed — run straight from npm:

npx -y mcp-schema-designer

Or install globally:

npm install -g mcp-schema-designer

Free trial: 3 calls total (shared across all tools), no credit card. Buy a license at the links in Pricing — your key is emailed instantly. Activate it with the LICENSE_KEY environment variable.

Usage

stdio (default)

npx -y mcp-schema-designer

SSE (HTTP)

npx -y mcp-schema-designer --sse
# Listening on http://localhost:3000

Set a custom port:

PORT=8080 npx -y mcp-schema-designer --sse

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "schema-designer": {
      "command": "npx",
      "args": ["-y", "mcp-schema-designer"],
      "env": { "LICENSE_KEY": "<your license key — omit for free trial>" }
    }
  }
}

Tools

design_schema

Design a database schema from a natural language description. Generates CREATE TABLE SQL (PostgreSQL), index recommendations, and a text-based ERD.

Input:

{
  "description": "An e-commerce platform with products, orders, and user accounts"
}

Or provide explicit table definitions to validate and enhance:

{
  "description": "Custom blog schema",
  "tables": [
    {
      "name": "posts",
      "columns": [
        { "name": "id", "type": "SERIAL", "primary": true },
        { "name": "title", "type": "VARCHAR(255)" },
        { "name": "author_id", "type": "INTEGER", "references": "users.id" }
      ]
    }
  ]
}

validate_schema

Validate SQL CREATE TABLE statements for best practices.

Checks for:

  • Missing primary keys
  • Unnamed constraints
  • Missing indexes on foreign keys
  • Data type issues (e.g., TIMESTAMP vs TIMESTAMPTZ, FLOAT for money)
  • Naming convention violations (snake_case, plural table names)
  • N+1 query risks based on relationships

Input:

{
  "sql": "CREATE TABLE User (id SERIAL PRIMARY KEY, firstName VARCHAR(255), orderTotal FLOAT);"
}

migrate_schema

Generate migration SQL by diffing two schemas.

Input:

{
  "from_sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(255));",
  "to_sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, name VARCHAR(255), email VARCHAR(255) NOT NULL UNIQUE);"
}

Output: UP migration (ALTER TABLE to add email column), DOWN migration (rollback), warnings for destructive changes.

generate_types

Generate typed code from SQL schema. Supports three output formats.

Input:

{
  "sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE, name VARCHAR(255), created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP);",
  "format": "typescript"
}

Formats:

FormatOutput
typescriptTypeScript interfaces with Create variants
zodZod validation schemas with inferred types
json-schemaJSON Schema (draft 2020-12) definitions

optimize_queries

Analyze a SQL query against a schema and suggest performance improvements.

Input:

{
  "query": "SELECT * FROM orders WHERE user_id = 123 AND status = 'active' ORDER BY created_at DESC OFFSET 500",
  "schema_sql": "CREATE TABLE orders (id SERIAL PRIMARY KEY, user_id INTEGER REFERENCES users(id), status VARCHAR(50), created_at TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP);"
}

Identifies:

  • Missing indexes (WHERE, JOIN, ORDER BY columns)
  • Query rewrites (SELECT *, NOT IN, leading wildcards, large OFFSET)
  • EXPLAIN plan interpretation hints

Development

npm install
npm run dev    # Watch mode
npm run build  # Production build
npm start      # Run stdio

License

MIT

Keywords

mcp

FAQs

Package last updated on 04 Aug 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts