Back to MCP Directory
Postgres
Model Context Protocol moderate risk

Postgres

Postgres MCP Pro provides AI agents with database health checks, index tuning, query plan analysis, and safe SQL execution via the Model Context Protocol.

Connections & Capabilities

Connects To

GitHubPostgreSQLSupabaseDiscordDockerFilesystemAWSGCPAzure

Capabilities

readwriteexecadmin

Quickstart

Config

{
  "mcpServers": {
    "postgres": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "DATABASE_URI",
        "crystaldba/postgres-mcp",
        "--access-mode=unrestricted"
      ],
      "env": {
        "DATABASE_URI": "postgresql://username:password@localhost:5432/dbname"
      }
    }
  }
}

Exposed MCP Tools (5)

safe
database_health_check

Analyzes database health, including index health, connection utilization, and replication lag.

Read-only access to database statistics.

high
index_tuning

Explores index options to optimize database performance.

Can modify database schema by creating new indexes.

safe
query_plan_analysis

Reviews EXPLAIN plans to validate and optimize query performance.

Read-only access to query execution plans.

high
safe_sql_execution

Executes SQL queries with configurable access control.

Can modify data or schema depending on access mode.

safe
schema_intelligence

Provides context-aware SQL generation based on the database schema.

Read-only access to database schema information.

Safety Assessment

Postgres MCP Pro offers configurable access controls, but unrestricted mode carries significant risks. It's safe for development with proper access controls. Production use requires restricted mode and careful monitoring to prevent unintended data modifications or performance impacts.

  • Configurable access control (unrestricted/restricted modes)
  • Safe SQL parsing
  • Read-only mode available
  • Can be used in development and production environments
  • Supports the Model Context Protocol (MCP)
  • Unrestricted mode allows full read/write access, posing a risk of unintended modifications.
  • Requires careful configuration of access mode to prevent misuse.
  • Potential for SQL injection if safe SQL parsing is not properly implemented or bypassed.
  • Exposure of database credentials in configuration files if not handled securely.
  • Index tuning and schema modifications can impact database stability if not carefully evaluated.
Postgres Review, Pricing & Alternatives (2026) | Flaex AI