Best MCP Servers for PostgreSQL (2026)
The best MCP servers for PostgreSQL — let AI agents run queries, inspect schemas, and read or write records in your Postgres database from Claude, Cursor, and other MCP clients.
#2 MCP Ssh Manager
bvisibleWhy it’s hereCommunity pick
Manage multiple SSH servers from one MCP: command execution, file transfer/rsync, database dump/import/query (MySQL/PostgreSQL/MongoDB), backups & restore, health monitoring, persistent sessions, tunnels, ProxyJump/bastion, and opt-in per-server security modes (readonly/restricted) with audit log. Linux, macOS & Windows OpenSSH.
Upvotes: 0Installs: 0GitHub stars: 531InstallWhy it’s hereCommunity pick
自托管的抖音、TikTok、B 站数据采集与无水印视频下载 API,支持 AI agent 通过 MCP 调用与离线语音转文字,Docker 一键部署。| Self-hosted TikTok, Douyin & Bilibili scraper and no-watermark video downloader — async REST API, MCP server for AI agents, CLI and web console, plus offline speech-to-text for downloaded videos. Self-healing identity pool, PostgreSQL archive, one docker compose up.
Upvotes: 0Installs: 0GitHub stars: 21kInstall#6 Robrain
adelinamartWhy it’s hereCommunity pick
Self-hosted decision memory for AI coding agents. Passively captures architectural decisions with the alternatives you rejected (structured rejected[]), then warns the agent before it re-proposes a rejected approach. Postgres + pgvector; cross-tool across Claude Code, Cursor, Copilot, and Codex. Install: npx robrain up && npx robrain install.
Upvotes: 0Installs: 0GitHub stars: 88InstallWhy it’s hereCommunity pick
MCP server for PostgreSQL: local, Docker, RDS, Neon, Supabase, or behind an SSH bastion.
Upvotes: 0Installs: 0GitHub stars: 24InstallWhy it’s hereCommunity pick
PostgreSQL MCP server - query, schema introspection, explain, and health checks for AI assistants
Upvotes: 0Installs: 0GitHub stars: 10InstallWhy it’s hereCommunity pick
PostgreSQL schema intelligence from a committed snapshot. No connection, no credentials.
Upvotes: 0Installs: 0GitHub stars: 36Install
Which PostgreSQL MCP server should you use?
The official modelcontextprotocol/server-postgres and crystaldba/postgres-mcp are the two most widely deployed Postgres servers — both cover schema introspection and querying, and crystaldba/postgres-mcp additionally ships EXPLAIN-based query analysis, which is useful if you want the agent to help diagnose slow queries rather than just run them.
Connect with a read-only role first (`GRANT SELECT ON ALL TABLES IN SCHEMA public TO ...`). If you later want the agent to write, most Postgres servers gate that behind an explicit flag or a separate write-capable connection string — treat that as a deliberate opt-in, not the default.
For managed Postgres (Supabase, Neon, RDS), use the connection string your provider issues for a scoped/read replica role if one is available, rather than the primary admin connection string.
Frequently asked questions about PostgreSQL MCP servers
What is the best Postgres MCP server?
The official modelcontextprotocol/server-postgres and crystaldba/postgres-mcp are the most widely installed. This page ranks Postgres MCP servers by real usage across the AllMCPs directory so you can start with a proven one.
Can a Postgres MCP server write to my database?
Some support writes, but most default to read-only for safety. Connect with a least-privilege role scoped to only the tables the agent needs, and enable write mode explicitly if the server offers it.
How do I connect Claude to Postgres?
Install a Postgres MCP server in your client config, pass your connection string via an environment variable, and restart the client. Each listing links to its exact setup steps.