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

schemaforge-mcp

v0.1.0

Published

MCP server for database schema inspection and migration generation

Downloads

120

Readme

npm version License: MIT Tests TypeScript Node MCP

Universal database migrations for AI coding agents. Inspect, diff, migrate, and manage schemas across PostgreSQL, MySQL, and SQLite — through one MCP interface.

Quick Start · Tools · Pro Features · Security · Architecture


See it in action

 Agent     "Show me the schema for the users table"

 SchemaForge  schema_inspect({ connection_string: "postgresql://...", table: "users" })

 Result:

 Column       Type      Nullable  Default
 id           serial    NO        nextval('users_id_seq')
 email        varchar   NO
 name         text      YES
 created_at   timestamp NO        now()
 updated_at   timestamp NO        now()

 4 columns inspected in 23ms
 Agent     "Generate a migration to add a posts table"

 SchemaForge  generate_migration({
                connection_string: "postgresql://...",
                changes: [{
                  type: "create_table",
                  table: "posts",
                  columns: [
                    { name: "id", type: "serial", primary: true },
                    { name: "title", type: "varchar(255)", nullable: false },
                    { name: "author_id", type: "integer", references: "users(id)" },
                    { name: "published_at", type: "timestamp" }
                  ]
                }]
              })

 Generated SQL:

 CREATE TABLE posts (
   id SERIAL PRIMARY KEY,
   title VARCHAR(255) NOT NULL,
   author_id INTEGER REFERENCES users(id),
   published_at TIMESTAMP
 );

Architecture

graph LR
    A["AI Agent<br/>(Claude, Cursor, Windsurf)"] -->|MCP Protocol| B["SchemaForge MCP"]
    B --> C[("PostgreSQL")]
    B --> D[("MySQL")]
    B --> E[("SQLite")]
    B --> F["Migration Files"]
    B --> G["ORM Models"]

    style A fill:#1f2937,stroke:#58a6ff,color:#f0f6fc
    style B fill:#0d1117,stroke:#58a6ff,stroke-width:2px,color:#58a6ff
    style C fill:#161b22,stroke:#336791,color:#f0f6fc
    style D fill:#161b22,stroke:#00758f,color:#f0f6fc
    style E fill:#161b22,stroke:#003b57,color:#f0f6fc
    style F fill:#161b22,stroke:#30363d,color:#8b949e
    style G fill:#161b22,stroke:#30363d,color:#8b949e

Quick Start

npx schemaforge-mcp

Add to your claude_desktop_config.json:

  • macOS / Linux: ~/.config/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "schemaforge": {
      "command": "npx",
      "args": ["schemaforge-mcp"]
    }
  }
}

Add to .cursor/rules/mcp_servers.json in your project root:

{
  "mcpServers": {
    "schemaforge": {
      "command": "npx",
      "args": ["schemaforge-mcp"]
    }
  }
}

Open settings (Cmd+Shift+P / Ctrl+Shift+P then search "MCP") and add:

{
  "mcpServers": {
    "schemaforge": {
      "command": "npx",
      "args": ["schemaforge-mcp"]
    }
  }
}

Set the PRO_LICENSE environment variable to unlock premium tools:

{
  "mcpServers": {
    "schemaforge": {
      "command": "npx",
      "args": ["schemaforge-mcp"],
      "env": {
        "PRO_LICENSE": "your-license-key"
      }
    }
  }
}

Or from the command line:

PRO_LICENSE=your-license-key npx schemaforge-mcp

Tools

Free Tools (7)

| Tool | Description | |:-----|:------------| | schema_inspect | Inspect database schema — all tables and columns, or a single table with full column details | | schema_diff | Compare two database schemas and return a structured diff of added, removed, and modified objects | | generate_migration | Generate migration SQL (or Knex / Sequelize format) from a list of schema changes — without touching the database | | migration_status | Report applied migrations and detect third-party trackers (Prisma, Knex, Sequelize, Rails) | | validate_migration | Validate DDL migration SQL. PostgreSQL runs a full dry-run in a rolled-back transaction | | suggest_indexes | Suggest missing indexes based on table heuristics or a specific query's execution plan | | scan_from_url | Clone a GitHub repo and scan for SQL migration files and SQLite databases |

Pro Features (6)

| Tool | Description | |:-----|:------------| | apply_migration | Execute migrations against a live database with automatic schema snapshots and tracking | | rollback_migration | Roll back the last N applied migrations using their recorded rollback SQL | | detect_dead_schema | Find database tables not referenced in your codebase | | generate_seed | Generate realistic INSERT statements based on live schema column types | | schema_to_orm | Convert database schema to ORM models — Prisma, Drizzle, Knex, or Sequelize | | multi_env_sync | Compare schemas across environments and generate a pairwise drift report |


Feature Comparison


Database Support

Connection Strings

# PostgreSQL
postgresql://user:password@localhost:5432/mydb

# MySQL
mysql://user:password@localhost:3306/mydb

# SQLite
sqlite:///path/to/database.db
sqlite://:memory:

Security

Read-Only Default No External Calls MIT License Audit Trail

SchemaForge MCP is read-only by default. Write operations require an explicit Pro license.

| Principle | Details | |:----------|:--------| | Read-only by default | Free tools only inspect and generate — they never modify your database | | Your credentials, your control | Connection strings are passed per-call. Nothing is stored or transmitted externally | | Least privilege | Use database roles with minimal permissions for inspection tools | | Audit trail | All applied migrations are tracked in schemaforge_migrations for compliance and rollback | | No telemetry | Zero analytics, zero phone-home. Your schema data stays local |

Best Practices

# Use environment variables — never hardcode credentials
DATABASE_URL=postgresql://user:pass@localhost/db npx schemaforge-mcp

# Use a read-only role for inspection
postgresql://readonly_user:pass@localhost:5432/production

# Always test migrations in staging before production
PRO_LICENSE=key npx schemaforge-mcp  # Connect to staging first

Migration Tracker Interop

SchemaForge detects and respects existing migration systems in your database:

| Tracker | Detection Table | Status | |:--------|:---------------|:-------| | Prisma | _prisma_migrations | ✅ Full support | | Knex | knex_migrations | ✅ Full support | | Sequelize | SequelizeMeta | ✅ Full support | | Rails | schema_migrations | ✅ Full support |

SchemaForge works alongside these tools without conflicts. Use migration_status to see a unified view of all migration systems in your database.


Pro License

Unlock apply, rollback, dead schema detection, seed generation, ORM export, and multi-environment sync.

Get your license:

# Activate
export PRO_LICENSE=your-license-key
npx schemaforge-mcp

# Or inline
PRO_LICENSE=your-license-key npx schemaforge-mcp

Built by Craftpipe — AI-powered developer tools

GitHub · npm · Support

MIT License © 2025 Craftpipe