M

MCP Postgres Insight

by RatulSikder97 · RatulSikder97/mcp-postgres-insight

Enables AI agents to explore PostgreSQL schemas, sample PII-redacted rows, run AST-guarded read-only queries, and diagnose slow statements with EXPLAIN-driven index suggestions. All access is confined to allowlisted schemas inside a read-only, timeout-bounded session with output marked as untrusted data.

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
LOG_LEVEL No pino log level. Logs go to stderr as JSON. Default: info
PG_POOL_MAX No Connection pool size. Default: 4
DATABASE_URL Yes PostgreSQL connection string. Required.
MCP_HTTP_HOST No HTTP bind address. Default: 127.0.0.1
MCP_HTTP_PORT No HTTP bind port. Default: 3333
MCP_TRANSPORT No Transport mode: stdio or http. Default: stdio
REDACT_VALUES No Mask e-mails, Luhn-valid card numbers and SSNs inside text and JSON values. Default: true
MAX_CELL_CHARS No Longer text and JSON cells are truncated with a marker. Default: 512
MAX_SQL_LENGTH No Maximum SQL length accepted. Default: 20000
QUERY_MAX_ROWS No Upper bound for run_readonly_query.max_rows. Default: 200
REDACT_COLUMNS No Case-insensitive regex matched against column names for PII redaction.
SAMPLE_MAX_ROWS No Upper bound for sample_rows.limit. Default: 50
PG_ALLOWED_SCHEMAS No Comma-separated schemas visible to the agent. pg_catalog and information_schema cannot be allowlisted. Default: public
MCP_HTTP_AUTH_TOKEN No Bearer token, 32 or more characters. Required when MCP_HTTP_HOST is not loopback.
STATEMENT_TIMEOUT_MS No statement_timeout and lock_timeout for every transaction, in milliseconds. Default: 5000
ALLOW_EXPLAIN_ANALYZE No Set to false to forbid explain_query(analyze=true), which executes the query. Default: true
MCP_HTTP_ALLOWED_HOSTS No Extra Host header values accepted by DNS-rebinding protection.
SEQ_SCAN_ROW_THRESHOLD No Row count at which a table counts as large in plan hints. Default: 10000

Similar servers