PostgreSQL MCP server
Lets the model query your database directly. Read-only is the setting that counts, and it is not the default everywhere.
Tested on Claude Sonnet · 4.5 ·
MCP · Free, open source
Give a model a database connection and schema questions get answers instead of guesses. An instruction hidden in a row of your own data can also reach a query engine. That is why the connection string below uses a read-only role.
What it does well. Exploratory analysis with no export step. You can ask why a query is slow while the model reads the plan itself. It finds the table nobody documented.
What it does badly. Large result sets land in the context window and cost real money. It cannot tell which tables hold personal data, so whatever it reads may come back quoted in a conversation you later share.
Set it up properly. Create a role with SELECT and nothing else, limited to the schemas you want visible. Do not reuse the application user because it is handy.
Notes from the author
The read-only role is the point of the whole setup. Connect as the application user and one confidently wrong UPDATE sits a single accepted suggestion away. The protocol has no confirmation step to stop it.
For information only, not professional advice. You use it at your own risk and we are not liable for any loss or damage. See the disclaimer.
Tagged