P

Postgres Readonly MCP

by tboon0 · tboon0/postgres-readonly-mcp

Enables local coding agents to safely inspect and query PostgreSQL databases — listing schemas, tables, and columns and running capped SELECT statements across multiple configured environments — while the server itself holds the database credential so the LLM never sees it.

Unknown transport Glama Low confidence
Note

Install

No install method is published for this server: no package and no remote endpoint. Check its source repository or registry listing for setup instructions.

Configuration

Environment variables this server reads. Secrets stay on your machine.

NameRequiredDescription
PGHOST No Database host.
PGPORT No Database port (default 5432). Default: 5432
PGUSER No Database user.
PGSSLMODE No TLS mode: disable | require | verify-full. Defaults to disable. Default: disable
PGDATABASE No Database name.
PGPASSWORD No Database password.
DATABASE_URL No A single postgres://user:password@host:port/db connection string. Takes precedence over discrete fields.
DB_DEFAULT_ENV No Which environment a tool call uses when it doesn't pass env explicitly. Required if more than one environment is configured and you want an implicit default.
DB_ENVIRONMENTS No Comma-separated list of environment names for multiple databases. When set, per-environment variables DB_ENV_<NAME>_URL or DB_ENV_<NAME>_HOST/_PORT/_DATABASE/_USER/_PASSWORD/_SSLMODE must be provided for each environment.
DB_MCP_LOG_LEVEL No Diagnostic log verbosity: debug | info | warn | error (default info). Default: info
PG_MAX_ROW_LIMIT No Maximum rows returned by run_query (default 500). Default: 500
PG_MAX_CELL_LENGTH No Long text/jsonb cell values are truncated to this many characters (default 2000). Default: 2000
PG_DEFAULT_ROW_LIMIT No Default rows returned by run_query (default 100). Default: 100
PG_CONNECT_TIMEOUT_MS No Client-side connection timeout in milliseconds (default 10000). Default: 10000
PG_STATEMENT_TIMEOUT_MS No Server-side statement timeout in milliseconds (default 15000). Default: 15000

Similar servers