|Comparison

7 Best Postgres MCP Servers in 2026 (Compared)

Compare Postgres MCP Pro, DBHub, pgEdge, Supabase, Neon, datamcp, and the archived @modelcontextprotocol/server-postgres package.

Andrei
Founder of datamcp

The short answer

The best Postgres MCP server depends on the job rather than one universal ranking:

  • Postgres MCP Pro by CrystalDBA is the strongest open-source choice for query plans, health checks, and index tuning.
  • DBHub is a practical local server when one MCP configuration must cover PostgreSQL and other database engines.
  • pgEdge Postgres MCP offers a broad self-hosted server with local and HTTP modes, authentication, a web interface, and read-only controls.
  • Supabase MCP is the natural choice when the agent needs Supabase project tools, not only SQL access.
  • Neon MCP is the natural choice for Neon project, branch, migration, and database workflows.
  • datamcp fits teams that want a hosted PostgreSQL MCP link with separate client authentication, per-link permissions, credential isolation, revocation, and query activity review.

If the database engine or architecture is not yet decided, start with the broader database MCP server guide. This page owns the PostgreSQL-specific comparison.

The old @modelcontextprotocol/server-postgres reference package is archived. It remains relevant because many setup guides and existing MCP configurations still mention it, but it should not be the default choice for a new deployment.

If that package is already in your configuration, use the dedicated @modelcontextprotocol/server-postgres migration guide to inventory clients, preserve the read-only boundary, rotate credentials, and verify denial behavior.

This comparison is maintained by the datamcp team. datamcp is one of the products compared, so its ownership is disclosed throughout rather than presented as an independent ranking.

Fastest decision: choose CrystalDBA for PostgreSQL tuning, DBHub for a small multi-database tool surface, Supabase or Neon for provider administration, pgEdge for broad self-hosted control, and datamcp when the requirement is a hosted PostgreSQL endpoint with separate links, permissions, revocation, and query activity review.

Whichever server you choose, connect it with a restricted database identity rather than an owner role. The Postgres AI access security kit provides a reusable non-owner role, explicit grants, RLS checks, denial tests, and revocation commands.

Want to test the hosted path? Create one free PostgreSQL MCP link, start with a dedicated read-only role, and verify both an allowed query and a denied write before expanding access.

How these PostgreSQL MCP servers were evaluated

Every option was reviewed against its current official repository or product documentation. The comparison prioritizes:

  1. the job the server is designed to perform
  2. local, self-hosted, or managed deployment
  3. how PostgreSQL credentials reach the server
  4. available read-only or fine-grained controls
  5. team access, revocation, and activity evidence
  6. PostgreSQL-specific depth beyond basic SQL execution

GitHub stars and package popularity were not used as a substitute for product fit. A widely used local server can still be the wrong architecture for shared production access.

PostgreSQL MCP server comparison

ServerBest forDeploymentAccess controlsPostgreSQL-specific depth
@modelcontextprotocol/server-postgresUnderstanding old configurationsLocal stdioRead-only reference behaviorBasic schema and queries
Postgres MCP ProPerformance tuning and database healthSelf-hosted stdio or SSERestricted or unrestricted SQL modeHigh
DBHubOne local server for several database enginesSelf-hosted stdio or HTTPRead-only mode, row limit, timeoutMedium
pgEdge Postgres MCPBroad self-hosted PostgreSQL accessSelf-hosted stdio or HTTPRead-only mode, user/token auth, TLSHigh
Supabase MCPSupabase development and managementHosted remote MCPProject scope, feature groups, read-only modeSupabase-specific
Neon MCPNeon projects, branches, and migrationsHosted remote MCP or local setupOAuth scopes, project scope, categories, read-only modeNeon-specific
datamcpGoverned access to standard PostgreSQLHosted remote MCPPer-link presets, custom table operations, OAuth or API keyPostgreSQL access and governance

No row is universally “best.” A local tuning tool, a provider management server, and a hosted access gateway solve different problems even when all three can execute SQL.

Best Postgres MCP server by use case

Use this shorter decision table before comparing every feature:

