ainative-postgres-mcp
Provides tools for querying, describing, and modifying PostgreSQL databases, including read-only queries, table management, and inserts.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ainative-postgres-mcplist all tables"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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-mcpThat's it. On first run:
A free managed PostgreSQL instance is provisioned
pgvector extension is enabled automatically
Connection details are saved to
~/.ainative/postgres-config.json,.env, and.mcp.jsonA claim URL is printed so you can take ownership of the database
Related MCP server: MCP Server for PostgreSQL
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 |
| Execute read-only SQL queries (runs in READ ONLY transaction) |
| List all tables with schema, name, and type |
| Get full table schema: columns, types, constraints, indexes |
| Create a new table with SQL DDL |
| Insert rows into a table (returns inserted rows) |
Comparison with official server-postgres
Feature |
|
|
Read queries | Yes | Yes |
Write queries | No | Yes ( |
Schema inspection | Via resources | Via |
Table listing | No | Yes ( |
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 pgvectorpgvector 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 |
| PostgreSQL connection string | No (auto-provisioned if missing) |
| ZeroDB API key (for provisioning) | No (auto-created) |
| ZeroDB project ID | No (auto-created) |
| ZeroDB API base URL | No (defaults to |
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
Powered by ZeroDB + AINative
This package is part of the AINative ecosystem — the AI-native developer platform.
Why ZeroDB?
Feature | ZeroDB | Others |
Vector search | Built-in, free embeddings | Separate service (Pinecone, Qdrant) |
Agent memory | Cognitive memory with decay + reflection | DIY or Mem0 ($$$) |
File storage | S3-compatible, included | Separate S3 bucket |
NoSQL tables | Instant, schema-free | MongoDB Atlas, DynamoDB |
PostgreSQL | Managed, pgvector pre-installed | Neon, Supabase ($$$) |
Serverless functions | DB-event triggered | Firebase/Supabase Edge |
Pricing | Free tier, no credit card | Pay-per-query from day 1 |
Get Started Free
npx zerodb-cli init # Auto-configures your IDEOr sign up at ainative.studio — free tier, no credit card required.
Zero-Config Auto-Provisioning
No account needed to start. On first run, this package automatically:
Provisions a free ZeroDB instance (~800ms)
Saves credentials locally (
.env,.mcp.json)Prints a claim link in your terminal
The 72-Hour Window
Your auto-provisioned instance is free for 72 hours. To keep your data permanently, visit the claim URL printed in your terminal.
For AI Agents
If a coding agent (Claude Code, Cursor, Windsurf) installs this package:
Auto-provisions without human intervention
The claim URL appears in agent output — visit it to take ownership
.claude/CLAUDE.mdinstructs agents to surface the claim link to youCheck
.envor~/.ainative/config.jsonfor your project ID if you miss it
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server that enables powerful PostgreSQL database management capabilities including analysis, schema management, data migration, and monitoring through natural language interactions.Last updated182,274198AGPL 3.0
- Flicense-qualityDmaintenanceA Model Context Protocol server implementation that provides a simple interface to interact with PostgreSQL databases, enabling SQL queries, database operations, and schema management through MCP.Last updated
- Flicense-qualityDmaintenanceA standardized Model Context Protocol server for interacting with PostgreSQL databases, enabling full CRUD operations, schema management, and database introspection.Last updated1
- Alicense-qualityCmaintenanceA production-ready MCP server for PostgreSQL — built for Claude Desktop, Claude Code, and any MCP-compatible AI agent.Last updatedApache 2.0
Related MCP Connectors
MCP server for managing Prisma Postgres.
MCP server for interacting with the Supabase platform
Butterbase MCP server — manage your backend: schemas, auth, functions, storage, RAG, deploys.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/AINative-Studio/ainative-postgres-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server