npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-schema-designer

v1.1.4

Published

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

Readme

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

| Plan | Price | Features | | |------|-------|----------|---| | Free trial | $0 | 3 calls total (shared across all tools), no credit card | npx -y mcp-schema-designer | | Basic | $10/mo | design_schema, validate_schema, generate_types | Buy → | | Pro | $20/mo | All Basic tools + migrate_schema, optimize_queries | Buy → |

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:

| Format | Output | |--------|--------| | typescript | TypeScript interfaces with Create variants | | zod | Zod validation schemas with inferred types | | json-schema | JSON 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