RequirementBest starting pointWhy
PostgreSQL performance tuningPostgres MCP ProQuery plans, health checks, index analysis, and hypothetical indexes
Several database enginesDBHubOne compact tool surface across PostgreSQL and other supported engines
Broad self-hosted PostgreSQL controlpgEdge Postgres MCPLocal and remote modes with authentication and read-only controls
Supabase project administrationSupabase MCPSupabase-specific project, migration, logs, and platform tools
Neon project and branch workflowsNeon MCPNeon-specific branches, migrations, projects, and hosted OAuth
Hosted standard PostgreSQL accessdatamcpServer-side credentials, separate links, permissions, revocation, and PostgreSQL query activity
Understanding an old configurationArchived reference packageUseful only for identifying and migrating legacy mcp.json examples

This is also why a search for “Postgres MCP” produces several valid but incompatible answers. The provider servers operate their own platforms, tuning servers inspect PostgreSQL performance, and a hosted gateway distributes controlled database access to AI clients.

Is @modelcontextprotocol/server-postgres deprecated?

The PostgreSQL reference server from the original Model Context Protocol servers repository is archived. The current official reference-server repository points archived implementations to a separate archive and distinguishes maintained reference servers from official provider servers and community projects.

The package established the familiar local pattern:

{
  "mcpServers": {
    "postgres": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-postgres",
        "postgresql://user:password@host:5432/database"
      ]
    }
  }
}

That configuration has three practical limitations for a new production workflow:

  1. The dependency is archived rather than actively developed as the current PostgreSQL solution.
  2. The database credential is distributed to every machine that runs the server.
  3. Revocation, user attribution, policy management, and centralized activity review must be built separately.

Do not replace the package blindly. First decide whether the new requirement is local SQL access, database tuning, provider management, multi-database support, or governed remote access. The correct replacement depends on that distinction.

The complete deprecated PostgreSQL MCP migration guide covers staged client changes, credential rotation, and post-migration ownership.

What should replace @modelcontextprotocol/server-postgres?

There is no official one-for-one successor. Use the migration path that matches the old server's actual job:

Existing useReplacement direction
Local schema inspection and SQLStart with DBHub or another maintained local PostgreSQL server
Query plans and index tuningUse Postgres MCP Pro
Supabase or Neon platform operationsUse the provider's official MCP server
Shared remote access to standard PostgreSQLUse a hosted endpoint such as datamcp's PostgreSQL MCP server
Full control over a remote deploymentSelf-host a maintained HTTP-capable server such as pgEdge Postgres MCP

Before migrating, create a dedicated PostgreSQL role, reproduce the old read-only boundary, and test a denied write. Changing packages without recreating the database grants can silently change the effective access level.

Postgres MCP Pro: crystaldba/postgres-mcp

Postgres MCP Pro is an open-source PostgreSQL MCP server focused on database performance and safe SQL execution.

Its strongest capabilities are not generic MCP transport features. They are PostgreSQL operations:

  • database health checks
  • workload and index analysis
  • query-plan inspection
  • hypothetical index testing
  • schema context for SQL generation
  • restricted read-only and unrestricted execution modes

This makes CrystalDBA the strongest option in this list when the primary question is “why is this query slow?” or “which index should we test?”

The server receives PostgreSQL connection information at startup and can run through stdio or SSE. Its own documentation notes the security and usability trade-offs of storing connection details in MCP client configuration. Teams must still decide how credentials are distributed, how each developer is identified, and where activity is reviewed.

Choose it when: a developer or DBA wants a local, specialized PostgreSQL performance assistant.

Look elsewhere when: the main requirement is a managed remote endpoint, per-user revocation, or centralized access policy across several AI clients.

DBHub: multi-database and token-efficient

DBHub supports PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite through one MCP server.

Its current design deliberately keeps the tool surface small:

  • execute_sql runs SQL with configured safety controls
  • search_objects discovers schemas, tables, columns, indexes, and procedures
  • custom parameterized SQL tools can be defined in configuration

DBHub supports multiple simultaneous connections, stdio and HTTP transports, SSH tunnels, TLS, read-only mode, row limits, and query timeouts.

Choose it when: one developer workflow spans several database engines or when a small MCP tool surface matters for context efficiency.

