PostgreSQL MCP server — expose pg operations to AI agents
Server has 6 tools with basic schemas and descriptions, but significant gaps prevent production use. All tools accept a 'dsn' parameter (database connection string) as a required input, this violates secret-injection patterns and forces agents to manage credentials. Descriptions are present but generic (10-50 chars), below the 50-200 char baseline for LLM optimization. No parameter descriptions beyond the dsn/sql/schema/table names. Output schemas are not documented, agents cannot predict response structure. Error handling is absent; no recovery guidance or categorization. No tool annotations (readOnlyHint/destructiveHint) despite clear risk differences (query vs execute). Tool composition is reasonable (each does one thing), but the lack of structured output documentation and missing parameter constraints severely limit agent reasoning.
Describe columns, types, and constraints of a table.
Run INSERT, UPDATE, or DELETE. Blocked in read-only mode.
Run EXPLAIN ANALYZE on a query and return the plan.
List all schemas in the database.
List all tables in a schema.
Run a SELECT query and return rows as JSON.
Credentials exposed as tool parameters: all tools require 'dsn' (database connection string) as input. This violates secret-injection pattern, credentials in parameters are logged, traced, and risk exposure in agent logs and prompt history.
Output schemas not documented. Agents cannot predict response structure (e.g., does query() return {rows: [...], count: N} or {data: [...], meta: {...}}?). This forces agents to guess and wastes tokens on error recovery.
Descriptions are too short (10-50 chars, baseline 50-200). Generic text like 'Run a SELECT query' lacks context for LLM selection. No guidance on when to use query vs explain, or what each returns.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 42 | 2026-07-28+ | v2 |
No tool annotations despite clear risk differences. execute() is destructive (WRITE risk), but no destructiveHint or confirmation pattern. query() is read-only, but no readOnlyHint. Agents cannot distinguish safe from unsafe operations.
No error handling or recovery guidance. If a query fails (syntax error, permission denied, timeout), agents receive no actionable next steps. No categorization of retryable vs fatal errors.