Ainative Postgres Mcp
FreeMaintainedZero-config Postgres MCP server with auto-provisioning. Drop-in replacement for @modelcontextprotocol/server-postgres — no DATABASE_URL needed. Auto-provisions
About
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
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:
- A free managed PostgreSQL instance is provisioned
- pgvector extension is enabled automatically
- Connection details are saved to
~/.ainative/postgres-config.json,.env, and.mcp.json - 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
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 IDE
Or 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 you- Check
.envor~/.ainative/config.jsonfor your project ID if you miss it
Install Ainative Postgres Mcp in Claude Desktop, Claude Code & Cursor
unyly install ainative-postgres-mcpInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add ainative-postgres-mcp --env DATABASE_URL="" -- npx -y ainative-postgres-mcpStep-by-step: how to install Ainative Postgres Mcp
FAQ
Is Ainative Postgres Mcp MCP free?
Yes, Ainative Postgres Mcp MCP is free — one-click install via Unyly at no cost.
Does Ainative Postgres Mcp need an API key?
Yes, it requires environment variables: DATABASE_URL. Unyly injects them into the config during install.
Is Ainative Postgres Mcp hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Ainative Postgres Mcp in Claude Desktop, Claude Code or Cursor?
Open Ainative Postgres Mcp on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Changes
Versions and requested access over time.
- New version published
- New version published
Related MCPs
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
by wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
by madhurprashPostgres
Query your database in natural language
by AnthropicPostgreSQL
Read-only database access with schema inspection.
by modelcontextprotocolRedis
Interact with Redis key-value stores.
by modelcontextprotocolSQLite
Database interaction and business intelligence capabilities.
by modelcontextprotocolmxcp
Open-source framework for building enterprise-grade MCP servers using just YAML, SQL, and Python, with built-in auth, monitoring, ETL and policy enforcement.
by raw-labstadas-github/a2asearch-mcp
MCP server to search 4,800+ MCP servers, AI agents, CLI tools and agent skills. Install: npx -y a2asearch-mcp. Ask Claude: "Find MCP servers for database access
by tadas-githubjulien040/anyquery
Query more than 40 apps with one binary using SQL. It can also connect to your PostgreSQL, MySQL, or SQLite compatible database. Local-first and private by desi
by julien040drakonkat/wizzy-mcp-tmdb
A MCP server for The Movie Database API that enables AI assistants to search and retrieve movie, TV show, and person information.
by drakonkatCompare Ainative Postgres Mcp with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All data MCPs
