P

PostgreSQL

Official
Featured

Read-only Postgres access — schema introspection and SQL queries.

by Anthropic· 38.4k·Data·Updated 1 week ago

Install

Add this command to your MCP client config to connect PostgreSQL.

npx -y @modelcontextprotocol/server-postgres postgresql://localhost/mydb

About PostgreSQL

The Postgres server connects to a PostgreSQL database (or any libpq-compatible target) and exposes schema introspection plus read-only query execution.

It deliberately limits writes by default. The intended workflow is: the assistant explores tables, indexes, and constraints; reasons about a query; and runs SELECTs to validate. For writes, you typically pair it with a migration tool or run statements through your application code.

Use it for ad-hoc analytics, "explain this slow query" sessions, and onboarding new engineers to an unfamiliar schema.

Tags

Other MCP servers in Data and beyond.