Content
1{
2 "mcpServers": {
3 "postgres": {
4 "command": "npx",
5 "args": ["-y", "@modelcontextprotocol/server-postgres"],
6 "env": {
7 "POSTGRES_CONNECTION_STRING": "postgresql://user:password@localhost:5432/mydb"
8 }
9 }
10 }
11}
12
13// ── Setup ────────────────────────────────────────────────────────────────────
14// Replace the connection string with your actual database URL.
15// The server is READ-ONLY by default — safe to point at production.
16//
17// For Supabase, use the Session Pooler URL (port 5432):
18// postgresql://postgres.PROJECT_REF:PASSWORD@aws-X-REGION.pooler.supabase.com:5432/postgres
19//
20// ── Available tools ──────────────────────────────────────────────────────────
21// query execute a read-only SQL query
22// list_tables list all tables in the database
23// describe_table show columns, types, and constraints for a table
24