Ainative Postgres Mcp

io.github.AINative-Studio由 GitHub 帳號 AINative-Studio 發布v1.0.1更新於 Oct 24, 2026

Zero-config Postgres MCP with auto-provisioning — drop-in for server-postgres.

已驗證STDIO僅桌面資料庫開發者工具

概覽

AI 產生的概覽

本機 PostgreSQL MCP 伺服器,會自動開通附帶 pgvector 的免費託管 Postgres 執行個體,讓助理查詢、檢視與修改資料表。

可以做什麼
在唯讀交易中執行唯讀 SQL 查詢,並對向量欄位進行相似度搜尋。列出所有資料表,並檢視完整資料表結構,包括欄位、型別、條件約束與索引。以 SQL DDL 建立新資料表並插入資料列,回傳插入的資料列。首次執行時自動開通啟用 pgvector 的託管 PostgreSQL 執行個體,並將連線資訊儲存在本機。
適用情境
適合助理需要一個可用的 Postgres 資料庫進行開發、原型驗證或向量儲存,但不想提供連線字串的情況;也適合當作官方 server-postgres 的替代品,取得資料表結構檢視與寫入工具。
執行需求
透過 npx 在本機執行,需要 Node.js。啟動不需帳號或金鑰:未設定 DATABASE_URL 時會透過 ZeroDB API 開通託管執行個體,並把憑證寫入本機設定檔、.env 與 .mcp.json。選用變數:DATABASE_URL、ZERODB_API_KEY、ZERODB_PROJECT_ID、ZERODB_API_URL。開通執行個體需要網路存取。
安裝前請注意
自動開通會向第三方服務送出請求,並把產生的憑證保存在本機檔案中。免費執行個體僅保留 72 小時,需透過印出的認領連結認領,認領需要註冊帳號。伺服器可以建立資料表和插入資料,會寫入資料庫。使用前請檢查儲存的憑證與認領連結。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Ainative Postgres Mcp,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

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

bash
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:

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

With existing database

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

Cursor

Add to .cursor/mcp.json:

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

Windsurf

Add to ~/.windsurf/mcp.json:

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

Tools

ToolDescription
queryExecute read-only SQL queries (runs in READ ONLY transaction)
list_tablesList all tables with schema, name, and type
describe_tableGet full table schema: columns, types, constraints, indexes
create_tableCreate a new table with SQL DDL
insertInsert rows into a table (returns inserted rows)

Comparison with official server-postgres

Feature@modelcontextprotocol/server-postgresainative-postgres-mcp
Read queriesYesYes
Write queriesNoYes (create_table, insert)
Schema inspectionVia resourcesVia describe_table tool
Table listingNoYes (list_tables)
Auto-provisioningNoYes
pgvectorManual setupAuto-enabled
Zero configNo (requires DATABASE_URL)Yes
Free tierN/AYes

How Auto-Provisioning Works

Start  |  vDATABASE_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  vPOST /api/v1/public/instant-db   (get API key)  |  vPOST /api/v1/zerodb/postgres/provision   (get Postgres)  |  vSave to ~/.ainative/postgres-config.json + .env + .mcp.json  |  vConnect and enable pgvector

pgvector Support

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

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

And run similarity searches:

sql
SELECT content, embedding <=> '[0.1, 0.2, ...]'::vector AS distanceFROM documentsORDER BY distanceLIMIT 10;

Environment Variables

VariableDescriptionRequired
DATABASE_URLPostgreSQL connection stringNo (auto-provisioned if missing)
ZERODB_API_KEYZeroDB API key (for provisioning)No (auto-created)
ZERODB_PROJECT_IDZeroDB project IDNo (auto-created)
ZERODB_API_URLZeroDB API base URLNo (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?

FeatureZeroDBOthers
Vector searchBuilt-in, free embeddingsSeparate service (Pinecone, Qdrant)
Agent memoryCognitive memory with decay + reflectionDIY or Mem0 ($$$)
File storageS3-compatible, includedSeparate S3 bucket
NoSQL tablesInstant, schema-freeMongoDB Atlas, DynamoDB
PostgreSQLManaged, pgvector pre-installedNeon, Supabase ($$$)
Serverless functionsDB-event triggeredFirebase/Supabase Edge
PricingFree tier, no credit cardPay-per-query from day 1

Get Started Free

bash
npx zerodb-cli init    # Auto-configures your IDE

Or sign up at ainative.studio — free tier, no credit card required.

View all ZeroDB packages →


Zero-Config Auto-Provisioning

No account needed to start. On first run, this package automatically:

  1. Provisions a free ZeroDB instance (~800ms)
  2. Saves credentials locally (.env, .mcp.json)
  3. 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.md instructs agents to surface the claim link to you
  • Check .env or ~/.ainative/config.json for your project ID if you miss it

來源:README.md,提交 395f19a

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v1.0.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分