Postgres MCP
by AnthropicRead-only Postgres access for MCP clients. Inspect schemas, run SELECT queries, and let your agent answer data questions without write access to your database.
$ install
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:pass@host:5432/dbname"
]
}
}
}
$ cat readme.md
What it exposes
- Schema introspection — list tables, columns, indexes
- Read-only SQL — execute SELECT statements
- Query plan inspection —
EXPLAINfor performance review
Why read-only
The reference server intentionally refuses INSERT/UPDATE/DELETE. For write access, fork it or use a separate connection — but think hard before giving an agent write access to a production database.