Postgres MCP Server
Postgres MCP servers connect to a PostgreSQL database for read and write SQL, schema inspection and query analysis. It is community-maintained. Works in Claude, Cursor and Claude Code.
What Postgres can do
Tools Postgres exposes
6 tools · from docsThe exact tools this MCP server gives your AI.
| query | Run a read-only SQL query | read |
| execute | Run a write SQL statement | write |
| list_schemas | List schemas | read |
| list_tables | List tables in a schema | read |
| describe_table | Describe a table's columns | read |
| explain_query | Explain a query plan | read |
Try asking Claude
Example prompts once Postgres is connected.
Set up Postgres
Pick your client. Every snippet is copy-ready.
Claude Desktop → Settings → Developer → Edit Config (claude_desktop_config.json).
{
"mcpServers": {
"postgres": {
"command": "npx",
"args": [
"-y",
"@crystaldba/postgres-mcp"
]
}
}
}Permissions & safety
Can change data via: execute
Runs locally, so your data stays on your machine and only what the AI needs is sent to the model.
To stay safe, connect with least-privilege scopes and use a read-only credential where the service supports one.
Troubleshooting
FAQ
Postgres is a local server, so you add it with a command: run "claude mcp add postgres -- npx -y @crystaldba/postgres-mcp", then restart Claude. See the config snippet above for Cursor and VS Code.
More Database MCP servers
Supabase
Database
Supabase's official MCP server manages your Postgres database, tables, SQL, branches, edge functions and project config.
MongoDB
Database
MongoDB's MCP server queries and manages MongoDB collections, documents and Atlas clusters.
Firebase
Database
Firebase's MCP server (via the Firebase CLI) manages Firestore, Auth, Storage and project config.
Postgres compared
Running a digital business since 2019 and a local SEO agency, Ari built and shipped GBPAudit.AI as a Claude connector. Every server here is connected and its tools read before it's listed.
Something wrong with this listing? Report it.