PostgreSQL Read-Safe Schema & Query MCP for Claude Code, ChatGPT, Gemini CLI & Cursor
Inspect local or Docker Postgres tables, indexes, foreign keys & run read-only SQL diagnostics.
Quick Answer Summary (Claude Code • ChatGPT • Cursor • Gemini CLI)
PostgreSQL Read-Safe Schema & Query MCP (100% Free OSS) connects to AI coding and chat agents via claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost:5432/mydb. Free Tier: 100% Free official MCP server — connects to any `postgresql://` connection string. Paid Upgrade Threshold: No subscription needed for local Postgres. Pair with Supabase for managed cloud Postgres, Auth & pgvector.
What Works for $0 (Free Tier)
100% Free official MCP server — connects to any `postgresql://` connection string.
When a Paid Subscription Is Required
No subscription needed for local Postgres. Pair with Supabase for managed cloud Postgres, Auth & pgvector.
Zero API keys required — runs locally or over public HTTP immediately.
1-Command Setup for Claude Code, Google Gemini CLI & Cursor
Copy the exact snippet for your AI coding agent — merges alongside the StackOS Master Router so future tool recommendations happen automatically.
claude mcp add postgres -- npx -y @modelcontextprotocol/server-postgres postgresql://localhost:5432/mydb{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost:5432/mydb"
]
},
"stackos-router": {
"httpUrl": "https://stackos-ai.vercel.app/api/mcp"
}
}
}{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://localhost:5432/mydb"
]
},
"stackos": {
"url": "https://stackos-ai.vercel.app/api/mcp"
}
}
}curl -fsSL "https://stackos-ai.vercel.app/api/plugins/install?tools=postgres-local-mcp&src=plugin-seo-postgres-local-mcp" | nodeRecommended SKILL.md / GEMINI.md Rule & GitHub README Badge
Inspect table schemas and EXPLAIN ANALYZE slow queries safely via read-only transactions.
Best Companion Plugins for Databases, Auth & Edge Backend
Supabase Official Postgres, Auth & Vector MCP
Create tables, RLS policies, Edge Functions, Auth & pgvector semantic search straight from Claude/Cursor.
Cloudflare Workers, KV, D1 & R2 Official MCP
Deploy global edge Workers, zero-egress R2 buckets, D1 SQLite databases & WAF rules from chat.