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

ainative-postgres-mcp

v1.0.0

Published

Zero-config Postgres MCP server with auto-provisioning. Drop-in replacement for @modelcontextprotocol/server-postgres — no DATABASE_URL needed. Auto-provisions a managed PostgreSQL instance with pgvector on first run.

Readme

ainative-postgres-mcp

Zero-config PostgreSQL MCP server with auto-provisioning. Drop-in replacement for @modelcontextprotocol/server-postgres — no DATABASE_URL needed.

The official @modelcontextprotocol/server-postgres requires you to bring your own Postgres database and pass a connection string. This fork auto-provisions a managed PostgreSQL instance with pgvector on first run. Agents get a database instantly with zero configuration.

Quick Start

npx ainative-postgres-mcp

That's it. On first run:

  1. A free managed PostgreSQL instance is provisioned
  2. pgvector extension is enabled automatically
  3. Connection details are saved to ~/.ainative/postgres-config.json, .env, and .mcp.json
  4. A claim URL is printed so you can take ownership of the database

MCP Configuration

Claude Code / Claude Desktop

Add to your claude_desktop_config.json or .mcp.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "ainative-postgres-mcp"]
    }
  }
}

With existing database

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "ainative-postgres-mcp"],
      "env": {
        "DATABASE_URL": "postgresql://user:pass@host:5432/mydb"
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "ainative-postgres-mcp"]
    }
  }
}

Windsurf

Add to ~/.windsurf/mcp.json:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": ["-y", "ainative-postgres-mcp"]
    }
  }
}

Tools

| Tool | Description | |------|-------------| | query | Execute read-only SQL queries (runs in READ ONLY transaction) | | list_tables | List all tables with schema, name, and type | | describe_table | Get full table schema: columns, types, constraints, indexes | | create_table | Create a new table with SQL DDL | | insert | Insert rows into a table (returns inserted rows) |

Comparison with official server-postgres

| Feature | @modelcontextprotocol/server-postgres | ainative-postgres-mcp | |---------|----------------------------------------|------------------------| | Read queries | Yes | Yes | | Write queries | No | Yes (create_table, insert) | | Schema inspection | Via resources | Via describe_table tool | | Table listing | No | Yes (list_tables) | | Auto-provisioning | No | Yes | | pgvector | Manual setup | Auto-enabled | | Zero config | No (requires DATABASE_URL) | Yes | | Free tier | N/A | Yes |

How Auto-Provisioning Works

Start
  |
  v
DATABASE_URL set? ----yes----> Connect directly
  |
  no
  v
~/.ainative/postgres-config.json exists? ----yes----> Load and connect
  |
  no
  v
.mcp.json has DATABASE_URL? ----yes----> Load and connect
  |
  no
  v
POST /api/v1/public/instant-db   (get API key)
  |
  v
POST /api/v1/zerodb/postgres/provision   (get Postgres)
  |
  v
Save to ~/.ainative/postgres-config.json + .env + .mcp.json
  |
  v
Connect and enable pgvector

pgvector Support

pgvector is automatically enabled on provisioned instances. You can use vector columns in your tables:

CREATE TABLE documents (
  id SERIAL PRIMARY KEY,
  content TEXT,
  embedding vector(1536)
);

And run similarity searches:

SELECT content, embedding <=> '[0.1, 0.2, ...]'::vector AS distance
FROM documents
ORDER BY distance
LIMIT 10;

Environment Variables

| Variable | Description | Required | |----------|-------------|----------| | DATABASE_URL | PostgreSQL connection string | No (auto-provisioned if missing) | | ZERODB_API_KEY | ZeroDB API key (for provisioning) | No (auto-created) | | ZERODB_PROJECT_ID | ZeroDB project ID | No (auto-created) | | ZERODB_API_URL | ZeroDB API base URL | No (defaults to https://api.ainative.studio) |

Free Tier

Auto-provisioned instances include:

  • Managed PostgreSQL with pgvector
  • Shared compute (suitable for development and light production)
  • Automatic backups
  • SSL encryption

Sign up at ainative.studio to claim your instance and unlock higher limits.

License

MIT