Query and manage PostgreSQL databases directly from AI assistants
The PostgreSQL MCP Server connects your AI assistant directly to a PostgreSQL database. Run SQL queries, explore schemas, inspect data, and debug issues — all through natural conversation. You provide the connection string when configuring the server.
Is it safe?
No known CVEs for @modelcontextprotocol/server-postgres.
No authentication — any process on your machine can connect to this server.
MIT. View license →
Last scanned 0 days ago.
Is it maintained?
Last commit 5 days ago. 82,845 GitHub stars. 74,221 weekly downloads.
Will it work with my client?
Transport: stdio. Works with claude-desktop, cursor, claude-code, windsurf.
How much context will it use?
1 tool. Estimated ~200 tokens.
What if it doesn't work?
Common issues: JSON syntax errors in config, wrong Node.js version, npx cache. Setup guide covers troubleshooting. Or check GitHub issues for known problems.
{
"mcpServers": {
"postgres": {
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://user:pass@localhost:5432/dbname"
],
"command": "npx"
}
}
}Run this in your terminal to verify the server starts. Then let us know if it worked — your result helps other developers.
npx -y @modelcontextprotocol/server-postgres 2>&1 | head -1 && echo "✓ Server started successfully"
After testing, let us know if it worked:
queryExecute a SQL query on the connected database
Last scanned 1h ago
No known vulnerabilities.
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.