G

Guarded Postgres MCP

by raphaeljordao86 · raphaeljordao86/guarded-postgres-mcp

Enables AI agents to investigate a legacy ERP's PostgreSQL database through read-only queries, apply writes and multi-statement atomic transactions behind static and in-transaction guardrails, and snapshot tables before destructive changes. Row limits, sequence-integrity checks, and optional JSON audit logging keep every call bounded, reversible, and traceable.

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
PG_HOST Yes PostgreSQL host for connection settings.
PG_PORT No PostgreSQL port for connection settings. Default: 5432
PG_USER Yes PostgreSQL user for connection settings.
PG_DATABASE Yes PostgreSQL database name for connection settings.
PG_PASSWORD Yes PostgreSQL password for connection settings.
GUARD_ENV_FILE No Loads another env file (for example a staging database) without touching the production one. The server refuses to start if the file does not exist, rather than falling back to whatever PG_* the client has. Default: .env
GUARD_MAX_ROWS No Rows a single write statement may change without i_understand: true. Default: 1000
GUARD_BLOCK_DROP No Only the literal false disables it. Default: true
PG_LOCK_TIMEOUT_MS No An ALTER TABLE waiting on a lock would queue every ERP session behind it. Default: 5000
PG_APPLICATION_NAME No How the agent's sessions show up in pg_stat_activity. Default: guarded-postgres-mcp
GUARD_AUDIT_LOG_PATH No Absolute path of the JSONL audit log. Parent directories are created. Default: unset, no audit.
GUARD_QUERY_MAX_ROWS No Rows query returns. Default: 1000
GUARD_BLOCK_MANUAL_PK No Only the literal false disables it. Default: true
PG_CONNECT_TIMEOUT_MS No Gives up connecting instead of hanging when the database is down. Default: 10000
PG_STATEMENT_TIMEOUT_MS No Server-side statement timeout (0 disables it). Default: 120000
GUARD_LEGACY_TABLE_PREFIX No Legacy sequence convention: table prefix. With either one empty, only serial / identity defaults are detected.
GUARD_LEGACY_SEQUENCE_PREFIX No Legacy sequence convention: sequence prefix. With either one empty, only serial / identity defaults are detected.
GUARD_BLOCK_DML_WITHOUT_WHERE No Only the literal false disables it. Default: true
PG_IDLE_IN_TRANSACTION_TIMEOUT_MS No PostgreSQL 9.6+. Set 0 on older servers, which reject the parameter at connection time. Default: 60000

Similar servers