Query your database in plain English. The AI sees the real schema, writes the SQL and answers with tables.
Use case: query your production database (read-only) without writing the SQL yourself. The server exposes the introspected schema, so the model knows your tables and columns — no more hallucinated queries.
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://readonly_user:password@localhost:5432/mydb"
]
}
}
}
Create a dedicated readonly role: the reference server only runs read queries, but a restricted role stays best practice.
Exposed tools: query (read-only SQL) + the table schemas published as
resources.
How many orders were placed this month, broken down by acquisition
channel? Present the result as a table with each channel's % of total.
Which tables reference the users table (foreign keys)? For each one,
give the column and an estimated row count.
Build the weekly report: new customers, MRR, churn. Compare with the
previous week and flag any variation above 10%.