M

MCP Postgres Guard

by seotarek · seotarek/MCP Postgres Guard

Enables AI agents to safely query PostgreSQL by intercepting and auditing every generated SQL statement before it reaches the database, blocking destructive commands like DROP/TRUNCATE, unbounded DELETE/UPDATE statements, stacked queries, and SQL injection probes. It exposes tools for validating query safety and enforcing a strict read-only (SELECT/EXPLAIN) policy.

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
MAX_ROWS No Read result cap. Default: 200
DATABASE_URL Yes Required. PostgreSQL connection URL.
AUDIT_LOG_PATH No JSONL audit file path. Default: (stderr)
MASKED_COLUMNS No Columns to mask, e.g., 'ssn' or 'customers.email'. Default: (none)
WRITES_ENABLED No Master switch for mutations. Default: false
ALLOWED_SCHEMAS No Schemas visible at all. Default: public
READABLE_TABLES No Readable tables; empty means every table in the allowed schemas. Default: (all)
WRITABLE_TABLES No Writable tables; writes are opt-in. Default: (none)
REQUIRE_APPROVAL No Human confirmation per write. Default: true
MAX_MUTATION_ROWS No Refuse a mutation above this blast radius. Default: 100
MAX_CALLS_PER_MINUTE No Bounds an agent stuck in a retry loop. Default: 60
STATEMENT_TIMEOUT_MS No Server-enforced statement timeout in ms. Default: 10000

Similar servers