Look elsewhere when: the organization needs PostgreSQL-specific tuning, a provider management API, or a hosted multi-user permission and audit layer.

pgEdge Postgres MCP: broad self-hosted control

pgEdge Postgres MCP has grown beyond a minimal SQL wrapper. It supports PostgreSQL 14 and newer and provides:

  • local stdio and remote HTTP modes
  • read-only transactions by default
  • user and API-token authentication for remote deployments
  • TLS support
  • schema analysis, SQL execution, resources, prompts, and search tools
  • a web interface and natural-language client
  • PostgreSQL row-level and column-level security through configured database roles

The project explicitly warns that it exposes broad database schema and data access and is intended for trusted internal workflows rather than arbitrary public-facing users.

Choose it when: the team wants to operate a feature-rich PostgreSQL MCP server itself and is prepared to own deployment, credentials, updates, policy, and logs.

Look elsewhere when: avoiding MCP infrastructure and ongoing server operations is the reason for choosing a hosted product.

Supabase MCP: project tools beyond PostgreSQL

Supabase MCP is not merely a generic PostgreSQL server. It exposes Supabase project capabilities including database tools, migrations, logs, advisors, documentation, Edge Functions, development information, branching, and optional storage tools.

Three controls are especially important:

  • project_ref restricts the connection to one Supabase project
  • read_only=true disables mutating tools and runs SQL through a read-only PostgreSQL user
  • features limits which tool groups are visible

Supabase recommends project scoping and read-only mode by default, and advises against connecting the server to production data unless the risk is understood and controlled.

Choose it when: the agent needs to operate the Supabase platform and development workflow.

Look elsewhere when: the source is standard PostgreSQL on another provider or the requirement is to distribute individually governed links to users and clients.

If the goal is specifically connecting a Supabase PostgreSQL database through standard database credentials, use the Supabase MCP server decision page. The Supabase to Cursor MCP guide covers both setup paths in one editor.

Neon MCP: hosted Neon project and branch management

Neon MCP provides a hosted remote endpoint with OAuth, plus API-key and local setup options.

It can work with Neon projects, branches, schema, SQL, performance information, documentation, and migrations. Access can be narrowed with:

  • read-only OAuth scope or readonly=true
  • projectId for one Neon project
  • tool categories such as querying and schema

Its migration workflow separates preparation from completion and uses a temporary branch for testing before applying changes to the target branch.

Choose it when: the workflow includes Neon project or branch management in addition to querying PostgreSQL.

Look elsewhere when: the database is not on Neon or the team wants a provider-independent PostgreSQL access layer.

For a database-only workflow across Claude and Cursor, see the Neon PostgreSQL MCP setup guide. For the current hosted connector flow, use the Claude Desktop PostgreSQL MCP setup guide.

Full disclosure: datamcp is our product.

datamcp connects to PostgreSQL 12 or newer and publishes a hosted remote MCP endpoint. The database connection remains on the server side rather than being copied into every editor configuration.

The current PostgreSQL MCP surface includes six tools:

  • query
  • get_permissions
  • get_schema
  • get_table_details
  • get_schema_changes
  • resync_schema

Each MCP link can use read-only, read-write, full-access, or custom table-level operations. Effective access remains bounded by the connected PostgreSQL role: an MCP link cannot create a database privilege that the role does not have.

AI clients authenticate to datamcp with an API key or OAuth 2.0 with PKCE. PostgreSQL credentials are encrypted at rest with AES-256-GCM. Individual links can be deleted without rotating the database password used by every other client.

PostgreSQL query activity and denied operations are available for review. The visible activity page can be exported as CSV or JSON. datamcp does not provide CrystalDBA-style index tuning or a self-hosted edition; MySQL is covered separately in the MySQL MCP comparison.

Current public plans are:

  • Free: 1 source connection, 1 MCP link, 2 organization members, 7-day activity retention
  • Pro: $19/month, 3 source connections, 5 MCP links, 5 members, 30-day retention, custom table permissions
  • Enterprise: $49/month, 15 connections, 50 links, 25 members, and 365-day retention

