Skip to main content
mcpSource-backed

Postgres MCP Pro

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.

by Crystal DBA · submitted by oktofeesh1·added 2026-06-06·
Review first review before installing

Open the source and read safety notes before installing.

Citation facts

Source-backed facts for citing this resource, derived directly from the registry — also available as plain text for AI assistants.

Source URLs
https://github.com/crystaldba/postgres-mcp/blob/main/README.md, https://github.com/crystaldba/postgres-mcp
Brand
Postgres MCP Pro
Brand domain
github.com
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.
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.

    Pending
  • Baseline comparison available

    No baseline peer selected yet.

    Pending
  • Diverging trust signals identified

    No major trust-signal divergence found.

    Pending

Setup at a glance

CLI install

Copy-ready — paste the snippet to get started.

15 minutes

Adoption plan

Balanced adoption plan

Current risk score 24/100. Use staged verification before broader rollout.

Risk 24

Pre-adoption checks

Validate source and review signals before any execution.

  • Confirm source provenanceRequired

    Source URL/provenance metadata is present.

    Done
  • Confirm metadata review state

    No review metadata found; increase manual validation.

    Pending
  • Verify install payload

    Install/config payload exists and can be inspected.

    Done

Security checks

Confirm safety, privacy, and package integrity signals.

  • Review safety notesRequired

    Safety notes are present.

    Done
  • Review privacy notesRequired

    Privacy notes are present.

    Done
  • Verify package integrity metadata

    No package verification/checksum metadata.

    Pending

Rollout

Adopt in controlled steps based on the selected plan.

  • Run in isolated sandbox firstRequired

    Use a constrained sandbox and observe behavior across multiple tasks.

    Pending
  • Roll out graduallyRequired

    Roll out to a small cohort before wider usage.

    Pending
  • Set monitoring and fallback

    Define rollback path and monitor errors after adoption.

    Pending

Evidence readiness

Evidence readiness matrix · balanced

Missing required evidence: Metadata review. Risk score 31.

Risk 31

Source provenance

Present

Source repository/provenance is listed.

Required in this preset

Metadata review

Missing

Review metadata is missing.

Required in this preset

Safety notes

Present

Safety notes are present.

Required in this preset

Privacy notes

Present

Privacy notes are present.

Optional in this preset

Package integrity

Missing

Package integrity metadata is missing.

Optional in this preset

Install payload

Present

Install payload is available.

Required in this preset

Required gaps: Metadata review

Decision timeline

Decision timeline · balanced

Blocking gaps: Check metadata review status. Risk 28.

Risk 28

triage

Confirm source provenanceRequired

Source/provenance metadata is available.

Done

triage

Check metadata review statusRequired

Review metadata is missing.

Pending

verify

Review safety notesRequired

Safety notes are available.

Done

verify

Review privacy notes

Privacy notes are available.

Done

verify

Validate package integrity metadata

Package integrity metadata is missing.

Pending

rollout

Verify install payload and commandsRequired

Install payload is available.

Done

Blockers: Check metadata review status

Prerequisite readiness

Prerequisite readiness

6 prerequisites to line up before setup. Includes a review or approval gate.

0/6 ready
Install & runtime1Configuration1Permissions & scopes1Review & approval1General215 minutes

Safety & privacy surface

Safety & privacy surface

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.

Schema details

Install type
cli
Troubleshooting
No
Source repository stats
Scope
Source repo
Collection metadata
Estimated setup
15 minutes
Difficulty
advanced
Full copyable content
{
  "mcpServers": {
    "postgres-pro": {
      "command": "uvx",
      "args": ["postgres-mcp", "--access-mode=restricted"],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}

About this resource

Content

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.

Source Review

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:

{
  "mcpServers": {
    "postgres-pro": {
      "command": "uvx",
      "args": ["postgres-mcp", "--access-mode=restricted"],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}

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.

Source citations

Add this badge to your README

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.

Listed on HeyClaude
[![Listed on HeyClaude](https://heyclau.de/badge/mcp/postgres-mcp-pro.svg)](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).

Field

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.

Open dossier

Official MCP server providing read-only access to PostgreSQL databases with schema inspection and query capabilities

Open dossier

Token-efficient database MCP server for PostgreSQL, MySQL, MariaDB, SQL Server, and SQLite.

Open dossier

SQLAlchemy-backed MCP server for exploring relational databases, inspecting schemas and relationships, and executing SQL queries from Claude.

Open dossier
Next steps
Trust
Review statusNot reviewedNot reviewedNot reviewedNot reviewed
Package trustDiffersPackage not verifiedPackage verifiedPackage not verifiedPackage not verified
Source provenanceDiffersSource-backedNo submission linkSource-backedSource-backed
SubmitterDiffersoktofeesh1oktofeesh1oktofeesh1
Install riskReview firstReview firstReview firstReview first
Notes Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓ Safety ✓ Privacy ✓
BrandAnthropic logoAnthropicDBHub logoDBHub
Categorymcpmcpmcpmcp
SourceSource-backedFirst-partySource-backedSource-backed
AuthorCrystal DBAAnthropicBytebaseRune Kaagaard
Added2026-06-062025-09-162026-06-052026-06-06
Platforms
Harness
Source repo
Safety notesPostgres 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 notesConnection 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.
Install
uvx postgres-mcp --access-mode=restricted
claude mcp list && claude mcp status postgres
npx @bytebase/dbhub@latest --transport stdio --dsn YOUR_DATABASE_DSN
uvx --from mcp-alchemy mcp-alchemy
Config
Manual-only setup:
claude mcp add postgres-pro \
  --env DATABASE_URI=postgresql://username:password@localhost:5432/dbname \
  -- uvx postgres-mcp --access-mode=restricted
Manual-only setup:
{
  "postgres": {
    "args": [
      "-y",
      "@modelcontextprotocol/server-postgres",
      "postgresql://localhost/mydb"
    ],
    "command": "npx"
  }
}
{
  "mcpServers": {
    "dbhub": {
      "command": "npx",
      "args": [
        "@bytebase/dbhub@latest",
        "--transport",
        "stdio",
        "--dsn",
        "YOUR_DATABASE_DSN"
      ]
    }
  }
}
{
  "mcpServers": {
    "mcp-alchemy": {
      "command": "uvx",
      "args": ["--from", "mcp-alchemy", "mcp-alchemy"],
      "env": {
        "DB_URL": "<sqlalchemy-database-url>",
        "EXECUTE_QUERY_MAX_CHARS": "4000"
      }
    }
  }
}
Citations
ClaimUnclaimedUnclaimedUnclaimedUnclaimed
Open 4 picks in the interactive comparison tool

Related guides

Signals

Loading live community signals…

More like this, weekly

A short, calm digest of reviewed Claude resources. Unsubscribe any time.