MCP server for read-only PostgreSQL queries
Listed on its own since 2026-09-25. Until then it was part of mcp-email-sender, where its earlier checks remain.
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"mcp-pgsql-query","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# mcp-pgsql-query MCP server for read-only PostgreSQL queries. Only SELECT statements are allowed — all other operations are rejected at the SQL validation layer. ## Features - SELECT-only enforcement (INSERT/UPDATE/DELETE/DDL/COPY all blocked) - AST-level SQL analysis via `sqlglot` to catch injection and embedded write operations - Blocks dangerous functions: `pg_read_file`, `pg_write_file`, `lo_export`, `dblink`, etc. - Stacked statement prevention (`;` separated statements) - Returns results as JSON with column names, rows, and truncation indicator ## Configuration Set these environment variables: | Variable | Description | Default | |---|---|---| | `PG_HOST` | PostgreSQL hostname | `localhost` | | `PG_PORT` | Port | `5432` | | `PG_DATABASE` | Database name | | | `PG_USERNAME` | Login username | | | `PG_PASSWORD` | Login password | | ## Claude Desktop configuration ```json { "mcpServers": { "pgsql": { "command": "uvx", "args": ["mcp-pgsql-query@latest"], "env": { "PG_HOST": "your-server", "PG_DATABASE": "your-db", "PG_USERNAME": "your-user", "PG_PASSWORD": "your-password" } } } } ``` ## Tool ### `query_pgsql` Run a read-only SELECT query against the configured PostgreSQL database. **Parameters:** - `sql` (required) — PostgreSQL SELECT statement - `max_rows` (optional) — Maximum rows to return, default 100, max 1000
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.