PostgreSQL MCP server with explicit database targeting, supporting read-only, operator, and admin modes with mutation policy controls.
mcp-postgres provides 11 tools with consistent naming (verb_noun pattern: list_, get_, describe_, sample_, query, count_, exec_) and complete input schemas. All tools have descriptions (avg 95 chars, within 10-1024 range). However, descriptions are generic and lack LLM-optimized guidance on WHEN to use each tool vs alternatives. Parameter descriptions are present but minimal (avg 35 chars). No output schemas documented, critical for agents planning downstream calls. Error handling is absent from visible definitions. Security risk: exec_admin and exec_dml accept arbitrary SQL, requiring confirmation tokens but lacking injection guidance or rate-limiting documentation.
Count rows in a PostgreSQL table with optional simple equality filters.
Describe a PostgreSQL table including columns, indexes, and constraints.
Execute a single administrative SQL statement. Destructive and privilege-changing operations require a confirmation token.
Execute a single INSERT, UPDATE, DELETE, or MERGE statement under mutation policy controls.
Return bootstrap PostgreSQL connection health and instance details.
Return in-process runtime metrics, pooled connection stats, and idle cleanup state.
No output schemas documented. Agents cannot plan downstream tool calls or extract required fields (e.g., does list_tables return table_id, schema_id for chaining?). Violates pattern:tool and mxe:include-chaining-ids.
exec_dml and exec_admin accept arbitrary SQL strings with no injection guidance, sanitization hints, or rate-limiting documentation. Agents can be tricked via prompt injection into malicious queries. Violates pattern:tool-gateway and pattern:secret-injection.
Descriptions lack LLM-optimized guidance on WHEN to use each tool. E.g., sample_table vs query, when should an agent pick one over the other? Descriptions are factual but not decision-guiding. Violates pattern:tool-description.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 59 | <=2025-11-25 | v2 |
List visible PostgreSQL databases in the instance.
List schemas in a PostgreSQL database.
List tables and views in a PostgreSQL database, optionally filtered by schema.
Execute a single read-only SQL statement with row truncation and timeout controls.
Return a safe sample of rows from a PostgreSQL table.
Parameter descriptions are minimal (avg 35 chars). E.g., 'The database name' does not explain format, constraints, or how to discover valid database names. Violates pattern:tool-description baseline (72 chars avg).
No error handling guidance. Tools return errors but descriptions do not explain recovery paths (e.g., 'If query times out, reduce maxRows or increase timeoutMs'). Violates pattern:recovery-guide.