design_schema
Accepts a description and optional table definitions. Returns PostgreSQL CREATE TABLE SQL, index recommendations, a summary, and a text ERD.
npm · mcp-schema-designer
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.
npx -y mcp-schema-designer
Schema Designer MCP server running on stdio
Shipped surface
design_schemaAccepts a description and optional table definitions. Returns PostgreSQL CREATE TABLE SQL, index recommendations, a summary, and a text ERD.
validate_schemaChecks CREATE TABLE statements for primary keys, named constraints, foreign-key indexes, selected type issues, naming conventions, and relationship-based N+1 risks.
migrate_schemaDiffs 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.
generate_typesMaps parsed tables to TypeScript interfaces, Zod schemas, or JSON Schema draft 2020-12 definitions. TypeScript and Zod output includes create variants when applicable.
optimize_queriesReviews a query alongside schema SQL and returns heuristic index suggestions, rewrite ideas, and guidance for interpreting an EXPLAIN plan.
Agent workflows
design_schemaAn 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"
}
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);"
}
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
The package name includes the mcp- prefix. The unrelated bare
schema-designer package is not this server.
~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json. In the app: Settings → Developer → Edit Config.
~/.cursor/mcp.json
Or .cursor/mcp.json inside a single project.
~/.codeium/windsurf/mcp_config.json
Cascade panel → MCP icon → edit the raw config.
All three clients accept the same object. If the file already has an mcpServers block, add just the "schema-designer" entry inside it.
{
"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.
$ 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.
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.
A key arrives on screen right after checkout. Add it as an environment variable in the same entry:
{
"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
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
Start with three free calls
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.