npm · mcp-schema-designer

PostgreSQL schema work,
exposed as MCP tools.

Give an MCP agent pure-logic tools to draft schemas, review CREATE TABLE SQL, prepare migration text, generate application types, and inspect query patterns. The server returns artifacts for you to review; it never connects to a database.

5 shipped tools PostgreSQL dialect Node.js 18+ MIT license
 npx -y mcp-schema-designer
Schema Designer MCP server running on stdio

Shipped surface

Five focused tools, each returning reviewable text

Basic

design_schema

Accepts a description and optional table definitions. Returns PostgreSQL CREATE TABLE SQL, index recommendations, a summary, and a text ERD.

Basic

validate_schema

Checks CREATE TABLE statements for primary keys, named constraints, foreign-key indexes, selected type issues, naming conventions, and relationship-based N+1 risks.

Pro

migrate_schema

Diffs current and target schema SQL, then drafts UP and DOWN statements with warnings for detected table drops, column drops, type changes, and NOT NULL changes.

Basic

generate_types

Maps parsed tables to TypeScript interfaces, Zod schemas, or JSON Schema draft 2020-12 definitions. TypeScript and Zod output includes create variants when applicable.

Pro

optimize_queries

Reviews a query alongside schema SQL and returns heuristic index suggestions, rewrite ideas, and guidance for interpreting an EXPLAIN plan.

Agent workflows

Three concrete ways an agent can use the tools

01 · Brief to draft

Start a project schema with design_schema

An agent can turn a scoped product brief into a PostgreSQL draft, index recommendations, and a text ERD, then present the result for review.

Call: design_schema

{
  "description": "A project tracker with users, projects, tasks, and assignees"
}
02 · Review a change

Validate first, then draft a migration

An agent can call validate_schema on current SQL and then use migrate_schema to prepare a reversible change plan. Migration output is text only and still needs human review.

First call: validate_schema

{
  "sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, email VARCHAR(255));"
}

Then: migrate_schema

{
  "from_sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, email VARCHAR(255));",
  "to_sql": "CREATE TABLE users (id SERIAL PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE);"
}
03 · Types and query review

Generate a contract, then inspect a query pattern

An agent can call generate_types for application-facing output and optimize_queries for static suggestions against the same schema context.

First call: generate_types

{
  "sql": "CREATE TABLE orders (id SERIAL PRIMARY KEY, status VARCHAR(50));",
  "format": "typescript"
}

Then: optimize_queries

{
  "query": "SELECT * FROM orders WHERE status = 'open' ORDER BY id;",
  "schema": "CREATE TABLE orders (id SERIAL PRIMARY KEY, status VARCHAR(50));"
}

Install

Use the published npm package over stdio

The package name includes the mcp- prefix. The unrelated bare schema-designer package is not this server.

Open your client's config file

  • Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json

    Windows: %APPDATA%\Claude\claude_desktop_config.json. In the app: Settings → Developer → Edit Config.

  • Cursor ~/.cursor/mcp.json

    Or .cursor/mcp.json inside a single project.

  • Windsurf ~/.codeium/windsurf/mcp_config.json

    Cascade panel → MCP icon → edit the raw config.

Paste this entry

All three clients accept the same object. If the file already has an mcpServers block, add just the "schema-designer" entry inside it.

mcpServers entry
{
  "mcpServers": {
    "schema-designer": {
      "command": "npx",
      "args": ["-y", "mcp-schema-designer"]
    }
  }
}

No env block is needed to start: the first 3 tool calls total across this server's tools run without a license.

Using Claude Code instead? One command, no file

shell
$ claude mcp add --transport stdio schema-designer -- npx -y mcp-schema-designer

Check it registered with claude mcp list. Add a key later with --env LICENSE_KEY=your-key placed before --transport.

Restart the client, then confirm it loaded

  • Claude Desktop: quit and reopen the app, then look for Schema Designer in the tools/plugin menu.
  • Cursor: Settings → Customize → MCP; the server should list its tools.
  • Windsurf: reload Cascade; the server appears under the MCP panel.
  • Claude Code: run claude mcp list and look for ✔ Connected.

Running npx -y mcp-schema-designer in a terminal looks frozen — that is correct. It is a stdio server: it waits silently for an MCP client on stdin and never returns a prompt. Press Ctrl+C to exit. Use the config above rather than the bare command; your client starts the process for you.

Add your license key when you buy

A key arrives on screen right after checkout. Add it as an environment variable in the same entry:

mcpServers entry with license
{
  "mcpServers": {
    "schema-designer": {
      "command": "npx",
      "args": ["-y", "mcp-schema-designer"],
      "env": {
        "LICENSE_KEY": "paste-your-key-here"
      }
    }
  }
}

Keys are verified offline against a public key compiled into the package — no account, no network check, no usage reporting. Lost the key? Recover it here. More detail on the FAQ.

Trial and plans

Three free calls total — not three per tool

The counter is shared across all five tools

Without a license key you get 3 tool calls total, shared across all five tools — not three per tool, and not three per day. It is a one-off trial: the count persists to ~/.aivp-mcp/usage.json (with an in-memory fallback), so restarting the process does not reset it. No account or credit card is required.

A paid key removes the limit and unlocks unlimited, ungated calls to the tools in your plan. Basic ($10/mo) covers design_schema, validate_schema, and generate_types. The Pro-only tools migrate_schema and optimize_queries are not included in Basic; Pro ($20/mo) adds them.

Your key stays valid for 365 days and is verified fully offline against a public key compiled into the package — no account, no network check, no usage reporting.

Explicit scope

Boundaries are part of the interface

What it does

  • Reads descriptions, explicit table definitions, SQL schema text, and query text.
  • Returns PostgreSQL SQL, reports, text diagrams, suggestions, and typed output.
  • Flags selected destructive schema changes for review.

What it does not do

  • Connect to PostgreSQL, inspect live data, apply DDL, or run migrations.
  • Run EXPLAIN, create backups, test rollback SQL, or guarantee production safety.
  • Support MySQL, SQLite, or other SQL dialects.
  • Fully parse arbitrary SQL; parsing is regex-based and analysis is heuristic.
  • Persist schema projects or database contents; trial-call accounting is the only local state and uses a best-effort file with an in-memory fallback.

Start with three free calls

Connect Schema Designer, then license it when you are ready.

Add the server to your MCP client with no key and spend the shared three-call trial on a real schema. Buy Basic or Pro when you want unlimited, ungated calls to the tools in your plan.