Best MCP Servers for Postgres in 2026 (Ranked)
The best Postgres MCP server for most teams is Postgres MCP Pro — it reads by default, adds index and query-performance tuning, and allows controlled writes when you opt in. If your database lives on Supabase or Neon, use that platform's own MCP instead. The original @modelcontextprotocol/server-postgres reference is archived; do not start a new project on it. Below: the ranking, the read-only-first safety model, and a decision tree.
Why connect an agent to Postgres?
A Postgres MCP turns "let me open a SQL client and remember the table name" into a conversation. The agent introspects the schema, drafts the query, runs it under a row cap, and returns a clean answer — for ad-hoc reporting, on-call triage, and the "what is in this table again" questions that eat an engineer's afternoon. The catch is that database access is the single most consequential scope you can give an agent, so the right server and the right credential matter more here than in almost any other category.
Safe default
Read-only role + row cap
Setup time
3–5 min per server
Biggest gotcha
Unfiltered schema dumps burn context
The Postgres MCP servers, ranked
Ranked by the composite of capability, maintenance, and how safely each defaults for production. Pick by where your Postgres lives, not by star count.
Postgres MCP Pro
5 min setupBest overall — read-write under controlled scope, plus index and performance tuning.
Postgres MCP Pro is a community-maintained Postgres MCP that goes beyond read-only query execution. It adds EXPLAIN-plan analysis, index recommendations, schema-wide health checks, and write-mode toggles guarded by an explicit safe-mode setting. Designed for engineers who want a Postgres assistant that understands query performance, not just syntax.
uvx postgres-mcp
Supabase
5 min setupBest for Supabase-backed projects — full platform control, RLS-aware.
The Supabase MCP gives AI models access to your entire Supabase project — database queries, auth management, storage operations, and Edge Function management. The definitive MCP for building with Supabase.
npx @supabase/mcp-server-supabase@latest
Neon Postgres
< 1 min setupBest for serverless Postgres — branch a database per agent task.
Neon Postgres is published in the official ChatGPT Apps directory built on the OpenAI Apps SDK. Installation is one-click OAuth from inside ChatGPT — no command-line setup, no JSON config, no environment variables.
PostgreSQL (archived)
3 min setupArchived official reference — read-only, still seen in older setups. Migrate off it.
Anthropic's reference PostgreSQL MCP was the first widely installed Postgres server but is no longer maintained. Anthropic archived the repository on 2025-07-10 at github.com/modelcontextprotocol/servers-archived, and Datadog Security Labs has documented a SQL-injection issue that bypasses the read-only restriction. New installs should use Postgres MCP Pro for tuning workflows or the Supabase MCP for Postgres-on-Supabase. This entry remains so existing users can find the migration path.
npx -y @modelcontextprotocol/server-postgres postgresql://user:pass@localhost/db
Connect with a read-only role — always start here
SELECT-only grants on the schemas the agent needs, then hand it that connection string. Read-only credentials let an agent introspect and query without ever mutating state, and they neutralize the entire class of "the agent helpfully ran a DELETE" incidents. Promote to write only for a specific, audited workflow — never as the default.Quick comparison
| Server | Maintainer | Default scope | Beyond queries | Setup |
|---|---|---|---|---|
| Postgres MCP Pro | CrystalDBA | Read + controlled write | Index tuning, EXPLAIN analysis | 5 min |
| Supabase | Supabase | Project-scoped | Migrations, RLS, edge functions | 5 min |
| Neon Postgres | Neon | Branch-scoped | Per-task database branches | 5 min |
| Official (archived) | Anthropic | Read-only | Minimal — migrate off | 3 min |
Decision tree
Is your Postgres on Supabase?
Use the Supabase MCP — it manages the whole project (schema, RLS, edge functions, auth), not just queries.
Is your Postgres on Neon?
Use the Neon MCP — its branching model lets the agent spin up a throwaway database copy per task.
Self-managed Postgres, and you want tuning?
Use Postgres MCP Pro — it adds EXPLAIN analysis, index recommendations, and controlled writes.
Self-managed, read-only, minimal?
Postgres MCP Pro in read-only mode still wins over the archived reference server. Do not adopt the archived official server.
Scope schema introspection to control token cost
pg_catalog to answer "how many signups last week."Frequently asked questions
What is the best MCP server for Postgres in 2026?
For most teams, Postgres MCP Pro (CrystalDBA) is the best Postgres MCP server: it gives read access by default, adds index-tuning and query-performance analysis, and supports controlled writes when you opt in. If your Postgres lives on Supabase, the Supabase MCP is the better fit because it manages the whole project (schema, RLS, edge functions), not just the database. The original @modelcontextprotocol/server-postgres reference is archived — do not start a new project on it.
Is it safe to connect an AI agent to a production Postgres database?
Yes, if you connect with a read-only role and a row-limit ceiling. A read-only credential lets an agent introspect schemas and run SELECTs without ever mutating state. The unsafe pattern is handing an agent a connection string with write scope and no row cap. Use a dedicated read-only Postgres role, scope it to the schemas the agent needs, and keep writes behind a separate, audited path.
Why was the official Postgres MCP server archived?
Anthropic archived its reference servers (including @modelcontextprotocol/server-postgres) as the ecosystem moved to vendor-maintained and specialist servers. The reference server was read-only and intentionally minimal, and a SQL-injection-class issue in some forks reinforced the move. The practical replacements are Postgres MCP Pro for self-managed Postgres and the Supabase or Neon MCPs for managed Postgres.
How much context does a Postgres MCP consume?
Schema introspection is the hidden cost. An unfiltered get_schema_info on a database with 200+ tables can spend tens of thousands of tokens dumping every table and column before the agent runs a single query. Prefer a server that lets you scope introspection to specific schemas or tables, and point the agent at the tables it needs rather than the whole catalog.
Can a Postgres MCP run migrations or write data?
Some can. Postgres MCP Pro supports controlled writes, and Supabase exposes schema migrations and RLS policy changes. The recommended default is still read-only: let the agent draft the migration, then apply it through your normal reviewed path (CI, a migration tool) rather than letting it execute DDL directly against production.
Next steps
Compare the two most-installed Postgres MCPs head-to-head, or browse the full Databases category.
More guides
Ranked Guide
Best MCP Servers for Browser Automation in 2026 (Ranked)
12 min read
Ranked Guide
Best MCP Servers for Vector Databases in 2026 (RAG-Ready)
11 min read
Ranked Guide
Best MCP Servers for Git in 2026 (GitHub, GitLab, Bitbucket, Local)
11 min read
Ranked Guide
Best MCP Servers for Workflow Automation in 2026 (Ranked)
11 min read
Ranked Guide
Best Free MCP Servers in 2026 (No API Key Required)
10 min read
Comparison
GitHub vs GitLab MCP: Which to Use in 2026
8 min read
Comparison
Pinecone vs Qdrant vs Chroma MCP: Which to Use (2026)
9 min read
Comparison
Playwright vs Browserbase MCP: Local vs Cloud (2026)
8 min read
Comparison
Postgres MCP vs Supabase MCP: Which to Use (2026)
8 min read
Comparison
n8n vs Zapier vs Make MCP: Which to Use (2026)
9 min read
Ranked Guide
Best MCP Servers for Deploying Websites in 2026 (Ranked)
11 min read
Comparison
Vercel vs Netlify vs Cloudflare MCP: Which to Use (2026)
9 min read
Tutorial
Deploy to Vercel With an AI Agent (Vercel MCP, 2026)
7 min read
Tutorial
Deploy to Cloudflare With an AI Agent (Cloudflare MCP, 2026)
7 min read
Strategy
Can an AI Agent Deploy to Production? (Safely, in 2026)
8 min read
Fundamentals
What Is MCP? A Plain-English Guide to Model Context Protocol
6 min read
Setup Guide
Best MCPs for Cursor in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Claude Desktop in 2026 (Ranked + Setup)
9 min read
Setup Guide
Best MCPs for Claude Code in 2026 (Ranked + Setup)
8 min read
Setup Guide
Best MCPs for Codex CLI in 2026 (Ranked + config.toml)
8 min read
Setup Guide
Best MCPs for Windsurf in 2026 (Cascade-Ready Setup)
8 min read
Setup Guide
Best MCPs for VS Code in 2026 (Agent Mode + .vscode/mcp.json)
8 min read
Vertical Guide
Best MCPs for Marketing in 2026 (Ranked + Use Cases)
9 min read
Vertical Guide
Best MCPs for SEO in 2026 (Ranked + Workflows)
9 min read
Vertical Guide
Best MCPs for Data Teams in 2026 (Ranked + Workflows)
9 min read
Vertical Guide
Best MCPs for Security in 2026 (Ranked + Posture Workflows)
10 min read
Strategy
MCP Registry vs Curated Directory: Which Should You Use?
5 min read
Setup Guide
Best MCPs for ChatGPT: The Apps and Connectors Worth Installing
9 min read
Tutorial
How to Add an MCP Server to ChatGPT (Developer Mode + Apps Directory)
7 min read
Security
MCP Security: What to Know Before You Install
9 min read
Role Guide
Best MCPs for Marketers in 2026 (SEO, Email, Analytics)
8 min read
Strategy
Remote vs Local MCP Servers: When to Use Each
7 min read
Fundamentals
MCP vs Function Calling: What’s the Difference?
6 min read
Comparison
MCP Directories Compared: Top MCPs vs mcp.so vs PulseMCP vs mcp.directory
8 min read
Security
MCP Prompt Injection: How Tool-Calling Agents Get Hijacked
8 min read
Security
OAuth 2.1 for MCP: What the Spec Standardised and What You Need to Know
8 min read
Security
Sandboxing MCP Servers: Containers, Least Privilege, and Process Isolation
9 min read
Security
Rotating MCP Credentials: A Practical Guide for Leaks, Expiry, and Routine Hygiene
7 min read
Security
Least-Privilege Scoping for MCPs: How to Grant the Smallest Useful Permission
7 min read
Setup Guide
Best MCP Servers for Databases in 2026 (Ranked + Setup)
10 min read
Setup Guide
Best MCP Servers for Research in 2026 (Search, Scrape, Synthesize)
9 min read
Setup Guide
Best MCP Servers for Design-to-Code in 2026 (Figma → React)
9 min read
Setup Guide
Best MCP Servers for Domains in 2026 (Registrars + DNS)
9 min read
Tutorial
How to Buy a Domain From Claude (Cloudflare MCP, Step by Step)
6 min read
Tutorial
How to Search for Domains With an AI Agent (Cross-Registrar Workflow)
7 min read
Tutorial
How to Deploy a Website With an AI Agent (MCP Workflow)
8 min read