← Back to Plugins
MCP Server MCP

PostgreSQL (hardened, read-only)

github By github 👁 1 views ▲ 0 votes

Read-only PostgreSQL over MCP. Writes refused at the parsed SQL, plus a READ ONLY transaction.

Homepage Verified source GitHub

Install

npx -y [email protected]

Configuration Example

{
  "remotes": [],
  "packages": [
    {
      "registryType": "npm",
      "identifier": "postgres-mcp-hardened",
      "version": "0.1.9",
      "runtimeHint": "npx",
      "transport": {
        "type": "stdio"
      },
      "runtimeArguments": [
        {
          "isRequired": true,
          "value": "--stdio",
          "type": "positional"
        }
      ],
      "environmentVariables": [
        {
          "description": "Connection string for the role the server connects as. Use a role that cannot write — the server refuses writes twice, but a read-only role is the layer that does not depend on us being correct. `--print-setup-sql` prints the SQL that creates one.",
          "isRequired": true,
          "isSecret": true,
          "name": "DATABASE_URL"
        },
        {
          "description": "Server-side statement timeout, e.g. `5s`. A question that would pin the database is cancelled by PostgreSQL, not by hope.",
          "name": "MCP_STATEMENT_TIMEOUT"
        },
        {
          "description": "Comma-separated allowlist. A table off the list is refused by name, and hiding it inside a CTE, a view or a join does not help.",
          "name": "MCP_ALLOW_TABLES"
        },
        {
          "description": "Path to the tamper-evident audit log. Entries are chained by hash and survive a restart; `--verify-audit` checks the chain against an off-host anchor.",
          "name": "MCP_AUDIT_LOG"
        }
      ]
    },
    {
      "registryType": "oci",
      "identifier": "ghcr.io/eszetael/postgres-mcp-hardened:0.1.9",
      "transport": {
        "type": "streamable-http",
        "url": "http://localhost:8080/mcp"
      },
      "environmentVariables": [
        {
          "description": "Connection string for a role that cannot write.",
          "isRequired": true,
          "isSecret": true,
          "name": "DATABASE_URL"
        },
        {
          "description": "Address to bind, default 127.0.0.1:8080.",
          "name": "MCP_ADDR"
        }
      ]
    }
  ]
}
mcp model-context-protocol npm oci

Comments

Sign in to leave a comment

Loading comments...