PostgreSQL MCP server from Crystal DBA for schema inspection, SQL execution, EXPLAIN plans, index tuning, top-query analysis, and database health checks with configurable restricted or unrestricted access.
Postgres MCP Pro supports unrestricted mode, which can execute read/write SQL and modify data or schema; use it only against disposable development databases or after explicit approval., Restricted mode is the safer default, but it still allows database inspection, query execution through guarded paths, EXPLAIN analysis, health checks, and potentially expensive read workloads., EXPLAIN ANALYZE can execute a query to collect real runtime statistics, so review queries before using analyze mode on production data., Index tuning and health checks can depend on pg_stat_statements, hypopg, catalog access, and workload statistics; verify extension permissions and expected database load first., SSE or Streamable HTTP transports can expose database tooling beyond a local stdio process; bind carefully and add network controls before remote use.
Privacy notes
Connection URIs contain credentials and should be provided through MCP client environment handling, secrets management, or local configuration that is not committed to source control., Schema names, table names, index definitions, query text, EXPLAIN plans, health findings, and top-query statistics can reveal application architecture, customer data models, usage patterns, and sensitive SQL., SQL results may contain regulated or customer data; use least-privilege roles, row-level access controls, redaction, and approval gates before connecting an agent to non-development databases.
Author
Crystal DBA
Submitted by
oktofeesh1
Claim status
unclaimed
Last verified
2026-06-06
Decision playbook
Review trust signals before you adopt
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
Compare context
Selected
0
Current score
63
Baseline
—
Delta
No baseline selected
No major trust-signal divergence detected in the current selection.
Source and provenance checks
Needs review
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Done
Source provenance statusRequired
Marked as source-backed.
Done
Metadata reviewed
No reviewed flag detected in metadata.
Pending
Safety and privacy checks
Complete
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Done
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Done
Trust level risk gateRequired
Trust level does not block evaluation.
Done
Package and install checks
Needs review
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Done
Package verification flag
No package verification flag provided.
Pending
Checksum metadata
No checksum provided for downloaded artifact.
Pending
Compare-driven decision checks
Needs review
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
5 safety and 3 privacy notes across 6 risk areas. Review closely: credentials & tokens, permissions & scopes, network access.
6 areas
SafetyExecution & processesPostgres MCP Pro supports unrestricted mode, which can execute read/write SQL and modify data or schema; use it only against disposable development databases or after explicit approval.
SafetyLocal filesRestricted mode is the safer default, but it still allows database inspection, query execution through guarded paths, EXPLAIN analysis, health checks, and potentially expensive read workloads.
SafetyExecution & processesEXPLAIN ANALYZE can execute a query to collect real runtime statistics, so review queries before using analyze mode on production data.
SafetyPermissions & scopesIndex tuning and health checks can depend on pg_stat_statements, hypopg, catalog access, and workload statistics; verify extension permissions and expected database load first.
SafetyNetwork accessSSE or Streamable HTTP transports can expose database tooling beyond a local stdio process; bind carefully and add network controls before remote use.
PrivacyCredentials & tokensConnection URIs contain credentials and should be provided through MCP client environment handling, secrets management, or local configuration that is not committed to source control.
PrivacyGeneralSchema names, table names, index definitions, query text, EXPLAIN plans, health findings, and top-query statistics can reveal application architecture, customer data models, usage patterns, and sensitive SQL.
PrivacyPermissions & scopesSQL results may contain regulated or customer data; use least-privilege roles, row-level access controls, redaction, and approval gates before connecting an agent to non-development databases.
Safety notes
Postgres MCP Pro supports unrestricted mode, which can execute read/write SQL and modify data or schema; use it only against disposable development databases or after explicit approval.
Restricted mode is the safer default, but it still allows database inspection, query execution through guarded paths, EXPLAIN analysis, health checks, and potentially expensive read workloads.
EXPLAIN ANALYZE can execute a query to collect real runtime statistics, so review queries before using analyze mode on production data.
Index tuning and health checks can depend on pg_stat_statements, hypopg, catalog access, and workload statistics; verify extension permissions and expected database load first.
SSE or Streamable HTTP transports can expose database tooling beyond a local stdio process; bind carefully and add network controls before remote use.
Privacy notes
Connection URIs contain credentials and should be provided through MCP client environment handling, secrets management, or local configuration that is not committed to source control.
Schema names, table names, index definitions, query text, EXPLAIN plans, health findings, and top-query statistics can reveal application architecture, customer data models, usage patterns, and sensitive SQL.
SQL results may contain regulated or customer data; use least-privilege roles, row-level access controls, redaction, and approval gates before connecting an agent to non-development databases.
Prerequisites
PostgreSQL database connection URI for the database Claude should inspect.
A database role scoped to the minimum permissions needed for the intended environment.
Python 3.12 or higher with uvx, uv, pipx, or Docker available to run the server.
Optional pg_stat_statements extension for workload and top-query analysis.
Optional hypopg extension for hypothetical index simulation.
Backup, restore, and human-approval process before allowing write-capable database access.
Postgres MCP Pro is a PostgreSQL MCP server from Crystal DBA for database
inspection, SQL execution, query-plan analysis, index tuning, and health checks.
It connects Claude to a PostgreSQL database over stdio, SSE, or Streamable HTTP
and exposes tools for schema exploration, EXPLAIN plans, slow-query analysis,
workload index recommendations, and health checks.
Use it when a Postgres-backed project needs more than a simple read-only query
wrapper. It is especially useful for development and DBA workflows where Claude
needs schema context, query plans, workload statistics, index recommendations,
and repeatable health checks before proposing code or migration changes.
These sources were reviewed on 2026-06-06. Prefer the live repository,
README, PyPI package page, license, package manifest, MCP server implementation,
safe SQL driver, EXPLAIN tool documentation, database health implementation,
and index tuning implementation for current installation and behavior details.
Features
List schemas and schema objects.
Inspect table, view, sequence, extension, column, constraint, and index
details.
Execute SQL with different behavior in unrestricted and restricted modes.
Explain queries, optionally with real execution statistics or hypothetical
indexes.
Report top queries from pg_stat_statements.
Analyze workload or specific queries for index recommendations.
Run database health checks for indexes, connections, vacuum, sequences,
replication, buffer cache, and constraints.
Run over stdio for local MCP clients or over SSE and Streamable HTTP for
shared server setups.
Installation
Run with uvx and a scoped PostgreSQL connection string:
The upstream README also documents Docker, pipx, uv, SSE, and Streamable HTTP
setups. Use restricted mode for production-like databases and reserve
unrestricted mode for approved development databases where write access is
acceptable.
Use Cases
Ask Claude to inspect a Postgres schema before generating SQL or ORM code.
Explain a slow query and compare plans before and after hypothetical indexes.
Analyze top queries from pg_stat_statements.
Generate index recommendations for a specific query list or workload.
Check database health for invalid or duplicate indexes, connection pressure,
vacuum risk, sequence exhaustion, replication lag, buffer cache issues, and
invalid constraints.
Let an agent ground migration or performance work in actual database metadata
while keeping human review on destructive changes.
Safety and Privacy
Treat Postgres MCP Pro as direct database access. Unrestricted mode can modify
data or schema, so use restricted mode by default, use least-privilege database
roles, and keep a human approval gate before destructive or production-impacting
work.
Even restricted database access can expose sensitive schema, query, and result
data to the MCP client, model provider, logs, and chat transcripts. Avoid
connecting agents to production databases unless access controls, redaction,
audit logging, and data-handling approvals are already in place.
EXPLAIN, health, and index-analysis tools can create load or rely on privileged
extensions. Verify the database role, extension permissions, query timeout, and
expected workload impact before running analysis against shared databases.
Duplicate Check
Existing entries cover the official read-only PostgreSQL MCP server,
Timescale's pg-aiguide documentation server, generic database servers such as
MCP Toolbox and DBHub, and managed Postgres platforms such as Neon and
Supabase. Postgres MCP Pro is distinct because it combines PostgreSQL schema
inspection, configurable restricted or unrestricted SQL execution, EXPLAIN
plans, workload index recommendations, top-query analysis, and database health
checks from crystaldba/postgres-mcp. No crystaldba/postgres-mcp entry or
matching source URL was found in content/mcp.
Show that Postgres MCP Pro is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/mcp/postgres-mcp-pro)
How it compares
Postgres MCP Pro side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
3 trust signals differ across this comparison (Package trust, Source provenance, Submitter).
PostgreSQL MCP server from Crystal DBA for schema inspection, SQL execution, EXPLAIN plans, index tuning, top-query analysis, and database health checks with configurable restricted or unrestricted access.
✓Postgres MCP Pro supports unrestricted mode, which can execute read/write SQL and modify data or schema; use it only against disposable development databases or after explicit approval.
Restricted mode is the safer default, but it still allows database inspection, query execution through guarded paths, EXPLAIN analysis, health checks, and potentially expensive read workloads.
EXPLAIN ANALYZE can execute a query to collect real runtime statistics, so review queries before using analyze mode on production data.
Index tuning and health checks can depend on pg_stat_statements, hypopg, catalog access, and workload statistics; verify extension permissions and expected database load first.
SSE or Streamable HTTP transports can expose database tooling beyond a local stdio process; bind carefully and add network controls before remote use.
✓Use a read-only database user with restricted schemas unless write access is explicitly needed and reviewed.
✓DBHub can execute SQL queries against configured databases.
SQL execution can read, create, update, delete, or otherwise modify data depending on database permissions and requested queries.
Configure read-only mode, row limits, query timeouts, least-privilege credentials, and human review before using DBHub with production or sensitive databases.
Custom tools can wrap reusable parameterized SQL, so review their definitions before allowing agents to call them.
✓MCP Alchemy exposes database table discovery, schema inspection, relationship mapping, and SQL execution.
The execute_query tool can run arbitrary SQL text against the configured SQLAlchemy database.
The source creates SQLAlchemy connections with AUTOCOMMIT, so successful write, DDL, or administrative statements can commit immediately.
The server does not enforce read-only SQL; use database permissions, read-only users, and human review to constrain writes.
Query results are truncated by EXECUTE_QUERY_MAX_CHARS unless Claude Local Files output is configured.
When CLAUDE_LOCAL_FILES_PATH is set, full result sets can be written to local files for artifact access.
Privacy notes
✓Connection URIs contain credentials and should be provided through MCP client environment handling, secrets management, or local configuration that is not committed to source control.
Schema names, table names, index definitions, query text, EXPLAIN plans, health findings, and top-query statistics can reveal application architecture, customer data models, usage patterns, and sensitive SQL.
SQL results may contain regulated or customer data; use least-privilege roles, row-level access controls, redaction, and approval gates before connecting an agent to non-development databases.
✓Queried schemas, table names, rows, connection details, and application data may be exposed through tool calls.
✓Database connection strings, hostnames, schemas, table names, column names, row data, query text, query results, traces, and errors may be visible to the MCP client and model provider.
Databases can contain personal data, customer records, credentials, business metrics, audit logs, payment data, healthcare data, and proprietary operational state.
Avoid exposing production databases or regulated data unless the database, MCP client, and model session are approved for that access.
✓DB_URL can contain database hostnames, usernames, passwords, database names, driver names, and connection options.
Schemas, table names, column names, foreign keys, SQL text, query results, errors, row counts, and generated local result files may be visible to the MCP client and model provider.
SQLAlchemy-compatible databases can contain customer records, credentials, analytics, payment data, healthcare data, source-code metadata, or other regulated information.
DB_URL, DB_ENGINE_OPTIONS, CLAUDE_LOCAL_FILES_PATH, result files, and database credentials should stay out of prompts, issues, logs, screenshots, and committed files.
Prerequisites
PostgreSQL database connection URI for the database Claude should inspect.
A database role scoped to the minimum permissions needed for the intended environment.
Python 3.12 or higher with uvx, uv, pipx, or Docker available to run the server.
Optional pg_stat_statements extension for workload and top-query analysis.
PostgreSQL database (local or remote PostgreSQL server)
PostgreSQL connection string (PostgreSQL connection URI with user, password, host, port, and database format)
Node.js and npx (for running @modelcontextprotocol/server-postgres package)
Network access (if connecting to remote PostgreSQL server)
Node.js and npx available to the MCP client runtime.
A PostgreSQL, MySQL, MariaDB, SQL Server, or SQLite database connection.
Database credentials with the minimum privileges needed for the workflow.
Read-only permissions or DBHub guardrails configured before connecting production data.
Python 3.10 and uvx available to the MCP client runtime.
SQLAlchemy-compatible database URL for an approved database.
Database driver selected with uvx `--with` when the target database requires one.
Least-privilege database user with only the schemas and operations Claude should access.