Choose it when: several clients or people need separate, revocable access to standard PostgreSQL without receiving the database credential.

Look elsewhere when: the primary requirement is local-only operation, provider administration, multi-database support, or automated performance tuning.

To test the hosted path, create one PostgreSQL connection for free. For client-specific instructions, use the ChatGPT PostgreSQL guide or the Cursor PostgreSQL tutorial.

Local server, provider server, or hosted gateway?

The architecture matters more than the package name.

Choose a local MCP server when

  • one trusted developer controls the machine and database credential
  • the database is development or disposable
  • local latency and no hosted dependency matter most
  • the team is comfortable managing package updates and configuration

Choose a provider MCP server when

  • the workflow includes provider-specific projects, branches, logs, functions, or migrations
  • OAuth to the provider is preferable to distributing database credentials
  • the database will remain on that provider

Choose a hosted PostgreSQL gateway when

  • several AI clients or people need different access
  • database credentials should stay out of local MCP configuration
  • access must be revoked per link or client
  • table and operation permissions need to be managed independently
  • PostgreSQL query activity needs a central review surface

Read hosted vs local MCP servers for the complete deployment decision and the production MCP security checklist before exposing real data.

How to choose the best PostgreSQL MCP server

Use this sequence:

  1. Define the job. Querying, tuning, provider management, and access governance are different requirements.
  2. Classify the data. A disposable local database and a production customer database should not share the same default policy.
  3. Choose the backend role first. Create a dedicated PostgreSQL role with the minimum required grants.
  4. Decide where credentials may live. Local configuration is simple; server-side storage supports centralized distribution and revocation.
  5. Check the transport. Confirm the selected AI client supports the server's stdio, Streamable HTTP, or legacy SSE transport.
  6. Test denial. Verify that a forbidden write, table, or project is rejected before relying on “read-only” wording.
  7. Test revocation and logs. Remove one client and confirm both the denial and the evidence trail.

For a managed path, review the hosted PostgreSQL MCP server. For a local or self-hosted option, start with the official repository of the selected server, pin a version, use a restricted PostgreSQL role, and test the exact permission boundary before connecting production data.

PostgreSQL MCP server FAQ

What is the best Postgres MCP server?

Postgres MCP Pro is a strong choice for PostgreSQL tuning, DBHub for local multi-database access, Supabase or Neon MCP for provider-specific operations, pgEdge for broad self-hosted control, and datamcp for hosted PostgreSQL access with separate links, permissions, revocation, and PostgreSQL query activity.

Is npm @modelcontextprotocol/server-postgres deprecated?

The @modelcontextprotocol/server-postgres implementation is deprecated on npm and archived. Existing configurations may continue to reference it, but the migration process should preserve the old database role, read-only boundary, and denial behavior rather than only swapping the package name.

What replaced @modelcontextprotocol/server-postgres?

There is no single official drop-in replacement. The archived package covered basic read-only PostgreSQL access. Choose a replacement based on whether you need tuning, provider administration, multi-database support, self-hosted control, or a managed remote endpoint.

Which PostgreSQL MCP server is best for production?

“Production” is not one feature. Use a dedicated least-privilege PostgreSQL role, test denial behavior, protect credentials, define revocation, and retain enough activity evidence for the chosen risk level. A managed gateway reduces infrastructure work; a self-hosted server provides more deployment control but transfers operations to your team.

Which option is best for Supabase or Neon?

Use the provider's MCP server when the agent needs project, branch, migration, logs, or platform-management tools. Use a database-focused MCP server when the requirement is standard PostgreSQL schema and query access through database credentials.

Can PostgreSQL MCP access be read-only?

Yes, but verify the actual enforcement layer. Some servers use a read-only transaction or SQL parser, while others depend on the PostgreSQL role. For sensitive data, combine an MCP read-only policy with a dedicated PostgreSQL role that lacks write privileges.

PostgreSQLMCPCursorClaudedatabase tools

Want to test hosted PostgreSQL MCP?

Connect one PostgreSQL source and create one scoped MCP link on the Free plan.

Create PostgreSQL MCP link

Explore PostgreSQL MCP · Questions? Read the docs or view pricing.