MCP server for PostgreSQL. Inspect schemas, run safe SELECTs, explain queries, audit slow queries — from Claude Desktop, Cursor, or any MCP-compatible client. Read-only by default; explicit writes opt-in.
Server has 8 well-named tools with clear descriptions and proper input schemas using Zod validation. Naming follows verb_noun convention (list_schemas, describe_table, query). Descriptions are substantive (avg ~150 chars) and explain WHAT, WHEN, and constraints. However, parameter descriptions are minimal or absent in several tools (e.g., 'limit' in slow_queries lacks detail on what 'top N' means). Output schemas are not documented, LLMs cannot predict response structure. Error handling is basic (throws strings, no recovery guidance). Security is strong (read-only by default, write-gated). Composition is clean (single responsibility per tool). Missing: output schema documentation, detailed parameter descriptions, error classification, and actionable error messages.
Columns, types, defaults, nullability, indexes, foreign keys for one table.
Run EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) on a query and return the plan. Read-only — does not commit anything.
All non-system schemas in the database with their owner.
Tables, their estimated row count, and total size on disk for one schema.
Execute a SELECT-class query (SELECT, WITH, EXPLAIN, SHOW). Blocked: INSERT/UPDATE/DELETE/DDL. Runs inside a transaction that always ROLLBACKs. Set `limit` to cap row count (default 100).
Show top N queries by total time. Requires the pg_stat_statements extension. Returns mean exec time, total time, calls, and a normalized query.
Output schemas not documented. LLMs cannot predict response structure (columns, types, field names). Tools return JSON via ok() helper but no schema is declared in tool registration.
Parameter descriptions are minimal or missing context. 'limit' in slow_queries lacks explanation of what 'top N' means (by total time? by calls?). 'sql' in query/explain lacks format hints (SELECT only? WITH allowed?).
Error handling is generic. Throws plain strings ('query tool is read-only...') with no recovery guidance. No error classification (retryable vs fatal). LLM cannot determine next action.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | D | 56 | 2026-07-28+ | v2 |
Estimate of wasted disk space per table (heuristic; not exact). Useful before deciding to VACUUM FULL.
Execute INSERT/UPDATE/DELETE/DDL. Returns rowCount. Use only when you trust the caller — this commits.
slow_queries and table_bloat lack prerequisites documentation. slow_queries requires pg_stat_statements extension but does not guide LLM on what to do if it's missing. table_bloat is heuristic but no guidance on accuracy limits.
No pagination support. query tool caps results at 100 rows by default, but no offset/cursor mechanism for large result sets. Agents cannot iterate through multi-page results.