{
  "name": "io.github.crystaldba/postgres-mcp",
  "description": "Postgres MCP Pro is a community-maintained Postgres MCP that goes beyond read-only query execution. It adds EXPLAIN-plan analysis, index recommendations, schema-wide health checks, and write-mode toggles guarded by an explicit safe-mode setting. Designed for engineers who want a Postgres assistant that understands query performance, not just syntax.",
  "status": "active",
  "version": "latest",
  "_meta": {
    "com.top-mcps/lastVerified": "2026-05-06",
    "com.top-mcps/score": {
      "value": 74,
      "rubricVersion": "2026-04",
      "lastComputed": "2026-05-11T09:29:11.917Z",
      "methodology": "https://top-mcps.com/about/methodology"
    },
    "com.top-mcps/stats": {
      "fetchedAt": "2026-05-11T09:29:10.737Z",
      "githubStars": 2722,
      "lastCommitAt": "2026-01-22T16:24:36Z"
    }
  },
  "repository": {
    "url": "https://github.com/crystaldba/postgres-mcp",
    "source": "github"
  },
  "author": {
    "name": "Crystal DBA"
  },
  "packages": [
    {
      "registryType": "pypi",
      "registryBaseUrl": "https://pypi.org",
      "identifier": "postgres-mcp",
      "version": "latest",
      "transport": {
        "type": "stdio"
      },
      "environmentVariables": [
        {
          "name": "DATABASE_URI",
          "description": "DATABASE_URI — required credential for Postgres MCP Pro.",
          "isRequired": true,
          "isSecret": true
        }
      ]
    }
  ],
  "capabilities": {
    "tools": [
      {
        "name": "execute_sql",
        "description": "Run a SQL statement; behaviour depends on safe-mode and role privileges.",
        "sideEffect": "read",
        "args": [
          {
            "name": "sql",
            "type": "string",
            "required": true
          }
        ]
      },
      {
        "name": "explain_query",
        "description": "Return the query plan with cost estimates.",
        "sideEffect": "read",
        "args": [
          {
            "name": "sql",
            "type": "string",
            "required": true
          }
        ]
      },
      {
        "name": "analyze_workload",
        "description": "Surface slow queries and index opportunities from pg_stat_statements.",
        "sideEffect": "read"
      },
      {
        "name": "recommend_indexes",
        "description": "Suggest indexes for a given query or table workload, with estimated cost and benefit.",
        "sideEffect": "read",
        "args": [
          {
            "name": "sql",
            "type": "string",
            "required": false
          }
        ]
      },
      {
        "name": "check_health",
        "description": "Run a schema-wide health check (bloat, missing PKs, duplicate indexes, replication lag).",
        "sideEffect": "read"
      }
    ],
    "security": {
      "scope": "read-write",
      "sandbox": "Connects to a Postgres database via the connection string in DATABASE_URI. Write tools are guarded by a safe-mode flag — when disabled, the server only exposes read-and-EXPLAIN capabilities. Database-level role permissions are the final guard regardless of MCP-side toggles.",
      "gotchas": [
        "Safe-mode is a server-side flag, not a database-level constraint — pair it with a read-only DB role for defence-in-depth.",
        "EXPLAIN ANALYZE actually executes queries to gather timing data; on production, prefer plain EXPLAIN or run against a snapshot."
      ]
    }
  },
  "_links": {
    "html": "https://top-mcps.com/mcp/postgres-mcp-pro",
    "markdown": "https://top-mcps.com/mcp/postgres-mcp-pro.md",
    "methodology": "https://top-mcps.com/about/methodology"
  }
}
