Skip to content
Automation Squad

Ranked roundup · Postgres

Best MCP Server for Postgres

Picking an MCP server for Postgres starts with an awkward fact: the PostgreSQL project doesn't ship one. The reference server that used to fill the role, @modelcontextprotocol/server-postgres, was archived in May 2025 and no longer receives fixes. What exists instead is a healthy split. The strongest dedicated option, Postgres MCP Pro, is a community server with 3,200+ GitHub stars and a genuine read-only mode. Google maintains an official multi-database server, MCP Toolbox for Databases, at 16,000+ stars. And if your Postgres lives on Supabase or Neon, both vendors run official hosted MCP endpoints with OAuth. The axis that matters most is write safety: every server here can run SQL against your database, and they differ mainly in how hard they make it to run the wrong SQL. We ranked these six on verifiable criteria — official status, last-commit recency, adoption, auth model, and documented capability coverage. No paid placement, and no invented benchmark scores.

Facts checked September 1, 2026 · ranked on verifiable criteria · placement is never for sale

Robert MacKelfresh

By Robert MacKelfresh

Founder, Automation Squad ·

The ranking

  1. Teams running their own Postgres who want DBA-grade analysis and a real read-only mode, not just a query passthrough.

    execute_sql, explain plans with hypothetical-index simulation (hypopg), workload and query index tuning, database health checks (buffer cache, connections, vacuum, replication, constraints), top queries via pg_stat_statements, schema navigation.

    Self-hosted: Docker image, pipx/uv install, or from source; runs locally over stdio against any Postgres you can reach. · Standard Postgres connection string via DATABASE_URI. Two access modes: unrestricted (full read/write, for dev) and restricted (read-only transactions enforced by SQL parsing via pglast, plus execution-time limits, for production). · MIT · 3,245★

    • Community project — not affiliated with the PostgreSQL project or any Postgres vendor.
    • The LLM-driven index tuning feature is marked experimental and requires an OpenAI API key.
    • Docs state testing focuses on Postgres 15-17; versions 13-14 are planned, not confirmed.
    • Restricted mode blocks writes by parsing SQL — still connect with a low-privilege role rather than relying on the parser alone.
  2. Official · Google

    Teams that want a vendor-backed server and, in production, locked-down predefined query tools rather than an agent writing arbitrary SQL.

    Prebuilt generic tools (list_tables, execute_sql) for instant exploration, plus a custom-tools framework for structured queries, semantic search, and NL2SQL with restricted access; OpenTelemetry observability out of the box.

    Self-hosted binary or npx (@toolbox-sdk/server); config-driven server that sits between your agent and the database. Plain self-hosted Postgres is supported alongside AlloyDB and Cloud SQL. · Database credentials in server config; integrated auth (IAM) and connection pooling built in. The custom-tools framework is the security model: you can expose only predefined, parameterized queries instead of free-form SQL. · Apache-2.0 · 16,288★

    • A general multi-database toolbox, not Postgres-specific — no index tuning or Postgres health-check tooling.
    • The locked-down production posture requires writing a tools config; heavier setup than single-purpose servers.
    • Maintained by Google — expect the roadmap to prioritize AlloyDB and Cloud SQL alongside vanilla Postgres.
  3. Official · Supabase

    Anyone whose Postgres lives on Supabase — the OAuth hosted endpoint is the easiest setup in this roundup.

    SQL execution, migrations, branching, Edge Functions deployment, docs search; storage tools are off by default.

    Hosted remote endpoint (https://mcp.supabase.com/mcp) for cloud projects; local endpoint via the Supabase CLI for local dev. No install needed for the hosted path. · Browser OAuth via dynamic client registration by default — no token to manage; personal access token supported for CI. Read-only mode runs all queries as a read-only Postgres user, and project scoping disables account-level tools. · Apache-2.0 · 2,884★

    • Only works with Supabase projects — it is not a general Postgres server.
    • Supabase's own docs warn about prompt injection and recommend against connecting it to production; use read-only mode and project scoping for anything sensitive.
  4. Official · Neon

    Neon serverless Postgres users, especially for schema changes — migrations run on temporary branches before touching the main branch.

    SQL execution, schema changes applied on temporary branches, 15 built-in diagnostics (table sizes, unused indexes, sequential scans, stalled queries), branch/project/compute management, snapshots.

    Hosted remote endpoint (https://mcp.neon.tech/mcp) over streamable HTTP; supports URL-level controls (?readonly=true, ?projectId=..., ?category=...). · OAuth during setup (a read-only scope can be enforced in the flow) or a Neon API key as a Bearer token. · MIT · 626★

    • Neon-only — not a general Postgres server.
    • Neon's docs mark the local npm install path as deprecated; use the hosted endpoint.
    • Neon states MCP is for development and testing only, not production, and says to review every LLM action before execution.
    • If IP Allow is enabled on your project, two static Neon IPs must be allowlisted first.
  5. Community

    Teams that need one MCP config to cover Postgres and several other engines without running five servers.

    execute_sql with transaction support, search_objects for schema exploration, optional explain_sql and health_check, plus custom parameterized tools defined in dbhub.toml. Built by Bytebase and deliberately token-light (about 1.4k tokens of tool definitions by default).

    Self-hosted via npx or Docker; one server covers Postgres, MySQL, SQL Server, MariaDB, and SQLite. · DSN connection string per database; SSH tunneling and SSL/TLS supported. Guardrails include a documented read-only mode, row limiting, and query timeouts. · MIT · 3,439★

    • Multi-engine generalist — no Postgres-specific tuning or index-advisory tools.
    • Requires Node.js 22.5 or newer for the npx path.
  6. Official · Model Context Protocol project (Anthropic)

    Nobody, for new work. If you find it in a guide, use Postgres MCP Pro in restricted mode instead.

    Basic read-only SQL queries and schema inspection. Listed here only so you don't adopt it from an old tutorial.

    Local npm package (@modelcontextprotocol/server-postgres) — the original reference implementation. · Connection string; advertised read-only query access. · MIT · 295★

    • Archived — the repo is explicitly labeled 'no longer maintained' and last saw a push in May 2025.
    • No security fixes or updates are coming.
    • The 295 stars belong to the archive repo; the server originally lived in the main modelcontextprotocol/servers repo before being moved out.

Postgres MCP servers compared

ServerMaintained byRunsAuthLicense
Postgres MCP ProCommunitySelf-hosted: Docker image, pipx/uv install, or from source; runs locally over stdio against any Postgres you can reach.Standard Postgres connection string via DATABASE_URI. Two access modes: unrestricted (full read/write, for dev) and restricted (read-only transactions enforced by SQL parsing via pglast, plus execution-time limits, for production).MIT
MCP Toolbox for DatabasesGoogleSelf-hosted binary or npx (@toolbox-sdk/server); config-driven server that sits between your agent and the database. Plain self-hosted Postgres is supported alongside AlloyDB and Cloud SQL.Database credentials in server config; integrated auth (IAM) and connection pooling built in. The custom-tools framework is the security model: you can expose only predefined, parameterized queries instead of free-form SQL.Apache-2.0
Supabase MCPSupabaseHosted remote endpoint (https://mcp.supabase.com/mcp) for cloud projects; local endpoint via the Supabase CLI for local dev. No install needed for the hosted path.Browser OAuth via dynamic client registration by default — no token to manage; personal access token supported for CI. Read-only mode runs all queries as a read-only Postgres user, and project scoping disables account-level tools.Apache-2.0
Neon MCPNeonHosted remote endpoint (https://mcp.neon.tech/mcp) over streamable HTTP; supports URL-level controls (?readonly=true, ?projectId=..., ?category=...).OAuth during setup (a read-only scope can be enforced in the flow) or a Neon API key as a Bearer token.MIT
DBHubCommunitySelf-hosted via npx or Docker; one server covers Postgres, MySQL, SQL Server, MariaDB, and SQLite.DSN connection string per database; SSH tunneling and SSL/TLS supported. Guardrails include a documented read-only mode, row limiting, and query timeouts.MIT
Reference Postgres server (archived)Model Context Protocol project (Anthropic)Local npm package (@modelcontextprotocol/server-postgres) — the original reference implementation.Connection string; advertised read-only query access.MIT

How to choose

Pick Postgres MCP Pro if you run your own Postgres and want depth: index tuning, explain plans, health checks, and a restricted mode that blocks writes. Pick MCP Toolbox for Databases if you want vendor-backed infrastructure and predefined, locked-down query tools instead of free-form SQL in production. Pick Supabase MCP or Neon MCP if your database already lives on those platforms — their hosted OAuth endpoints are the lowest-friction setups here. Pick DBHub if one server must cover Postgres alongside MySQL, SQL Server, MariaDB, and SQLite. Whatever you pick, connect a read-only role first and upgrade privileges only when you must.

How this ranking works

Every server here is real and was checked against its repository or vendor documentation on the date above — stars and licenses come from the GitHub API, not from memory. Order reflects verifiable criteria only: official support, maintenance recency, adoption, auth model, and documented capability coverage. We do not run paid placements, and we list every caveat we find, including the unflattering ones.

Common questions

Is there an official MCP server for Postgres?
Not from the PostgreSQL project itself, and the old reference server was archived in May 2025. The closest official options are Google's MCP Toolbox for Databases (Apache-2.0, actively pushed as of September 2026), and the vendor-run servers from Supabase and Neon if your database is hosted there.
How does setup and auth actually work for a Postgres MCP server?
Self-hosted servers (Postgres MCP Pro, DBHub, MCP Toolbox) take a standard Postgres connection string, so the server holds whatever privileges that role has — create a dedicated read-only role before connecting an agent. Hosted vendor servers (Supabase, Neon) use browser OAuth with optional read-only scoping, plus personal access tokens or API keys for CI.
Can these servers write to my database?
Most can by default, including DDL. Every server in this roundup documents a read-only option — Postgres MCP Pro's restricted mode, DBHub's read-only mode, and read-only flags on the Supabase and Neon endpoints — and both Supabase and Neon explicitly advise against pointing agents at production databases at all.
What about managed MCP platforms like Composio or Zapier?
As of September 2026, Composio lists no direct Postgres toolkit — its database coverage goes through Neon, Supabase, and DigitalOcean integrations rather than a raw connection string. If you want a hosted no-install path, the Supabase and Neon endpoints are the genuine options.

MCP servers we build

Automation Squad publishes its own open-source MCP servers and agent skills, documented with the same rules this ranking uses.