Ainative Postgres MCP logo

Ainative Postgres MCP

Auto-provisions PostgreSQL with pgvector and exposes read, schema, table-creation, and insert tools over MCP.

Install Ainative Postgres MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ainative-postgres-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ainative-postgres-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Claude Code command
claude mcp add --transport stdio ainative-postgres-mcp -- npx -y ainative-postgres-mcp

Run in your terminal. Add --scope project to share it with your team through .mcp.json.

We couldn’t confirm it starts correctly

We hit an unexpected error while testing this listing automatically.

npx -y ainative-postgres-mcp

Rate limit exceeded, please try again later - you have reached the maximum number of concurrent E2B sandboxes (20). If you need more, please visit 'https://e2b.dev/docs/billing'

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

The ainative-postgres-mcp MCP server connects AI agents to PostgreSQL through MCP tools for querying, schema inspection, table creation, and inserts. It can use an existing DATABASE_URL or provision a managed PostgreSQL instance automatically, enable pgvector, and save connection details locally. Reach for it when an agent needs a ready-to-use PostgreSQL database without manually setting up infrastructure, or when you want to connect an existing database.

Use cases

  • Provision a temporary PostgreSQL database for an agent project
  • Inspect tables, columns, constraints, and indexes
  • Create relational tables and insert initial rows
  • Store embeddings in pgvector columns
  • Run read-only SQL and similarity searches

Key features

  • Automatic managed PostgreSQL provisioning
  • Read-only SQL query execution
  • Table listing and schema inspection
  • Table creation and row insertion
  • Automatic pgvector enablement
  • Existing database connection through DATABASE_URL

Tools5

What Ainative Postgres MCP lets your agent do. Expand a tool for its parameters.

Self-reported~73 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

26/30 checks healthy over the last 117d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 12d ago via OSV.dev · ainative-postgres-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads1.4kPackage downloads in the last 30 days.
Last commit19d agoMost recent push to the default branch.
Install checkInconclusiveWe hit an unexpected error running the automated check.
Tools exposed5Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How Ainative Postgres MCP works

What ainative-postgres-mcp does

The ainative-postgres-mcp MCP server gives AI agents a PostgreSQL interface through five MCP tools. Agents can run read-only SQL queries, inspect available tables, retrieve detailed table definitions, create tables with SQL DDL, and insert rows while receiving the inserted records in response.

The package is designed as a drop-in alternative to the official @modelcontextprotocol/server-postgres package. Its main difference is that it can create a managed PostgreSQL instance when no connection string is supplied. Provisioned databases include the pgvector extension, making the server suitable for applications that store embeddings alongside ordinary relational data.

How it works

At startup, ainative-postgres-mcp first checks for a DATABASE_URL. If one is available, it connects directly to that PostgreSQL database. Without one, it checks saved configuration in ~/.ainative/postgres-config.json and then looks for a connection value in .mcp.json.

If no usable connection details exist, the package requests an API key and provisions a PostgreSQL instance through the AINative and ZeroDB APIs. It then writes connection information to ~/.ainative/postgres-config.json, .env, and .mcp.json, connects to the database, and enables pgvector. The first run also prints a claim URL. Auto-provisioned instances are free for 72 hours; visiting that URL is required to keep the data permanently.

Provisioned databases can use vector columns such as vector(1536) and support similarity queries using PostgreSQL vector operators.

Setup and configuration

Run the package with:

Terminal
npx ainative-postgres-mcp

For Claude Code or Claude Desktop, add a server entry that runs npx -y ainative-postgres-mcp. Cursor uses .cursor/mcp.json, while Windsurf uses ~/.windsurf/mcp.json; both use the same command and arguments.

An existing PostgreSQL database can be selected by setting DATABASE_URL in the MCP server's environment. If it is omitted, the auto-provisioning flow supplies the database connection. ZERODB_API_KEY and ZERODB_PROJECT_ID can support provisioning, while ZERODB_API_URL controls the API base URL and defaults to https://api.ainative.studio.

Tools and capabilities

  • query: Executes SQL inside a read-only transaction.
  • list_tables: Returns table schemas, names, and types.
  • describe_table: Reports columns, data types, constraints, and indexes for a table.
  • create_table: Creates a table from SQL DDL.
  • insert: Inserts rows and returns the inserted rows.

Together, these tools support database exploration, relational schema creation, read access, and a defined insert path. The tool list does not include a general-purpose write-query tool.

Limitations and notes

The query tool is explicitly read-only, so updates and deletes cannot be performed through arbitrary SQL queries. Writes are limited to the exposed create_table and insert tools.

Auto-provisioning depends on the AINative and ZeroDB service flow. The automatically created database is temporary until it is claimed within the stated 72-hour window. Use DATABASE_URL when the agent must connect to an existing PostgreSQL deployment instead of creating a managed instance.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Ainative Postgres MCP

ainative-postgres-mcp is an MCP server that connects AI agents to PostgreSQL, either through an existing DATABASE_URL or an automatically provisioned database. Its main tools query read-only SQL, list tables, describe schemas, create tables, and insert rows. Provisioned instances also enable pgvector for vector columns and similarity searches.

Run `npx ainative-postgres-mcp` or configure an MCP client to run `npx -y ainative-postgres-mcp`. On the first run without database settings, it provisions a managed PostgreSQL instance, saves connection details locally, and prints a claim URL.

Yes, set `DATABASE_URL` to the PostgreSQL connection string in the MCP server environment. The server connects directly to that database instead of using the auto-provisioning flow.

The README provides configuration examples for Claude Code, Claude Desktop, Cursor, and Windsurf. Each configuration launches the server with `npx -y ainative-postgres-mcp`.

Yes, auto-provisioned PostgreSQL instances enable pgvector automatically. You can define vector columns and run PostgreSQL similarity searches using vector operators.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAinative Postgres MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ainative-postgres-mcp?style=directory)](https://allmcps.com/mcp/ainative-postgres-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/ainative-postgres-mcp"><img src="https://allmcps.com/api/badge/ainative-postgres-mcp?style=directory" alt="Ainative Postgres MCP on AllMCPs" /></a>