7 Best Postgres MCP Servers in 2026 (Compared)
Compare Postgres MCP Pro, DBHub, pgEdge, Supabase, Neon, datamcp, and the archived @modelcontextprotocol/server-postgres package.
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:
- the job the server is designed to perform
- local, self-hosted, or managed deployment
- how PostgreSQL credentials reach the server
- available read-only or fine-grained controls
- team access, revocation, and activity evidence
- 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
| Server | Best for | Deployment | Access controls | PostgreSQL-specific depth |
|---|---|---|---|---|
@modelcontextprotocol/server-postgres | Understanding old configurations | Local stdio | Read-only reference behavior | Basic schema and queries |
| Postgres MCP Pro | Performance tuning and database health | Self-hosted stdio or SSE | Restricted or unrestricted SQL mode | High |
| DBHub | One local server for several database engines | Self-hosted stdio or HTTP | Read-only mode, row limit, timeout | Medium |
| pgEdge Postgres MCP | Broad self-hosted PostgreSQL access | Self-hosted stdio or HTTP | Read-only mode, user/token auth, TLS | High |
| Supabase MCP | Supabase development and management | Hosted remote MCP | Project scope, feature groups, read-only mode | Supabase-specific |
| Neon MCP | Neon projects, branches, and migrations | Hosted remote MCP or local setup | OAuth scopes, project scope, categories, read-only mode | Neon-specific |
| datamcp | Governed access to standard PostgreSQL | Hosted remote MCP | Per-link presets, custom table operations, OAuth or API key | PostgreSQL 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:
| Requirement | Best starting point | Why |
|---|---|---|
| PostgreSQL performance tuning | Postgres MCP Pro | Query plans, health checks, index analysis, and hypothetical indexes |
| Several database engines | DBHub | One compact tool surface across PostgreSQL and other supported engines |
| Broad self-hosted PostgreSQL control | pgEdge Postgres MCP | Local and remote modes with authentication and read-only controls |
| Supabase project administration | Supabase MCP | Supabase-specific project, migration, logs, and platform tools |
| Neon project and branch workflows | Neon MCP | Neon-specific branches, migrations, projects, and hosted OAuth |
| Hosted standard PostgreSQL access | datamcp | Server-side credentials, separate links, permissions, revocation, and PostgreSQL query activity |
| Understanding an old configuration | Archived reference package | Useful 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:
- The dependency is archived rather than actively developed as the current PostgreSQL solution.
- The database credential is distributed to every machine that runs the server.
- 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 use | Replacement direction |
|---|---|
| Local schema inspection and SQL | Start with DBHub or another maintained local PostgreSQL server |
| Query plans and index tuning | Use Postgres MCP Pro |
| Supabase or Neon platform operations | Use the provider's official MCP server |
| Shared remote access to standard PostgreSQL | Use a hosted endpoint such as datamcp's PostgreSQL MCP server |
| Full control over a remote deployment | Self-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_sqlruns SQL with configured safety controlssearch_objectsdiscovers 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
stdioand 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_refrestricts the connection to one Supabase projectread_only=truedisables mutating tools and runs SQL through a read-only PostgreSQL userfeatureslimits 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 projectIdfor 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.
datamcp: hosted PostgreSQL access with per-link policy
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:
queryget_permissionsget_schemaget_table_detailsget_schema_changesresync_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:
- Define the job. Querying, tuning, provider management, and access governance are different requirements.
- Classify the data. A disposable local database and a production customer database should not share the same default policy.
- Choose the backend role first. Create a dedicated PostgreSQL role with the minimum required grants.
- Decide where credentials may live. Local configuration is simple; server-side storage supports centralized distribution and revocation.
- Check the transport. Confirm the selected AI client supports the server's
stdio, Streamable HTTP, or legacy SSE transport. - Test denial. Verify that a forbidden write, table, or project is rejected before relying on “read-only” wording.
- 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.
Related articles
PostgreSQL Permissions for AI Tools: Least-Privilege Setup
Create a restricted PostgreSQL role for AI tools with table grants, default privileges, optional row security, timeouts, and denial tests.
TutorialHow to Connect ChatGPT to PostgreSQL with MCP
Connect ChatGPT to a PostgreSQL database through a remote MCP app. Includes current plan requirements, OAuth setup, permissions, testing, and troubleshooting.
Want to test hosted PostgreSQL MCP?
Connect one PostgreSQL source and create one scoped MCP link on the Free plan.
Create PostgreSQL MCP linkExplore PostgreSQL MCP · Questions? Read the docs or view pricing.